shioricode 0.4.20 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/README.md +5 -5
  2. package/dist/bin.cjs +13321 -12637
  3. package/dist/bin.mjs +13314 -12630
  4. package/dist/client/assets/{ArtifactPanel-DhNMewF_.js → ArtifactPanel-BSCph4Mf.js} +2 -2
  5. package/dist/client/assets/{ChatMarkdown-CQLSgdaS.js → ChatMarkdown-D-ZCYVVA.js} +2 -2
  6. package/dist/client/assets/{DiffPanel-IxDswq5p.js → DiffPanel-CzDdUb8m.js} +3 -3
  7. package/dist/client/assets/DiffPanelShell-Jyeb1irB.js +2 -0
  8. package/dist/client/assets/{DiffWorkerPoolProvider-dhrEONTb.js → DiffWorkerPoolProvider-Df_KelZ4.js} +2 -2
  9. package/dist/client/assets/NoActiveThreadState-CafEeJ3D.js +2 -0
  10. package/dist/client/assets/ProviderModelPicker-DBL7REnB.js +2 -0
  11. package/dist/client/assets/SettingsPanels-DToV4poM.js +4 -0
  12. package/dist/client/assets/_chat-DIsZX_5q.js +2 -0
  13. package/dist/client/assets/_chat._threadId-DciDVFNC.js +289 -0
  14. package/dist/client/assets/{_chat.index-B4NLV9mk.js → _chat.index-Bu5_KLvf.js} +2 -2
  15. package/dist/client/assets/automations-B8oI1RDH.js +2 -0
  16. package/dist/client/assets/{badge-BaTrdaZE.js → badge-DQNpCiTY.js} +2 -2
  17. package/dist/client/assets/clientSettings-BoLlsjmq.js +2 -0
  18. package/dist/client/assets/{collapsible-DfWqkHJg.js → collapsible-BFxx3cmC.js} +2 -2
  19. package/dist/client/assets/{dialog-DjTpVApd.js → dialog-xuDGeb4n.js} +2 -2
  20. package/dist/client/assets/{empty-Be-8qJMT.js → empty-C0odYOnP.js} +2 -2
  21. package/dist/client/assets/{gitReactQuery-TUte-oT5.js → gitReactQuery-CQYez3In.js} +2 -2
  22. package/dist/client/assets/index-Cr2B1Z-_.css +2 -0
  23. package/dist/client/assets/index-ndFBrjHh.js +6 -0
  24. package/dist/client/assets/{input-CE9hmpu7.js → input-C7biIuoM.js} +2 -2
  25. package/dist/client/assets/pull-requests-YReb4Mu9.js +46 -0
  26. package/dist/client/assets/queuedTurnsStore-BWvSKxB2.js +2 -0
  27. package/dist/client/assets/{scroll-area-CbQzkLT_.js → scroll-area-b0VYEw63.js} +2 -2
  28. package/dist/client/assets/{separator-DI5DQ7Ks.js → separator-BSFlxFW1.js} +2 -2
  29. package/dist/client/assets/settings-BBptnNYJ.js +2 -0
  30. package/dist/client/assets/settings.appearance-BkWweygw.js +2 -0
  31. package/dist/client/assets/settings.archived-DJC1il-F.js +2 -0
  32. package/dist/client/assets/{settings.computer-use-tZN9IYDg.js → settings.computer-use-BK97T3f-.js} +2 -2
  33. package/dist/client/assets/{settings.credits-BpgwqbI7.js → settings.credits-C2nerPpd.js} +2 -2
  34. package/dist/client/assets/settings.general-Djd4g0t8.js +2 -0
  35. package/dist/client/assets/settings.mcp-b1gcVG3u.js +2 -0
  36. package/dist/client/assets/{settings.mobile-PxkOX11C.js → settings.mobile-Cl_q074X.js} +2 -2
  37. package/dist/client/assets/{settings.plugins-CQejJM2o.js → settings.plugins-Bz_Jt-h5.js} +2 -2
  38. package/dist/client/assets/settings.remote-COKGS805.js +2 -0
  39. package/dist/client/assets/{settings.skills-Cg57qd7S.js → settings.skills-DbcoPmK9.js} +2 -2
  40. package/dist/client/assets/{settings.theme-builder-DUu9nCmf.js → settings.theme-builder-D3sYNxrp.js} +2 -2
  41. package/dist/client/assets/{skillsMcpShared-CGi0RTQJ.js → skillsMcpShared-DzSsN5fy.js} +2 -2
  42. package/dist/client/assets/store-BzqS7zm8.js +12 -0
  43. package/dist/client/assets/{terminalStateStore-COv6Fwmt.js → terminalStateStore-BhU1c2Sw.js} +2 -2
  44. package/dist/client/assets/{textarea-CFQ0q5G1.js → textarea-Bc_w4o11.js} +2 -2
  45. package/dist/client/assets/{toggle-CwB81Wb2.js → toggle-Cjd1rTpW.js} +2 -2
  46. package/dist/client/assets/{toggle-group-B4poMzYg.js → toggle-group-CbQjlXXY.js} +2 -2
  47. package/dist/client/assets/{uiStateStore-DsIsCBO9.js → uiStateStore-CGeY60Rr.js} +2 -2
  48. package/dist/client/assets/{useHandleNewThread-DtShg-Gb.js → useHandleNewThread-CxLIGmcC.js} +2 -2
  49. package/dist/client/assets/useSettings-CfiGcPkS.js +2 -0
  50. package/dist/client/assets/{useTheme-CpDK1jpf.js → useTheme-CVq6D9IF.js} +2 -2
  51. package/dist/client/assets/utils-BnXGGW32.js +2 -0
  52. package/dist/client/assets/{vendor-effect-DldSDsna.js → vendor-effect-Chd9hYxF.js} +1 -1
  53. package/dist/client/assets/{vendor-ui-D-080HIn.js → vendor-ui-CJZCHXkp.js} +2 -2
  54. package/dist/client/index.html +15 -15
  55. package/package.json +2 -2
  56. package/dist/client/assets/DiffPanelShell-BYPngGr7.js +0 -2
  57. package/dist/client/assets/NoActiveThreadState-BhsV4knw.js +0 -2
  58. package/dist/client/assets/ProviderModelPicker-DvZxygLs.js +0 -2
  59. package/dist/client/assets/SettingsPanels-CcxbSb2Y.js +0 -4
  60. package/dist/client/assets/_chat-BKEfH7bm.js +0 -2
  61. package/dist/client/assets/_chat._threadId-CKYAWkIl.js +0 -289
  62. package/dist/client/assets/automations-BaROU0my.js +0 -2
  63. package/dist/client/assets/clientSettings-333fq8u7.js +0 -2
  64. package/dist/client/assets/index-DO0-ySqI.js +0 -6
  65. package/dist/client/assets/index-Hee7CrbY.css +0 -2
  66. package/dist/client/assets/pull-requests-D0RjDNry.js +0 -46
  67. package/dist/client/assets/queuedTurnsStore-C44-Rdam.js +0 -2
  68. package/dist/client/assets/settings-DYPhYb14.js +0 -2
  69. package/dist/client/assets/settings.appearance-DcK3XBNk.js +0 -2
  70. package/dist/client/assets/settings.archived-bTn7EzG_.js +0 -2
  71. package/dist/client/assets/settings.general-C_Aq9Mn4.js +0 -2
  72. package/dist/client/assets/settings.mcp-BnzVTWcW.js +0 -2
  73. package/dist/client/assets/settings.remote-BlV5n30n.js +0 -2
  74. package/dist/client/assets/store-8a4nbwgb.js +0 -12
  75. package/dist/client/assets/useSettings-Bof_skNF.js +0 -2
  76. package/dist/client/assets/utils-X2TItr-k.js +0 -2
@@ -1,2 +1,2 @@
1
- import{t as e}from"./vendor-react-BvVnE5E6.js";import{c as t}from"./vendor--lexical-react-Dg6NVZQt.js";import{t as n}from"./utils-X2TItr-k.js";import{Ct as r}from"./vendor-ui-D-080HIn.js";var i=e(),a=t();function o(e){let t=(0,i.c)(23),o,s,c,l,u;t[0]===e?(o=t[1],s=t[2],c=t[3],l=t[4],u=t[5]):({className:o,size:c,unstyled:l,nativeInput:u,...s}=e,t[0]=e,t[1]=o,t[2]=s,t[3]=c,t[4]=l,t[5]=u);let d=c===void 0?`default`:c,f=l===void 0?!1:l,p=u===void 0?!1:u,m=d===`sm`&&`h-7.5 px-[calc(--spacing(2.5)-1px)] leading-7.5 sm:h-6.5 sm:leading-6.5`,h=d===`lg`&&`h-9.5 leading-9.5 sm:h-8.5 sm:leading-8.5`,g=s.type===`search`&&`[&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none [&::-webkit-search-results-button]:appearance-none [&::-webkit-search-results-decoration]:appearance-none`,_=s.type===`file`&&`text-muted-foreground file:me-3 file:bg-transparent file:font-medium file:text-foreground file:text-sm`,v;t[6]!==m||t[7]!==h||t[8]!==g||t[9]!==_?(v=n(`h-8.5 w-full min-w-0 rounded-[inherit] px-[calc(--spacing(3)-1px)] leading-8.5 outline-none placeholder:text-muted-foreground/72 sm:h-7.5 sm:leading-7.5 [transition:background-color_5000000s_ease-in-out_0s]`,m,h,g,_),t[6]=m,t[7]=h,t[8]=g,t[9]=_,t[10]=v):v=t[10];let y=v,b;t[11]!==o||t[12]!==f?(b=n(!f&&`relative inline-flex w-full rounded-lg border border-input bg-background not-dark:bg-clip-padding text-base text-foreground shadow-xs/5 ring-ring/24 transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] has-focus-visible:has-aria-invalid:border-destructive/64 has-focus-visible:has-aria-invalid:ring-destructive/16 has-aria-invalid:border-destructive/36 has-focus-visible:border-ring has-autofill:bg-foreground/4 has-disabled:opacity-64 has-[:disabled,:focus-visible,[aria-invalid]]:shadow-none has-focus-visible:ring-[3px] sm:text-sm dark:bg-input/32 dark:has-autofill:bg-foreground/8 dark:has-aria-invalid:ring-destructive/24 dark:not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)]`,o)||void 0,t[11]=o,t[12]=f,t[13]=b):b=t[13];let x;t[14]!==y||t[15]!==p||t[16]!==s||t[17]!==d?(x=p?(0,a.jsx)(`input`,{className:y,"data-slot":`input`,size:typeof d==`number`?d:void 0,...s}):(0,a.jsx)(r,{className:y,"data-slot":`input`,size:typeof d==`number`?d:void 0,...s}),t[14]=y,t[15]=p,t[16]=s,t[17]=d,t[18]=x):x=t[18];let S;return t[19]!==d||t[20]!==x||t[21]!==b?(S=(0,a.jsx)(`span`,{className:b,"data-size":d,"data-slot":`input-control`,children:x}),t[19]=d,t[20]=x,t[21]=b,t[22]=S):S=t[22],S}export{o as t};
2
- //# sourceMappingURL=input-CE9hmpu7.js.map
1
+ import{t as e}from"./vendor-react-BvVnE5E6.js";import{c as t}from"./vendor--lexical-react-Dg6NVZQt.js";import{t as n}from"./utils-BnXGGW32.js";import{Et as r}from"./vendor-ui-CJZCHXkp.js";var i=e(),a=t();function o(e){let t=(0,i.c)(23),o,s,c,l,u;t[0]===e?(o=t[1],s=t[2],c=t[3],l=t[4],u=t[5]):({className:o,size:c,unstyled:l,nativeInput:u,...s}=e,t[0]=e,t[1]=o,t[2]=s,t[3]=c,t[4]=l,t[5]=u);let d=c===void 0?`default`:c,f=l===void 0?!1:l,p=u===void 0?!1:u,m=d===`sm`&&`h-7.5 px-[calc(--spacing(2.5)-1px)] leading-7.5 sm:h-6.5 sm:leading-6.5`,h=d===`lg`&&`h-9.5 leading-9.5 sm:h-8.5 sm:leading-8.5`,g=s.type===`search`&&`[&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none [&::-webkit-search-results-button]:appearance-none [&::-webkit-search-results-decoration]:appearance-none`,_=s.type===`file`&&`text-muted-foreground file:me-3 file:bg-transparent file:font-medium file:text-foreground file:text-sm`,v;t[6]!==m||t[7]!==h||t[8]!==g||t[9]!==_?(v=n(`h-8.5 w-full min-w-0 rounded-[inherit] px-[calc(--spacing(3)-1px)] leading-8.5 outline-none placeholder:text-muted-foreground/72 sm:h-7.5 sm:leading-7.5 [transition:background-color_5000000s_ease-in-out_0s]`,m,h,g,_),t[6]=m,t[7]=h,t[8]=g,t[9]=_,t[10]=v):v=t[10];let y=v,b;t[11]!==o||t[12]!==f?(b=n(!f&&`relative inline-flex w-full rounded-lg border border-input bg-background not-dark:bg-clip-padding text-base text-foreground shadow-xs/5 ring-ring/24 transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] has-focus-visible:has-aria-invalid:border-destructive/64 has-focus-visible:has-aria-invalid:ring-destructive/16 has-aria-invalid:border-destructive/36 has-focus-visible:border-ring has-autofill:bg-foreground/4 has-disabled:opacity-64 has-[:disabled,:focus-visible,[aria-invalid]]:shadow-none has-focus-visible:ring-[3px] sm:text-sm dark:bg-input/32 dark:has-autofill:bg-foreground/8 dark:has-aria-invalid:ring-destructive/24 dark:not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)]`,o)||void 0,t[11]=o,t[12]=f,t[13]=b):b=t[13];let x;t[14]!==y||t[15]!==p||t[16]!==s||t[17]!==d?(x=p?(0,a.jsx)(`input`,{className:y,"data-slot":`input`,size:typeof d==`number`?d:void 0,...s}):(0,a.jsx)(r,{className:y,"data-slot":`input`,size:typeof d==`number`?d:void 0,...s}),t[14]=y,t[15]=p,t[16]=s,t[17]=d,t[18]=x):x=t[18];let S;return t[19]!==d||t[20]!==x||t[21]!==b?(S=(0,a.jsx)(`span`,{className:b,"data-size":d,"data-slot":`input-control`,children:x}),t[19]=d,t[20]=x,t[21]=b,t[22]=S):S=t[22],S}export{o as t};
2
+ //# sourceMappingURL=input-C7biIuoM.js.map
@@ -0,0 +1,46 @@
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{P as u,h as d,l as f,s as p,u as m}from"./clientSettings-BoLlsjmq.js";import"./vendor-effect-Chd9hYxF.js";import{V as h,c as g,t as _}from"./utils-BnXGGW32.js";import{At as v,St as y,i as b,ot as x,vt as S,xt as C}from"./store-BzqS7zm8.js";import{t as w}from"./uiStateStore-CGeY60Rr.js";import{Dn as T,En as E,Er as D,Lr as O,Rn as k,Rr as A,Un as j,Vn as ee,Wn as M,Xn as N,mr as te,or as ne,sr as P}from"./vendor-ui-CJZCHXkp.js";import{a as re,c as F,i as ie,o as ae,r as oe,s as se}from"./gitReactQuery-CQYez3In.js";import"./input-C7biIuoM.js";import{t as I}from"./scroll-area-b0VYEw63.js";import"./separator-BSFlxFW1.js";import{L as ce,a as le,n as ue}from"./vendor-diffs-CBk6gACd.js";import{G as L,J as R,K as z,U as B,V as de,W as V,q as H,r as fe,z as pe}from"./index-ndFBrjHh.js";import{a as me,i as he,l as ge,s as _e}from"./DiffPanelShell-Jyeb1irB.js";import{t as ve}from"./useTheme-CVq6D9IF.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-D-ZCYVVA.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-CbQjlXXY.js";import"./toggle-Cjd1rTpW.js";import{t as Se}from"./badge-DQNpCiTY.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-C0odYOnP.js";import{n as Te,r as Ee,t as De}from"./collapsible-BFxx3cmC.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=de(),l=(0,X.useRef)(null),u=(0,X.useRef)(null),[d,f]=(0,X.useState)(Je),p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p=e=>{let t=Q(e);f(t),m(Re,t,n)},t[0]=p):p=t[0];let h=p,g;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{u.current=null,document.body.style.removeProperty(`cursor`),document.body.style.removeProperty(`user-select`)},t[1]=g):g=t[1];let v=g,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)(R,{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)(H,{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=_(`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=f(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(),f=(0,X.useRef)(null),m=b(e=>e.projects.find(e=>e.id===t)??null),w=m?.cwd??null,E=a(oe({cwd:w,filter:e})),O=(0,X.useMemo)(()=>E.data?E.data.pullRequests.find(e=>e.number===n)??null:null,[E.data,n]),A=a(ae({cwd:w,number:n})),j=A.data?.diff??``,N=(0,X.useMemo)(()=>{let e=j.trim();return e.length===0?null:_e(e,`pull-requests-panel:${u}`)},[j,u]),F=(0,X.useMemo)(()=>{let e=j.trim();if(e.length===0)return[];try{return ce(e,N??void 0).flatMap(e=>e.files).toSorted((e,t)=>Ge(e).localeCompare(Ge(t),void 0,{numeric:!0,sensitivity:`base`}))}catch{return[]}},[N,j]),I=be({rootRef:f,enabled:!A.isLoading&&!A.isError&&F.length>0&&!!N,dependencyKey:`${N??`none`}:${A.isError?`error`:`ok`}:${A.isLoading?`loading`:`ready`}:${F.length}:${u}`}),L=a(se({cwd:w,number:n,pullRequest:O})),R=a(re({cwd:w,number:n})),[B,de]=(0,X.useState)(`files`),V=L.data?.summary??null,H=i(ie({cwd:w,queryClient:l})),fe=(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]),pe=(0,X.useCallback)(async()=>{if(!(!O||!w))try{let e=await H.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,H,w,O]),Ce=(0,X.useCallback)(()=>{if(!O||!m)return;let e=V&&V.length>0?`\n\n**AI summary of changes:**\n${V}`:``,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=x.getState(),r=g();n.setProjectDraftThreadId(m.id,r,{createdAt:new Date().toISOString(),envMode:`local`,runtimeMode:h}),n.applyStickyState(r),n.setPrompt(r,t),o({to:`/$threadId`,params:{threadId:r}})},[o,m,O,V]),we=O?.state===`open`?`success`:O?.state===`merged`?`secondary`:`error`,Te=!A.isLoading&&!A.isError&&F.length>0&&!I;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:_(`mt-px flex size-8 shrink-0 items-center justify-center rounded-lg`,ke[Ae(O)]),"aria-hidden":!0,children:(0,Z.jsx)(P,{className:`size-4`})}):(0,Z.jsx)(z,{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)(ee,{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)(k,{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)(p,{type:`button`,size:`icon`,variant:`ghost`,"aria-label":`Close pull request detail`,className:`size-7 shrink-0`,onClick:r,children:(0,Z.jsx)(M,{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)(p,{type:`button`,size:`xs`,disabled:!O||H.isPending,className:`gap-1.5 rounded-r-none`,onClick:()=>{pe()},children:[(0,Z.jsx)(D,{className:`size-3.5`,"aria-hidden":!0}),H.isPending?`Checking out…`:`Checkout`]}),(0,Z.jsxs)(S,{children:[(0,Z.jsx)(v,{render:(0,Z.jsx)(p,{type:`button`,size:`xs`,"aria-label":`More checkout options`,disabled:!O||H.isPending,className:`-ml-px rounded-l-none border-l border-l-primary-foreground/20 px-1.5`}),children:(0,Z.jsx)(ne,{className:`size-3.5`,"aria-hidden":!0})}),(0,Z.jsxs)(y,{align:`end`,side:`bottom`,children:[(0,Z.jsxs)(C,{onClick:()=>{pe()},children:[(0,Z.jsx)(D,{className:`size-3.5`,"aria-hidden":!0}),`Checkout`]}),(0,Z.jsxs)(C,{onClick:fe,children:[(0,Z.jsx)(te,{className:`size-3.5`,"aria-hidden":!0}),`Open in GitHub`]})]})]})]}),(0,Z.jsxs)(p,{type:`button`,size:`xs`,variant:`outline`,disabled:!O||!m,className:`gap-1.5`,onClick:Ce,children:[(0,Z.jsx)(T,{className:`size-3.5`,"aria-hidden":!0}),`Review`]})]}),(0,Z.jsx)(`div`,{className:`border-t border-border/60 px-4 py-3`,children:L.isLoading?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1.5`,"aria-label":`Loading pull request summary`,children:[(0,Z.jsx)(z,{className:`h-3 w-11/12 rounded-full`}),(0,Z.jsx)(z,{className:`h-3 w-10/12 rounded-full`}),(0,Z.jsx)(z,{className:`h-3 w-9/12 rounded-full`}),(0,Z.jsx)(z,{className:`h-3 w-8/12 rounded-full`})]}):L.isError?(0,Z.jsx)(`p`,{className:`text-pretty text-xs text-muted-foreground/80`,children:`Failed to summarize this pull request.`}):V&&V.length>0?(0,Z.jsx)(U,{text:V,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:[B],onValueChange:e=>{let t=e[0];(t===`files`||t===`conversation`)&&de(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]})]})}),B===`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:A.isLoading?(0,Z.jsx)(me,{label:`Loading the diff`}):A.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)(M,{})}),(0,Z.jsx)(K,{className:`text-pretty`,children:`Failed to load diff`}),(0,Z.jsx)(q,{className:`text-pretty`,children:A.error instanceof Error?A.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:f,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)(j,{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)(te,{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)(M,{})}),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)(A,{})}),(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=I,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)(z,{className:`size-7 rounded-full`}),(0,Z.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,Z.jsx)(z,{className:`h-3 w-36 rounded-full`}),(0,Z.jsx)(z,{className:`h-3 w-11/12 rounded-full`}),(0,Z.jsx)(z,{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`?O:n.state===`changes_requested`?E:A,c=o===`success`?`text-success`:o===`destructive`?`text-destructive`:`text-muted-foreground`,l;t[2]===c?l=t[3]:(l=_(`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=b(e=>e.projects),d=w(e=>e.requestProjectAdd),f=o({queries:l.flatMap(e=>$.map(t=>oe({cwd:e.cwd,filter:t})))}),m=(0,X.useMemo)(()=>{let e={open:[],draft:[],closed:[]};for(let[t,n]of f.entries())e[$[t%$.length]].push(n);return e},[f]),h=m[e],g=(0,X.useMemo)(()=>{let e={};for(let t of $){let n=m[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},[m]),[v,y]=(0,X.useState)({}),x=(0,X.useCallback)((e,t)=>{y(n=>n[e]===t?n:{...n,[e]:t})},[]),S=(0,X.useMemo)(()=>l.map((t,n)=>{let r=h[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,h]),C=S.reduce((e,t)=>e+t.visiblePullRequests.length,0),T=h.every(e=>!e.isLoading)&&C===0,E=Le(e),D=(0,X.useCallback)(()=>{c.invalidateQueries({queryKey:F.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)(P,{})}),(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)(p,{onClick:d,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:_(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=g[t];return(0,Z.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":n,onClick:()=>i(t),className:_(`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:_(`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)(B,{children:[(0,Z.jsx)(L,{render:(0,Z.jsx)(p,{type:`button`,size:`icon-xs`,variant:`ghost`,className:`text-muted-foreground hover:text-foreground`,onClick:D,"aria-label":`Refresh pull requests`,children:(0,Z.jsx)(N,{className:`size-3.5`,"aria-hidden":!0})})}),(0,Z.jsx)(V,{children:`Refresh`})]})]})}),(0,Z.jsx)(I,{className:`min-h-0 flex-1`,children:(0,Z.jsxs)(`div`,{className:_(a,`flex flex-col gap-1.5 pt-3 pb-4`),children:[S.map(({project:i,state:a,visiblePullRequests:o})=>{let s=a.status===`success`?o.length:null,c=v[i.id]??Ie({status:a.status,visiblePullRequestsCount:s??0});return(0,Z.jsxs)(De,{open:c,onOpenChange:e=>x(i.id,e),children:[(0,Z.jsxs)(Ee,{className:_(`group/section sticky top-0 z-10 flex w-full items-center gap-1.5 rounded-md px-1 py-2`,u?`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)(ne,{className:_(`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)(z,{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)}),T?(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)(P,{})}),(0,Z.jsx)(K,{className:`text-pretty`,children:E.title}),(0,Z.jsx)(q,{className:`text-pretty`,children:E.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)(z,{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)(z,{className:`h-3 w-[70%] rounded-full`}),(0,Z.jsx)(z,{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=_(`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=_(`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)(P,{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 g;t[17]===n.headBranch?g=t[18]:(g=(0,Z.jsx)(`span`,{className:`max-w-[45%] truncate font-mono text-muted-foreground/80`,children:n.headBranch}),t[17]=n.headBranch,t[18]=g);let v;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Z.jsx)(k,{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]!==g||t[23]!==y?(b=(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1 text-[11px]`,children:[g,v,y]}),t[22]=g,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,d;t[6]===r?d=t[7]:(d=e=>{r({to:`/pull-requests`,search:{filter:e}})},t[6]=r,t[7]=d);let f=d,p=n.projectId??null,m=n.number??null,h=p!==null&&m!==null,g=h?`w-full px-4`:`mx-auto w-full max-w-3xl px-4`,v;t[8]===g?v=t[9]:(v=u?(0,Z.jsx)(`div`,{className:`drag-region flex h-[52px] shrink-0 items-center`,children:(0,Z.jsxs)(`div`,{className:_(g,`flex h-full items-center gap-2 select-none`),children:[(0,Z.jsx)(P,{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,`flex h-full items-center gap-2`),children:[(0,Z.jsx)(P,{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]=g,t[9]=v);let y;t[10]!==f||t[11]!==g||t[12]!==i||t[13]!==o||t[14]!==m||t[15]!==p?(y=(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden`,children:(0,Z.jsx)(it,{filter:i,selectedProjectId:p,selectedNumber:m,onSelect:o,onFilterChange:f,columnClass:g})}),t[10]=f,t[11]=g,t[12]=i,t[13]=o,t[14]=m,t[15]=p,t[16]=y):y=t[16];let b;t[17]!==v||t[18]!==y?(b=(0,Z.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background [contain:paint]`,children:[v,y]}),t[17]=v,t[18]=y,t[19]=b):b=t[19];let x;t[20]!==l||t[21]!==h||t[22]!==i||t[23]!==m||t[24]!==p?(x=(0,Z.jsx)(qe,{filter:i,open:h,projectId:p,number:m,onClose:l}),t[20]=l,t[21]=h,t[22]=i,t[23]=m,t[24]=p,t[25]=x):x=t[25];let S;return t[26]!==b||t[27]!==x?(S=(0,Z.jsx)(pe,{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:[b,x]})}),t[26]=b,t[27]=x,t[28]=S):S=t[28],S}function lt(){let e=(0,Y.c)(2),t=fe.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-YReb4Mu9.js.map
@@ -0,0 +1,2 @@
1
+ import{Y as e}from"./vendor--effect-atom-react-6hEhKm5I.js";import{Q as t}from"./utils-BnXGGW32.js";import{i as n,n as r,r as i}from"./vendor-zustand-qsUGoIcm.js";import{Jt as a,Xt as o,Yt as s}from"./store-BzqS7zm8.js";var c=`shioricode:queued-turns:v1`,l=1,u=Object.freeze({queuedTurnsByThreadId:{}}),d=Object.freeze([]),f=a(typeof localStorage<`u`?localStorage:s(),300);o(`queued-turns`,()=>{f.flush()});function p(e){return typeof e==`object`&&!!e}function m(e){switch(e){case`failed`:return`failed`;case`sending`:return`queued`;default:return`queued`}}function h(n){if(!p(n))return null;let r=p(n.composerSnapshot)?n.composerSnapshot:null,i=typeof n.id==`string`?n.id:``,a=typeof n.threadId==`string`?n.threadId:``,o=typeof n.messageId==`string`?n.messageId:``,s=typeof n.text==`string`?n.text:``,c=typeof n.titleSeed==`string`?n.titleSeed:``,l=typeof n.createdAt==`string`?n.createdAt:``;if(i.length===0||a.length===0||o.length===0||c.length===0||l.length===0)return null;let u=Array.isArray(n.attachments)?n.attachments:[],d=Array.isArray(r?.persistedAttachments)?r.persistedAttachments:[],f=Array.isArray(r?.terminalContexts)?r.terminalContexts:[],h=typeof r?.prompt==`string`?r.prompt:``,g=n.modelSelection,_=n.runtimeMode,v=n.interactionMode,y=e(t)(n.goalIntent)?n.goalIntent:null;return!g||_!==`approval-required`&&_!==`full-access`||v!==`default`&&v!==`plan`?null:{id:i,threadId:a,messageId:o,text:s,attachments:u,modelSelection:g,runtimeMode:_,interactionMode:v,goalIntent:y,titleSeed:c,createdAt:l,composerSnapshot:{prompt:h,persistedAttachments:d,terminalContexts:f},status:m(n.status),errorMessage:typeof n.errorMessage==`string`&&n.errorMessage.trim().length>0?n.errorMessage:null}}function g(e){if(!p(e))return u;let t={};for(let[n,r]of Object.entries(e.queuedTurnsByThreadId??{})){if(!Array.isArray(r)||n.length===0)continue;let e=r.map(e=>h(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,goalIntent:e.goalIntent,titleSeed:e.titleSeed,createdAt:e.createdAt,composerSnapshot:e.composerSnapshot,status:`queued`,errorMessage:null}:e);e.length>0&&(t[n]=e)}return{queuedTurnsByThreadId:t}}function _(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 v(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 y=n()(i(e=>({queuedTurnsByThreadId:{},enqueueQueuedTurn:t=>{let n={...t,status:`queued`,errorMessage:null};return e(e=>v(e,t.threadId,e=>[...e,n])),n},removeQueuedTurn:(t,n)=>{t.length===0||n.length===0||e(e=>v(e,t,e=>e.filter(e=>e.id!==n)))},markQueuedTurnSending:(t,n)=>{t.length===0||n.length===0||e(e=>v(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=>v(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:c,version:l,storage:r(()=>f),partialize:_,merge:(e,t)=>({...t,...g(e)})}));function b(e,t){return t?e[t]??d:d}export{y as n,b as t};
2
+ //# sourceMappingURL=queuedTurnsStore-BWvSKxB2.js.map
@@ -1,2 +1,2 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{Ci as t}from"./vendor--effect-atom-react-6hEhKm5I.js";import{t as n}from"./vendor-react-BvVnE5E6.js";import{c as r}from"./vendor--lexical-react-Dg6NVZQt.js";import{t as i}from"./utils-X2TItr-k.js";import{St as a,bt as o,vt as s,xt as c,yt as l}from"./vendor-ui-D-080HIn.js";var u=n(),d=e(t(),1),f=r();function p(e){let t=(0,u.c)(30),n,r,o,l,p,g;t[0]===e?(n=t[1],r=t[2],o=t[3],l=t[4],p=t[5],g=t[6]):({className:r,children:n,scrollFade:l,scrollbarGutter:p,hideScrollbars:g,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=o,t[4]=l,t[5]=p,t[6]=g);let _=l===void 0?!1:l,v=p===void 0?!1:p,y=g===void 0?!1:g,[b,x]=(0,d.useState)(0),[S,C]=(0,d.useState)(0),w;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(w=e=>{let t=e.scrollTop,n=e.scrollHeight-e.scrollTop-e.clientHeight,r=m;x(r(t)),C(r(n))},t[7]=w):w=t[7];let T=w,E;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(E=e=>{T(e.currentTarget)},t[8]=E):E=t[8];let D=E,O;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(O=e=>{e&&T(e)},t[9]=O):O=t[9];let k=O,A;t[10]===r?A=t[11]:(A=i(`relative size-full min-h-0`,r),t[10]=r,t[11]=A);let j=v&&`data-has-overflow-y:pe-2.5 data-has-overflow-x:pb-2.5`,M=y&&`[-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,N;t[12]!==j||t[13]!==M?(N=i(`h-full overscroll-contain rounded-[inherit] outline-none transition-shadows focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background data-has-overflow-x:overscroll-x-contain`,j,M),t[12]=j,t[13]=M,t[14]=N):N=t[14];let P;t[15]!==n||t[16]!==N?(P=(0,f.jsx)(c,{className:N,onScroll:D,ref:k,"data-slot":`scroll-area-viewport`,children:n}),t[15]=n,t[16]=N,t[17]=P):P=t[17];let F;t[18]!==S||t[19]!==_||t[20]!==b?(F=_?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-x-0 top-0 h-6 rounded-t-[inherit] bg-linear-to-b from-background to-transparent`,style:{opacity:b}}),(0,f.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-x-0 bottom-0 h-6 rounded-b-[inherit] bg-linear-to-t from-background to-transparent`,style:{opacity:S}})]}):null,t[18]=S,t[19]=_,t[20]=b,t[21]=F):F=t[21];let I;t[22]===y?I=t[23]:(I=!y&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(h,{orientation:`vertical`}),(0,f.jsx)(h,{orientation:`horizontal`}),(0,f.jsx)(s,{"data-slot":`scroll-area-corner`})]}),t[22]=y,t[23]=I);let L;return t[24]!==o||t[25]!==P||t[26]!==F||t[27]!==I||t[28]!==A?(L=(0,f.jsxs)(a,{className:A,...o,children:[P,F,I]}),t[24]=o,t[25]=P,t[26]=F,t[27]=I,t[28]=A,t[29]=L):L=t[29],L}function m(e){return Math.max(0,Math.min(1,e/56))}function h(e){let t=(0,u.c)(11),n,r,a;t[0]===e?(n=t[1],r=t[2],a=t[3]):({className:n,orientation:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=a);let s=a===void 0?`vertical`:a,c;t[4]===n?c=t[5]:(c=i(`m-1 flex opacity-0 transition-opacity delay-300 data-[orientation=horizontal]:h-1.5 data-[orientation=vertical]:w-1.5 data-[orientation=horizontal]:flex-col data-hovering:opacity-100 data-scrolling:opacity-100 data-hovering:delay-0 data-scrolling:delay-0 data-hovering:duration-100 data-scrolling:duration-100`,n),t[4]=n,t[5]=c);let d;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,f.jsx)(l,{className:`relative flex-1 rounded-full bg-foreground/20`,"data-slot":`scroll-area-thumb`}),t[6]=d):d=t[6];let p;return t[7]!==s||t[8]!==r||t[9]!==c?(p=(0,f.jsx)(o,{className:c,"data-slot":`scroll-area-scrollbar`,orientation:s,...r,children:d}),t[7]=s,t[8]=r,t[9]=c,t[10]=p):p=t[10],p}export{p as t};
2
- //# sourceMappingURL=scroll-area-CbQzkLT_.js.map
1
+ import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{Ci as t}from"./vendor--effect-atom-react-6hEhKm5I.js";import{t as n}from"./vendor-react-BvVnE5E6.js";import{c as r}from"./vendor--lexical-react-Dg6NVZQt.js";import{t as i}from"./utils-BnXGGW32.js";import{Ct as a,St as o,Tt as s,wt as c,xt as l}from"./vendor-ui-CJZCHXkp.js";var u=n(),d=e(t(),1),f=r();function p(e){let t=(0,u.c)(30),n,r,a,o,p,g;t[0]===e?(n=t[1],r=t[2],a=t[3],o=t[4],p=t[5],g=t[6]):({className:r,children:n,scrollFade:o,scrollbarGutter:p,hideScrollbars:g,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=a,t[4]=o,t[5]=p,t[6]=g);let _=o===void 0?!1:o,v=p===void 0?!1:p,y=g===void 0?!1:g,[b,x]=(0,d.useState)(0),[S,C]=(0,d.useState)(0),w;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(w=e=>{let t=e.scrollTop,n=e.scrollHeight-e.scrollTop-e.clientHeight,r=m;x(r(t)),C(r(n))},t[7]=w):w=t[7];let T=w,E;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(E=e=>{T(e.currentTarget)},t[8]=E):E=t[8];let D=E,O;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(O=e=>{e&&T(e)},t[9]=O):O=t[9];let k=O,A;t[10]===r?A=t[11]:(A=i(`relative size-full min-h-0`,r),t[10]=r,t[11]=A);let j=v&&`data-has-overflow-y:pe-2.5 data-has-overflow-x:pb-2.5`,M=y&&`[-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,N;t[12]!==j||t[13]!==M?(N=i(`h-full overscroll-contain rounded-[inherit] outline-none transition-shadows focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background data-has-overflow-x:overscroll-x-contain`,j,M),t[12]=j,t[13]=M,t[14]=N):N=t[14];let P;t[15]!==n||t[16]!==N?(P=(0,f.jsx)(c,{className:N,onScroll:D,ref:k,"data-slot":`scroll-area-viewport`,children:n}),t[15]=n,t[16]=N,t[17]=P):P=t[17];let F;t[18]!==S||t[19]!==_||t[20]!==b?(F=_?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-x-0 top-0 h-6 rounded-t-[inherit] bg-linear-to-b from-background to-transparent`,style:{opacity:b}}),(0,f.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-x-0 bottom-0 h-6 rounded-b-[inherit] bg-linear-to-t from-background to-transparent`,style:{opacity:S}})]}):null,t[18]=S,t[19]=_,t[20]=b,t[21]=F):F=t[21];let I;t[22]===y?I=t[23]:(I=!y&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(h,{orientation:`vertical`}),(0,f.jsx)(h,{orientation:`horizontal`}),(0,f.jsx)(l,{"data-slot":`scroll-area-corner`})]}),t[22]=y,t[23]=I);let L;return t[24]!==a||t[25]!==P||t[26]!==F||t[27]!==I||t[28]!==A?(L=(0,f.jsxs)(s,{className:A,...a,children:[P,F,I]}),t[24]=a,t[25]=P,t[26]=F,t[27]=I,t[28]=A,t[29]=L):L=t[29],L}function m(e){return Math.max(0,Math.min(1,e/56))}function h(e){let t=(0,u.c)(11),n,r,s;t[0]===e?(n=t[1],r=t[2],s=t[3]):({className:n,orientation:s,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=s);let c=s===void 0?`vertical`:s,l;t[4]===n?l=t[5]:(l=i(`m-1 flex opacity-0 transition-opacity delay-300 data-[orientation=horizontal]:h-1.5 data-[orientation=vertical]:w-1.5 data-[orientation=horizontal]:flex-col data-hovering:opacity-100 data-scrolling:opacity-100 data-hovering:delay-0 data-scrolling:delay-0 data-hovering:duration-100 data-scrolling:duration-100`,n),t[4]=n,t[5]=l);let d;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,f.jsx)(o,{className:`relative flex-1 rounded-full bg-foreground/20`,"data-slot":`scroll-area-thumb`}),t[6]=d):d=t[6];let p;return t[7]!==c||t[8]!==r||t[9]!==l?(p=(0,f.jsx)(a,{className:l,"data-slot":`scroll-area-scrollbar`,orientation:c,...r,children:d}),t[7]=c,t[8]=r,t[9]=l,t[10]=p):p=t[10],p}export{p as t};
2
+ //# sourceMappingURL=scroll-area-b0VYEw63.js.map
@@ -1,2 +1,2 @@
1
- import{t as e}from"./vendor-react-BvVnE5E6.js";import{c as t}from"./vendor--lexical-react-Dg6NVZQt.js";import{t as n}from"./utils-X2TItr-k.js";import{Qt as r}from"./vendor-ui-D-080HIn.js";var i=e(),a=t();function o(e){let t=(0,i.c)(10),o,s,c;t[0]===e?(o=t[1],s=t[2],c=t[3]):({className:o,orientation:c,...s}=e,t[0]=e,t[1]=o,t[2]=s,t[3]=c);let l=c===void 0?`horizontal`:c,u;t[4]===o?u=t[5]:(u=n(`shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px data-[orientation=vertical]:not-[[class^='h-']]:not-[[class*='_h-']]:self-stretch`,o),t[4]=o,t[5]=u);let d;return t[6]!==l||t[7]!==s||t[8]!==u?(d=(0,a.jsx)(r,{className:u,"data-slot":`separator`,orientation:l,...s}),t[6]=l,t[7]=s,t[8]=u,t[9]=d):d=t[9],d}export{o as t};
2
- //# sourceMappingURL=separator-DI5DQ7Ks.js.map
1
+ import{t as e}from"./vendor-react-BvVnE5E6.js";import{c as t}from"./vendor--lexical-react-Dg6NVZQt.js";import{t as n}from"./utils-BnXGGW32.js";import{tn as r}from"./vendor-ui-CJZCHXkp.js";var i=e(),a=t();function o(e){let t=(0,i.c)(10),o,s,c;t[0]===e?(o=t[1],s=t[2],c=t[3]):({className:o,orientation:c,...s}=e,t[0]=e,t[1]=o,t[2]=s,t[3]=c);let l=c===void 0?`horizontal`:c,u;t[4]===o?u=t[5]:(u=n(`shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px data-[orientation=vertical]:not-[[class^='h-']]:not-[[class*='_h-']]:self-stretch`,o),t[4]=o,t[5]=u);let d;return t[6]!==l||t[7]!==s||t[8]!==u?(d=(0,a.jsx)(r,{className:u,"data-slot":`separator`,orientation:l,...s}),t[6]=l,t[7]=s,t[8]=u,t[9]=d):d=t[9],d}export{o as t};
2
+ //# sourceMappingURL=separator-BSFlxFW1.js.map
@@ -0,0 +1,2 @@
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{P as o,s}from"./clientSettings-BoLlsjmq.js";import"./vendor-effect-Chd9hYxF.js";import"./utils-BnXGGW32.js";import"./store-BzqS7zm8.js";import"./terminalStateStore-BhU1c2Sw.js";import"./uiStateStore-CGeY60Rr.js";import{lr as c}from"./vendor-ui-CJZCHXkp.js";import"./useSettings-CfiGcPkS.js";import"./useHandleNewThread-CxLIGmcC.js";import"./gitReactQuery-CQYez3In.js";import"./input-C7biIuoM.js";import"./scroll-area-b0VYEw63.js";import"./separator-BSFlxFW1.js";import{X as l,Y as u,z as d}from"./index-ndFBrjHh.js";import"./ProviderModelPicker-DBL7REnB.js";import"./empty-C0odYOnP.js";import"./collapsible-BFxx3cmC.js";import{d as f}from"./SettingsPanels-DToV4poM.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=!o&&(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)(s,{size:`xs`,variant:`outline`,disabled:g.length===0,onClick:()=>void v(),children:[(0,h.jsx)(c,{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=o&&(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)(s,{size:`xs`,variant:`outline`,disabled:g.length===0,onClick:()=>void v(),children:[(0,h.jsx)(c,{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-BBptnNYJ.js.map
@@ -0,0 +1,2 @@
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{P as a,s as o}from"./clientSettings-BoLlsjmq.js";import"./vendor-effect-Chd9hYxF.js";import{S as s,v as c,y as l}from"./utils-BnXGGW32.js";import"./store-BzqS7zm8.js";import"./terminalStateStore-BhU1c2Sw.js";import"./uiStateStore-CGeY60Rr.js";import{Pn as u,Ur as d,Wn as ee}from"./vendor-ui-CJZCHXkp.js";import{n as te,r as ne}from"./useSettings-CfiGcPkS.js";import"./useHandleNewThread-CxLIGmcC.js";import"./gitReactQuery-CQYez3In.js";import{t as f}from"./input-C7biIuoM.js";import{G as p,U as m,W as h,m as re,nt as g}from"./index-ndFBrjHh.js";import{i as ie,t as ae}from"./useTheme-CVq6D9IF.js";import{a as _,i as v,o as y,r as b,s as x}from"./ProviderModelPicker-DBL7REnB.js";import"./empty-C0odYOnP.js";import"./collapsible-BFxx3cmC.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-DToV4poM.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`,a;t[0]===r?a=t[1]:(a=e=>{e.stopPropagation(),r()},t[0]=r,t[1]=a);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,M.jsx)(u,{className:`size-3`}),t[2]=s):s=t[2];let c;t[3]!==i||t[4]!==a?(c=(0,M.jsx)(p,{render:(0,M.jsx)(o,{size:`icon-xs`,variant:`ghost`,"aria-label":i,className:`size-5 rounded-sm p-0 text-muted-foreground hover:text-foreground`,onClick:a,children:s})}),t[3]=i,t[4]=a,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 d;return t[7]===c?d=t[8]:(d=(0,M.jsxs)(m,{children:[c,l]}),t[7]=c,t[8]=d),d}function I(){let{theme:e,setTheme:t,importedThemes:n,lightThemeId:i,darkThemeId:u,setThemeAssignment:p,importTheme:m,removeImportedTheme:h,themeOptionsByAppearance:A}=ae(),I=te(),{updateSettings:L}=ne(),[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===s.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`,l)}),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:u===`builtin:shioricode-dark`?null:(0,M.jsx)(F,{label:`dark theme`,onClick:()=>p(`dark`,c)}),control:(0,M.jsxs)(b,{value:u,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===u)?.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)(o,{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`&&u===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)(o,{size:`xs`,variant:`outline`,onClick:()=>p(e.appearance,e.id),children:`Use`}),(0,M.jsx)(o,{size:`icon-xs`,variant:`ghost`,"aria-label":`Remove ${e.name}`,onClick:()=>h(e.id),children:(0,M.jsx)(ee,{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)(d,{className:`size-3`}),`Build your own theme`]})]})]}),a?(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===s.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===s.blurPersonalData?null:(0,M.jsx)(F,{label:`personal details masking`,onClick:()=>L({blurPersonalData:s.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===s.uiFontFamily?null:(0,M.jsx)(F,{label:`UI font`,onClick:()=>L({uiFontFamily:s.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===s.codeFontFamily?null:(0,M.jsx)(F,{label:`code font`,onClick:()=>L({codeFontFamily:s.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===s.timestampFormat?null:(0,M.jsx)(F,{label:`time format`,onClick:()=>L({timestampFormat:s.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===s.diffWordWrap?null:(0,M.jsx)(F,{label:`diff line wrapping`,onClick:()=>L({diffWordWrap:s.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-BkWweygw.js.map
@@ -0,0 +1,2 @@
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"./clientSettings-BoLlsjmq.js";import"./vendor-effect-Chd9hYxF.js";import"./utils-BnXGGW32.js";import"./store-BzqS7zm8.js";import"./terminalStateStore-BhU1c2Sw.js";import"./uiStateStore-CGeY60Rr.js";import"./vendor-ui-CJZCHXkp.js";import"./useSettings-CfiGcPkS.js";import"./useHandleNewThread-CxLIGmcC.js";import"./gitReactQuery-CQYez3In.js";import"./input-C7biIuoM.js";import"./ProviderModelPicker-DBL7REnB.js";import"./empty-C0odYOnP.js";import"./collapsible-BFxx3cmC.js";import{t as e}from"./SettingsPanels-DToV4poM.js";var t=e;export{t as component};
2
+ //# sourceMappingURL=settings.archived-DJC1il-F.js.map
@@ -1,2 +1,2 @@
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,d as i,m as a}from"./vendor-tanstack-DxB_J8A7.js";import{c as o}from"./vendor--lexical-react-Dg6NVZQt.js";import"./vendor-effect-DldSDsna.js";import{f as s,m as c,s as l}from"./clientSettings-333fq8u7.js";import"./utils-X2TItr-k.js";import"./store-8a4nbwgb.js";import"./terminalStateStore-COv6Fwmt.js";import"./uiStateStore-DsIsCBO9.js";import{Nr as u,Or as d,bn as f,kr as p,qn as m,ur as h,xr as g,yn as _}from"./vendor-ui-D-080HIn.js";import{n as v,r as y}from"./useSettings-Bof_skNF.js";import"./useHandleNewThread-DtShg-Gb.js";import"./gitReactQuery-TUte-oT5.js";import"./input-CE9hmpu7.js";import{M as b,N as x,j as S,nt as C}from"./index-DO0-ySqI.js";import"./ProviderModelPicker-DvZxygLs.js";import"./empty-Be-8qJMT.js";import"./collapsible-DfWqkHJg.js";import{a as w,o as T,p as E,s as D}from"./SettingsPanels-CcxbSb2Y.js";var O=n(),k=e(t(),1),A=[750,2e3,5e3,1e4,2e4,3e4];async function j(e,t){let n=t.requestPermission?await t.requestPermission({kind:e}):void 0;return n?.ok?n:(t.showPermissionGuide?await t.showPermissionGuide({kind:e}):void 0)??n??{ok:!1,kind:e,message:`Computer Use permission guides are unavailable in this browser.`}}function M(e,t){return e?.permissions.some(e=>e.kind===t&&e.state===`granted`)??!1}function N(e){let t=e.setTimeout??globalThis.setTimeout.bind(globalThis),n=e.clearTimeout??globalThis.clearTimeout.bind(globalThis),r=e.delaysMs??A,i=[],a=!1,o=()=>{if(!a){a=!0;for(let e of i.splice(0))n(e)}};for(let n of r)i.push(t(()=>{a||e.refresh().then(t=>{M(t,e.kind)&&(e.onGranted?.(t),o())}).catch(t=>{e.onError?.(t)})},n));return o}var P=o(),F=[`computerUse`,`permissions`],I=`relative overflow-hidden rounded-2xl border bg-card text-card-foreground shadow-xs/5 not-dark:bg-clip-padding before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-2xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] dark:before:shadow-[0_-1px_--theme(--color-white/6%)]`;function L(e){return{platform:`web`,supported:!1,helperAvailable:!1,helperPath:null,checkedAt:new Date().toISOString(),message:e,permissions:[{kind:`accessibility`,label:`Accessibility`,state:`unsupported`,detail:e},{kind:`screen-recording`,label:`Screen Recording`,state:`unsupported`,detail:e}]}}function R(e){switch(e.state){case`granted`:return{label:`Ready`,dot:`bg-success`,icon:(0,P.jsx)(f,{className:`size-4 text-success`})};case`unsupported`:return{label:`Unavailable`,dot:`bg-muted-foreground`,icon:(0,P.jsx)(_,{className:`size-4 text-muted-foreground`})};default:return{label:`Needs permission`,dot:`bg-warning`,icon:(0,P.jsx)(_,{className:`size-4 text-warning`})}}}function z(e){let t=(0,O.c)(28),{permission:n,onPermissionFlow:r,permissionFlowPending:i}=e,a;t[0]===n?a=t[1]:(a=R(n),t[0]=n,t[1]=a);let o=a,s=n.state!==`granted`&&n.state!==`unsupported`,c;t[2]===o.icon?c=t[3]:(c=(0,P.jsx)(`div`,{className:`mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-full bg-muted/60`,children:o.icon}),t[2]=o.icon,t[3]=c);let u;t[4]===n.label?u=t[5]:(u=(0,P.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:n.label}),t[4]=n.label,t[5]=u);let d=`size-1.5 rounded-full ${o.dot}`,f;t[6]===d?f=t[7]:(f=(0,P.jsx)(`span`,{className:d}),t[6]=d,t[7]=f);let p;t[8]!==f||t[9]!==o.label?(p=(0,P.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-full border border-border/70 px-2 py-0.5 text-[11px] text-muted-foreground`,children:[f,o.label]}),t[8]=f,t[9]=o.label,t[10]=p):p=t[10];let m;t[11]!==u||t[12]!==p?(m=(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[u,p]}),t[11]=u,t[12]=p,t[13]=m):m=t[13];let h;t[14]===n.detail?h=t[15]:(h=(0,P.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-muted-foreground`,children:n.detail}),t[14]=n.detail,t[15]=h);let g;t[16]!==m||t[17]!==h?(g=(0,P.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[m,h]}),t[16]=m,t[17]=h,t[18]=g):g=t[18];let _;t[19]!==s||t[20]!==r||t[21]!==n.kind||t[22]!==i?(_=s?(0,P.jsx)(l,{size:`sm`,variant:`outline`,disabled:i,onClick:()=>r(n.kind),children:`Guide me`}):null,t[19]=s,t[20]=r,t[21]=n.kind,t[22]=i,t[23]=_):_=t[23];let v;return t[24]!==_||t[25]!==c||t[26]!==g?(v=(0,P.jsxs)(`div`,{className:`flex items-start gap-3 border-t border-border px-4 py-4 first:border-t-0 sm:px-5`,children:[c,g,_]}),t[24]=_,t[25]=c,t[26]=g,t[27]=v):v=t[27],v}function B(){let e=(0,O.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[{icon:d,label:`Screenshots`},{icon:p,label:`Pointer`},{icon:h,label:`Keyboard`}],e[0]=t):t=e[0];let n=t,r;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,P.jsx)(`div`,{className:`grid gap-2 pt-3 sm:grid-cols-3`,children:n.map(V)}),e[1]=r):r=e[1],r}function V(e){let t=e.icon;return(0,P.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,P.jsx)(t,{className:`size-4 text-muted-foreground`}),(0,P.jsx)(`span`,{children:e.label})]},e.label)}function H(e){let t=e?.permissionSubject,n=t?.displayName?.trim(),r=t?.path?.trim();return n&&r?`${n} at ${r}`:n||r||null}function U(){let e=(0,O.c)(15),[t,n]=(0,k.useState)(null),i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={mutationFn:G,onSuccess:e=>n(e.imageDataUrl),onError:W},e[0]=i):i=e[0];let a=r(i),o;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:`Live desktop preview`}),(0,P.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:`Captures the full visible desktop through the same local macOS helper the agent uses.`})]}),e[1]=o):o=e[1];let s;e[2]===a?s=e[3]:(s=()=>a.mutate(),e[2]=a,e[3]=s);let c;e[4]===a.isPending?c=e[5]:(c=a.isPending?(0,P.jsx)(m,{className:`size-3.5 animate-spin`}):(0,P.jsx)(g,{className:`size-3.5`}),e[4]=a.isPending,e[5]=c);let u;e[6]!==a.isPending||e[7]!==s||e[8]!==c?(u=(0,P.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-border px-4 py-3 sm:px-5`,children:[o,(0,P.jsxs)(l,{size:`sm`,variant:`outline`,disabled:a.isPending,onClick:s,children:[c,`Capture`]})]}),e[6]=a.isPending,e[7]=s,e[8]=c,e[9]=u):u=e[9];let d;e[10]===t?d=e[11]:(d=(0,P.jsx)(`div`,{className:`bg-muted/30 p-4 sm:p-5`,children:t?(0,P.jsx)(`img`,{src:t,alt:`macOS desktop screenshot`,className:`max-h-[420px] w-full rounded-xl border border-border object-contain shadow-sm`}):(0,P.jsx)(`div`,{className:`flex min-h-48 items-center justify-center rounded-xl border border-dashed border-border bg-background/70 text-sm text-muted-foreground`,children:`No screenshot captured yet.`})}),e[10]=t,e[11]=d);let f;return e[12]!==u||e[13]!==d?(f=(0,P.jsxs)(`div`,{className:I,children:[u,d]}),e[12]=u,e[13]=d,e[14]=f):f=e[14],f}function W(e){C.add({type:`error`,title:`Could not capture desktop`,description:e instanceof Error?e.message:String(e)})}async function G(){let e=s().computer;if(!e)throw Error(`Computer Use is unavailable.`);return e.screenshot({})}function K(){let e=v(),{updateSettings:t}=y(),n=a(),r=(0,k.useRef)(null),[o,s]=(0,k.useState)(null),p=(0,k.useCallback)(async()=>{if(window.desktopBridge?.getComputerUsePermissions)return window.desktopBridge.getComputerUsePermissions();let e=c()?.computer;return e?e.getPermissions():L(`Computer Use is available in the ShioriCode desktop app or a trusted local native API session.`)},[]),h=i({queryKey:F,queryFn:p,enabled:!0,staleTime:5e3,refetchOnWindowFocus:!0}),g=(0,k.useMemo)(()=>h.data?.permissions.filter(e=>e.state===`granted`).length??0,[h.data?.permissions]),_=h.data?.permissions.length??2,O=h.data?.supported===!0&&g===_,A=H(h.data);function I(n){n!==e.computerUse.enabled&&(t({computerUse:{enabled:n}}),c()?.server.refreshProviders().catch(e=>{console.warn(`[computer-use] failed to refresh providers after settings change`,e)}))}function R(){r.current?.(),r.current=null}function V(e){R(),r.current=N({kind:e,refresh:async()=>n.fetchQuery({queryKey:F,queryFn:p,staleTime:0}),onGranted:()=>{R()},onError:e=>{console.warn(`[computer-use] failed to refresh permission state`,e)}})}(0,k.useEffect)(()=>{o&&M(h.data,o)&&(R(),s(null))},[o,h.data]),(0,k.useEffect)(()=>()=>R(),[]);async function W(e){s(e);try{let t=window.desktopBridge?.requestComputerUsePermission,n=window.desktopBridge?.showComputerUsePermissionGuide,r=c()?.computer,i=await j(e,{...t?{requestPermission:t}:{},...!t&&r?{requestPermission:r.requestPermission}:{},...n?{showPermissionGuide:n}:{},...!n&&r?{showPermissionGuide:r.showPermissionGuide}:{}});if(!i?.ok)throw Error(i?.message??`The macOS permission guide could not be opened.`);V(e)}catch(e){C.add({type:`error`,title:`Could not open permission guide`,description:e instanceof Error?e.message:String(e)})}finally{s(null)}}return(0,P.jsxs)(w,{children:[(0,P.jsxs)(D,{title:`Computer Use`,icon:(0,P.jsx)(d,{className:`size-3.5`}),children:[(0,P.jsx)(T,{title:`Enable Computer Use`,description:`Let agents see and control this Mac: desktop screenshots, app context, pointer, keyboard, and scroll. Screenshots and action results are sent to the selected agent provider as tool results.`,control:(0,P.jsx)(E,{checked:e.computerUse.enabled,onCheckedChange:e=>I(!!e),"aria-label":`Enable Computer Use`}),children:(0,P.jsx)(B,{})}),(0,P.jsxs)(S,{variant:`info`,className:`m-4`,children:[(0,P.jsx)(f,{}),(0,P.jsx)(x,{children:`Local desktop boundary`}),(0,P.jsx)(b,{children:`The helper runs on this Mac and uses macOS Accessibility and Screen Recording permissions. While enabled, agents have full access to the visible desktop.`})]})]}),(0,P.jsxs)(D,{title:`macOS Permissions`,icon:(0,P.jsx)(f,{className:`size-3.5`}),children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-border px-4 py-3 sm:px-5`,children:[(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:O?`Desktop control is ready`:`Permission checklist`}),O?(0,P.jsx)(u,{className:`size-4 text-success`}):null]}),(0,P.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:h.data?.message??`${g}/${_} required permissions granted.`}),A?(0,P.jsxs)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:[`macOS permissions apply to `,A,`.`]}):null]}),(0,P.jsx)(l,{size:`icon-sm`,variant:`ghost`,disabled:h.isFetching,onClick:()=>void n.invalidateQueries({queryKey:F}),"aria-label":`Refresh Computer Use permissions`,children:(0,P.jsx)(m,{className:`size-3.5 ${h.isFetching?`animate-spin`:``}`})})]}),h.data?.permissions.map(e=>(0,P.jsx)(z,{permission:e,permissionFlowPending:o===e.kind,onPermissionFlow:W},e.kind))]}),e.computerUse.enabled?(0,P.jsx)(U,{}):null]})}var q=K;export{q as component};
2
- //# sourceMappingURL=settings.computer-use-tZN9IYDg.js.map
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,d as i,m as a}from"./vendor-tanstack-DxB_J8A7.js";import{c as o}from"./vendor--lexical-react-Dg6NVZQt.js";import{f as s,h as c,s as l}from"./clientSettings-BoLlsjmq.js";import"./vendor-effect-Chd9hYxF.js";import"./utils-BnXGGW32.js";import"./store-BzqS7zm8.js";import"./terminalStateStore-BhU1c2Sw.js";import"./uiStateStore-CGeY60Rr.js";import{Cn as u,Ir as d,Mr as f,Sn as p,Xn as m,jr as h,pr as g,wr as _}from"./vendor-ui-CJZCHXkp.js";import{n as v,r as y}from"./useSettings-CfiGcPkS.js";import"./useHandleNewThread-CxLIGmcC.js";import"./gitReactQuery-CQYez3In.js";import"./input-C7biIuoM.js";import{M as b,N as x,j as S,nt as C}from"./index-ndFBrjHh.js";import"./ProviderModelPicker-DBL7REnB.js";import"./empty-C0odYOnP.js";import"./collapsible-BFxx3cmC.js";import{a as w,o as T,p as E,s as D}from"./SettingsPanels-DToV4poM.js";var O=n(),k=e(t(),1),A=[750,2e3,5e3,1e4,2e4,3e4];async function j(e,t){let n=t.requestPermission?await t.requestPermission({kind:e}):void 0;return n?.ok?n:(t.showPermissionGuide?await t.showPermissionGuide({kind:e}):void 0)??n??{ok:!1,kind:e,message:`Computer Use permission guides are unavailable in this browser.`}}function M(e,t){return e?.permissions.some(e=>e.kind===t&&e.state===`granted`)??!1}function N(e){let t=e.setTimeout??globalThis.setTimeout.bind(globalThis),n=e.clearTimeout??globalThis.clearTimeout.bind(globalThis),r=e.delaysMs??A,i=[],a=!1,o=()=>{if(!a){a=!0;for(let e of i.splice(0))n(e)}};for(let n of r)i.push(t(()=>{a||e.refresh().then(t=>{M(t,e.kind)&&(e.onGranted?.(t),o())}).catch(t=>{e.onError?.(t)})},n));return o}var P=o(),F=[`computerUse`,`permissions`],I=`relative overflow-hidden rounded-2xl border bg-card text-card-foreground shadow-xs/5 not-dark:bg-clip-padding before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-2xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] dark:before:shadow-[0_-1px_--theme(--color-white/6%)]`;function L(e){return{platform:`web`,supported:!1,helperAvailable:!1,helperPath:null,checkedAt:new Date().toISOString(),message:e,permissions:[{kind:`accessibility`,label:`Accessibility`,state:`unsupported`,detail:e},{kind:`screen-recording`,label:`Screen Recording`,state:`unsupported`,detail:e}]}}function R(e){switch(e.state){case`granted`:return{label:`Ready`,dot:`bg-success`,icon:(0,P.jsx)(u,{className:`size-4 text-success`})};case`unsupported`:return{label:`Unavailable`,dot:`bg-muted-foreground`,icon:(0,P.jsx)(p,{className:`size-4 text-muted-foreground`})};default:return{label:`Needs permission`,dot:`bg-warning`,icon:(0,P.jsx)(p,{className:`size-4 text-warning`})}}}function z(e){let t=(0,O.c)(28),{permission:n,onPermissionFlow:r,permissionFlowPending:i}=e,a;t[0]===n?a=t[1]:(a=R(n),t[0]=n,t[1]=a);let o=a,s=n.state!==`granted`&&n.state!==`unsupported`,c;t[2]===o.icon?c=t[3]:(c=(0,P.jsx)(`div`,{className:`mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-full bg-muted/60`,children:o.icon}),t[2]=o.icon,t[3]=c);let u;t[4]===n.label?u=t[5]:(u=(0,P.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:n.label}),t[4]=n.label,t[5]=u);let d=`size-1.5 rounded-full ${o.dot}`,f;t[6]===d?f=t[7]:(f=(0,P.jsx)(`span`,{className:d}),t[6]=d,t[7]=f);let p;t[8]!==f||t[9]!==o.label?(p=(0,P.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-full border border-border/70 px-2 py-0.5 text-[11px] text-muted-foreground`,children:[f,o.label]}),t[8]=f,t[9]=o.label,t[10]=p):p=t[10];let m;t[11]!==u||t[12]!==p?(m=(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[u,p]}),t[11]=u,t[12]=p,t[13]=m):m=t[13];let h;t[14]===n.detail?h=t[15]:(h=(0,P.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-muted-foreground`,children:n.detail}),t[14]=n.detail,t[15]=h);let g;t[16]!==m||t[17]!==h?(g=(0,P.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[m,h]}),t[16]=m,t[17]=h,t[18]=g):g=t[18];let _;t[19]!==s||t[20]!==r||t[21]!==n.kind||t[22]!==i?(_=s?(0,P.jsx)(l,{size:`sm`,variant:`outline`,disabled:i,onClick:()=>r(n.kind),children:`Guide me`}):null,t[19]=s,t[20]=r,t[21]=n.kind,t[22]=i,t[23]=_):_=t[23];let v;return t[24]!==_||t[25]!==c||t[26]!==g?(v=(0,P.jsxs)(`div`,{className:`flex items-start gap-3 border-t border-border px-4 py-4 first:border-t-0 sm:px-5`,children:[c,g,_]}),t[24]=_,t[25]=c,t[26]=g,t[27]=v):v=t[27],v}function B(){let e=(0,O.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[{icon:h,label:`Screenshots`},{icon:f,label:`Pointer`},{icon:g,label:`Keyboard`}],e[0]=t):t=e[0];let n=t,r;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,P.jsx)(`div`,{className:`grid gap-2 pt-3 sm:grid-cols-3`,children:n.map(V)}),e[1]=r):r=e[1],r}function V(e){let t=e.icon;return(0,P.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,P.jsx)(t,{className:`size-4 text-muted-foreground`}),(0,P.jsx)(`span`,{children:e.label})]},e.label)}function H(e){let t=e?.permissionSubject,n=t?.displayName?.trim(),r=t?.path?.trim();return n&&r?`${n} at ${r}`:n||r||null}function U(){let e=(0,O.c)(15),[t,n]=(0,k.useState)(null),i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={mutationFn:G,onSuccess:e=>n(e.imageDataUrl),onError:W},e[0]=i):i=e[0];let a=r(i),o;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:`Live desktop preview`}),(0,P.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:`Captures the full visible desktop through the same local macOS helper the agent uses.`})]}),e[1]=o):o=e[1];let s;e[2]===a?s=e[3]:(s=()=>a.mutate(),e[2]=a,e[3]=s);let c;e[4]===a.isPending?c=e[5]:(c=a.isPending?(0,P.jsx)(m,{className:`size-3.5 animate-spin`}):(0,P.jsx)(_,{className:`size-3.5`}),e[4]=a.isPending,e[5]=c);let u;e[6]!==a.isPending||e[7]!==s||e[8]!==c?(u=(0,P.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-border px-4 py-3 sm:px-5`,children:[o,(0,P.jsxs)(l,{size:`sm`,variant:`outline`,disabled:a.isPending,onClick:s,children:[c,`Capture`]})]}),e[6]=a.isPending,e[7]=s,e[8]=c,e[9]=u):u=e[9];let d;e[10]===t?d=e[11]:(d=(0,P.jsx)(`div`,{className:`bg-muted/30 p-4 sm:p-5`,children:t?(0,P.jsx)(`img`,{src:t,alt:`macOS desktop screenshot`,className:`max-h-[420px] w-full rounded-xl border border-border object-contain shadow-sm`}):(0,P.jsx)(`div`,{className:`flex min-h-48 items-center justify-center rounded-xl border border-dashed border-border bg-background/70 text-sm text-muted-foreground`,children:`No screenshot captured yet.`})}),e[10]=t,e[11]=d);let f;return e[12]!==u||e[13]!==d?(f=(0,P.jsxs)(`div`,{className:I,children:[u,d]}),e[12]=u,e[13]=d,e[14]=f):f=e[14],f}function W(e){C.add({type:`error`,title:`Could not capture desktop`,description:e instanceof Error?e.message:String(e)})}async function G(){let e=s().computer;if(!e)throw Error(`Computer Use is unavailable.`);return e.screenshot({})}function K(){let e=v(),{updateSettings:t}=y(),n=a(),r=(0,k.useRef)(null),[o,s]=(0,k.useState)(null),f=(0,k.useCallback)(async()=>{if(window.desktopBridge?.getComputerUsePermissions)return window.desktopBridge.getComputerUsePermissions();let e=c()?.computer;return e?e.getPermissions():L(`Computer Use is available in the ShioriCode desktop app or a trusted local native API session.`)},[]),p=i({queryKey:F,queryFn:f,enabled:!0,staleTime:5e3,refetchOnWindowFocus:!0}),g=(0,k.useMemo)(()=>p.data?.permissions.filter(e=>e.state===`granted`).length??0,[p.data?.permissions]),_=p.data?.permissions.length??2,O=p.data?.supported===!0&&g===_,A=H(p.data);function I(n){n!==e.computerUse.enabled&&(t({computerUse:{enabled:n}}),c()?.server.refreshProviders().catch(e=>{console.warn(`[computer-use] failed to refresh providers after settings change`,e)}))}function R(){r.current?.(),r.current=null}function V(e){R(),r.current=N({kind:e,refresh:async()=>n.fetchQuery({queryKey:F,queryFn:f,staleTime:0}),onGranted:()=>{R()},onError:e=>{console.warn(`[computer-use] failed to refresh permission state`,e)}})}(0,k.useEffect)(()=>{o&&M(p.data,o)&&(R(),s(null))},[o,p.data]),(0,k.useEffect)(()=>()=>R(),[]);async function W(e){s(e);try{let t=window.desktopBridge?.requestComputerUsePermission,n=window.desktopBridge?.showComputerUsePermissionGuide,r=c()?.computer,i=await j(e,{...t?{requestPermission:t}:{},...!t&&r?{requestPermission:r.requestPermission}:{},...n?{showPermissionGuide:n}:{},...!n&&r?{showPermissionGuide:r.showPermissionGuide}:{}});if(!i?.ok)throw Error(i?.message??`The macOS permission guide could not be opened.`);V(e)}catch(e){C.add({type:`error`,title:`Could not open permission guide`,description:e instanceof Error?e.message:String(e)})}finally{s(null)}}return(0,P.jsxs)(w,{children:[(0,P.jsxs)(D,{title:`Computer Use`,icon:(0,P.jsx)(h,{className:`size-3.5`}),children:[(0,P.jsx)(T,{title:`Enable Computer Use`,description:`Let agents see and control this Mac: desktop screenshots, app context, pointer, keyboard, and scroll. Screenshots and action results are sent to the selected agent provider as tool results.`,control:(0,P.jsx)(E,{checked:e.computerUse.enabled,onCheckedChange:e=>I(!!e),"aria-label":`Enable Computer Use`}),children:(0,P.jsx)(B,{})}),(0,P.jsxs)(S,{variant:`info`,className:`m-4`,children:[(0,P.jsx)(u,{}),(0,P.jsx)(x,{children:`Local desktop boundary`}),(0,P.jsx)(b,{children:`The helper runs on this Mac and uses macOS Accessibility and Screen Recording permissions. While enabled, agents have full access to the visible desktop.`})]})]}),(0,P.jsxs)(D,{title:`macOS Permissions`,icon:(0,P.jsx)(u,{className:`size-3.5`}),children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-border px-4 py-3 sm:px-5`,children:[(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:O?`Desktop control is ready`:`Permission checklist`}),O?(0,P.jsx)(d,{className:`size-4 text-success`}):null]}),(0,P.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:p.data?.message??`${g}/${_} required permissions granted.`}),A?(0,P.jsxs)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:[`macOS permissions apply to `,A,`.`]}):null]}),(0,P.jsx)(l,{size:`icon-sm`,variant:`ghost`,disabled:p.isFetching,onClick:()=>void n.invalidateQueries({queryKey:F}),"aria-label":`Refresh Computer Use permissions`,children:(0,P.jsx)(m,{className:`size-3.5 ${p.isFetching?`animate-spin`:``}`})})]}),p.data?.permissions.map(e=>(0,P.jsx)(z,{permission:e,permissionFlowPending:o===e.kind,onPermissionFlow:W},e.kind))]}),e.computerUse.enabled?(0,P.jsx)(U,{}):null]})}var q=K;export{q as component};
2
+ //# sourceMappingURL=settings.computer-use-BK97T3f-.js.map
@@ -1,4 +1,4 @@
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--lexical-react-Dg6NVZQt.js";import"./vendor-effect-DldSDsna.js";import"./utils-X2TItr-k.js";import{rr as i}from"./vendor-ui-D-080HIn.js";import{n as a,t as o}from"./collapsible-DfWqkHJg.js";var s=n(),c=e(t(),1),l=r(),u=`Permission is hereby granted, free of charge, to any person obtaining a copy
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--lexical-react-Dg6NVZQt.js";import"./vendor-effect-Chd9hYxF.js";import"./utils-BnXGGW32.js";import{or as i}from"./vendor-ui-CJZCHXkp.js";import{n as a,t as o}from"./collapsible-BFxx3cmC.js";var s=n(),c=e(t(),1),l=r(),u=`Permission is hereby granted, free of charge, to any person obtaining a copy
2
2
  of this software and associated documentation files (the "Software"), to deal
3
3
  in the Software without restriction, including without limitation the rights
4
4
  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@@ -27,4 +27,4 @@ ${u}`},{name:`Codex`,copyright:`2025 OpenAI`,license:`Apache-2.0`,url:`https://g
27
27
  Copyright (c) 2025 Anthropic, PBC
28
28
 
29
29
  ${u}`}],m=`underline decoration-muted-foreground/30 underline-offset-2 transition-colors hover:text-foreground`,h=`relative overflow-hidden rounded-2xl border bg-card text-card-foreground shadow-xs/5 not-dark:bg-clip-padding before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-2xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] dark:before:shadow-[0_-1px_--theme(--color-white/6%)]`;function g(){let e=(0,s.c)(7),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=new Set,e[0]=t):t=e[0];let[n,r]=(0,c.useState)(t),u;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(u=function(e){r(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},e[1]=u):u=e[1];let d=u,g;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,l.jsx)(`h2`,{className:`text-[11px] font-medium text-muted-foreground`,children:`Credits / Licenses`}),e[2]=g):g=e[2];let _;e[3]===n?_=e[4]:(_=p.map((e,t)=>{let r=e.fullText??f[e.license],s=n.has(e.name);return(0,l.jsxs)(`div`,{className:t>0?`border-t border-border`:``,children:[(0,l.jsxs)(`button`,{type:`button`,className:`flex w-full cursor-pointer items-center gap-3 px-4 py-2.5 text-left sm:px-5`,onClick:()=>d(e.name),children:[(0,l.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,l.jsx)(`span`,{className:`text-sm text-foreground`,children:e.name}),e.copyright?(0,l.jsxs)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:[`© `,e.copyright]}):null]}),(0,l.jsx)(`span`,{className:`shrink-0 text-[11px] text-muted-foreground`,children:e.license}),(0,l.jsx)(i,{className:`size-3.5 shrink-0 text-muted-foreground transition-transform duration-200 ${s?`rotate-180`:``}`})]}),(0,l.jsx)(o,{open:s,children:(0,l.jsx)(a,{children:(0,l.jsxs)(`div`,{className:`border-t border-border/50 px-4 py-3 sm:px-5`,children:[(0,l.jsx)(`div`,{className:`flex items-center gap-2 pb-2`,children:(0,l.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`text-xs text-muted-foreground ${m}`,children:`View on GitHub`})}),r?(0,l.jsx)(`pre`,{className:`whitespace-pre-wrap text-[11px] leading-relaxed text-muted-foreground`,children:r}):(0,l.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`See repository for full license text.`})]})})})]},e.name)}),e[3]=n,e[4]=_);let v;return e[5]===_?v=e[6]:(v=(0,l.jsx)(`div`,{className:`flex-1 overflow-y-auto p-6`,children:(0,l.jsx)(`div`,{className:`mx-auto flex w-full max-w-4xl flex-col gap-6`,children:(0,l.jsxs)(`section`,{className:`space-y-3`,children:[g,(0,l.jsx)(`div`,{className:h,children:_})]})})}),e[5]=_,e[6]=v),v}var _=g;export{_ as component};
30
- //# sourceMappingURL=settings.credits-BpgwqbI7.js.map
30
+ //# sourceMappingURL=settings.credits-C2nerPpd.js.map
@@ -0,0 +1,2 @@
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"./clientSettings-BoLlsjmq.js";import"./vendor-effect-Chd9hYxF.js";import"./utils-BnXGGW32.js";import"./store-BzqS7zm8.js";import"./terminalStateStore-BhU1c2Sw.js";import"./uiStateStore-CGeY60Rr.js";import"./vendor-ui-CJZCHXkp.js";import"./useSettings-CfiGcPkS.js";import"./useHandleNewThread-CxLIGmcC.js";import"./gitReactQuery-CQYez3In.js";import"./input-C7biIuoM.js";import"./ProviderModelPicker-DBL7REnB.js";import"./empty-C0odYOnP.js";import"./collapsible-BFxx3cmC.js";import{i as e}from"./SettingsPanels-DToV4poM.js";var t=e;export{t as component};
2
+ //# sourceMappingURL=settings.general-Djd4g0t8.js.map
@@ -0,0 +1,2 @@
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{f as a,s as o}from"./clientSettings-BoLlsjmq.js";import"./vendor-effect-Chd9hYxF.js";import{rt as s,t as c}from"./utils-BnXGGW32.js";import"./store-BzqS7zm8.js";import"./terminalStateStore-BhU1c2Sw.js";import"./uiStateStore-CGeY60Rr.js";import{Fn as l,Gn as u,Tn as d,br as f,mr as p,qr as ee}from"./vendor-ui-CJZCHXkp.js";import"./useSettings-CfiGcPkS.js";import"./useHandleNewThread-CxLIGmcC.js";import"./gitReactQuery-CQYez3In.js";import{t as m}from"./input-C7biIuoM.js";import"./scroll-area-b0VYEw63.js";import{M as h,N as g,j as _,nt as v,u as y}from"./index-ndFBrjHh.js";import{a as b,i as x,o as S,r as C,s as w}from"./ProviderModelPicker-DBL7REnB.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-xuDGeb4n.js";import{t as ie}from"./badge-DQNpCiTY.js";import{a as A,i as j,o as ae,r as M,t as oe}from"./empty-C0odYOnP.js";import"./collapsible-BFxx3cmC.js";import{a as N,f as se,o as P,p as F,s as I}from"./SettingsPanels-DToV4poM.js";import{a as L,i as R,o as z,r as B,s as V,t as H}from"./skillsMcpShared-DzSsN5fy.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:s,grouped:u}=e,d;t[0]!==n.args||t[1]!==n.command||t[2]!==n.transport||t[3]!==n.url?(d=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]=d):d=t[4];let f=d,p=n.auth.status===`unauthenticated`,m=n.auth.message??`Authentication required`,h=n.auth.status===`authenticated`?`Authenticated`:null,g=p&&typeof a==`function`,_=u&&`pl-10 sm:pl-11`,v;t[5]===_?v=t[6]:(v=c(`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)(ee,{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]!==s||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:s,onClick:a,title:m,children:s?`Authenticating…`:`Authenticate`}):h?(0,G.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:h}):null,t[25]=h,t[26]=m,t[27]=s,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:s.claudeAgent},{value:`glm`,label:s.glm},{value:`codex`,label:s.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`),[d,f]=(0,W.useState)(``),[p,ee]=(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`),f(``),ee(``),g(``),y([])},t[1]=x):x=t[1];let ie=x,A=a.trim().length>0&&(c===`stdio`?p.trim().length>0:d.trim().length>0),j;t[2]!==h||t[3]!==p||t[4]!==A||t[5]!==a||t[6]!==n||t[7]!==v||t[8]!==c||t[9]!==d?(j=()=>{A&&(n({name:a.trim(),transport:c,enabled:!0,providers:v,...c===`stdio`?{command:p.trim(),...h.trim()?{args:h.trim().split(/\s+/)}:{}}:{url:d.trim()}}),ie(),i(!1))},t[2]=h,t[3]=p,t[4]=A,t[5]=a,t[6]=n,t[7]=v,t[8]=c,t[9]=d,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)(u,{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]!==p||t[28]!==c||t[29]!==d?(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:p,onChange:e=>ee(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:d,onChange:e=>f(e.target.value),className:`font-mono`})]}),t[26]=h,t[27]=p,t[28]=c,t[29]=d,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)(d,{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)(d,{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:l}){let[u,d]=(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)(()=>u?t.filter(e=>z(u,e.name,e.source,e.transport,e.url,e.command)):t,[t,u]),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:()=>l(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)(ee,{}),(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:u,onChange:d,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 “`,u,`”`]}):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`}})),l=s.data?.servers??c,u=s.data?.warnings??[],d=(0,W.useCallback)(n=>{t([...e,n])},[t,e]),f=(0,W.useCallback)(n=>{t(e.map((e,t)=>t===n?{...e,enabled:!e.enabled}:e))},[t,e]),p=(0,W.useCallback)(n=>{t(e.filter((e,t)=>t!==n))},[t,e]),ee=(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:l,warnings:u,isLoading:s.isLoading,authenticatingServerKey:i,onAdd:d,onAuthenticate:m,onToggle:f,onDelete:p,onDeleteExternal:ee}),(0,G.jsx)(Q,{}),(0,G.jsx)(me,{})]})}var ye=ve;export{ye as component};
2
+ //# sourceMappingURL=settings.mcp-b1gcVG3u.js.map
@@ -1,2 +1,2 @@
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{s as i}from"./clientSettings-333fq8u7.js";import{d as a,t as o}from"./utils-X2TItr-k.js";import"./store-8a4nbwgb.js";import"./terminalStateStore-COv6Fwmt.js";import"./uiStateStore-DsIsCBO9.js";import{Ar as s,Nn as c,Nr as l,On as u,Vr as d,Zn as f,qn as p}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{At as m,M as h,N as g,j as _}from"./index-DO0-ySqI.js";import"./ProviderModelPicker-DvZxygLs.js";import"./empty-Be-8qJMT.js";import"./collapsible-DfWqkHJg.js";import{a as v,o as y,s as b}from"./SettingsPanels-CcxbSb2Y.js";import{t as x}from"./vendor-qrcode-generator-CJtPPqPY.js";var S=n(),C=e(t(),1),w=r();function T(e,t={}){let n=new URL(a({protocol:`http`,pathname:e}));for(let[e,r]of Object.entries(t))n.searchParams.set(e,r);return n.toString()}async function E(e,t,n){let r=await fetch(T(e,n),{...t,headers:{"Content-Type":`application/json`,...t?.headers}}),i=await r.json();if(!r.ok||!i.success)throw Error(i.success?`Mobile pairing request failed.`:i.error);return i.data}var D=[`Install ShioriCode from the App Store on your iPhone.`,`Open the app and tap “Pair a desktop”.`,`Point the camera at the code shown here.`];function O(e){let t=(0,S.c)(5),[n,r]=(0,C.useState)(k),i,a;if(t[0]===e?(i=t[1],a=t[2]):(i=()=>{if(!e)return;let t=window.setInterval(()=>r(Date.now()),1e3);return()=>window.clearInterval(t)},a=[e],t[0]=e,t[1]=i,t[2]=a),(0,C.useEffect)(i,a),!e)return null;let o=new Date(e).getTime()-n,s;return t[3]===o?s=t[4]:(s=Number.isNaN(o)?null:Math.max(0,o),t[3]=o,t[4]=s),s}function k(){return Date.now()}function A(e){let t=Math.ceil(e/1e3);return`${Math.floor(t/60)}:${(t%60).toString().padStart(2,`0`)}`}function j(){let e=m(),[t,n]=(0,C.useState)(null),[r,a]=(0,C.useState)(null),[S,T]=(0,C.useState)(null),[k,j]=(0,C.useState)(!1),[M,N]=(0,C.useState)(null),[P,F]=(0,C.useState)(!1),I=O(t?.expiresAt??null),L=I!==null&&I<=0,R=typeof navigator<`u`&&!!navigator.clipboard,z=(0,C.useMemo)(()=>e?M?{dot:`bg-destructive`,label:`Error`}:r?.paired?{dot:`bg-success`,label:`Paired`}:L?{dot:`bg-warning`,label:`Expired`}:t?{dot:`bg-info`,label:`Waiting`,pulse:!0}:{dot:`bg-muted-foreground/40`,label:`Loading`}:{dot:`bg-muted-foreground/40`,label:`Disabled`},[e,M,r?.paired,L,t]),B=(0,C.useCallback)(async()=>{if(j(!0),N(null),F(!1),!e){n(null),a(null),T(null),j(!1);return}try{let e=await E(`/api/mobile/pairing-sessions`,{method:`POST`,body:`{}`});n(e),a(null);let t=x(0,`M`);t.addData(e.qrPayload,`Byte`),t.make(),T(t.createDataURL(8,1))}catch(e){N(e instanceof Error?e.message:`Failed to create pairing QR code.`),n(null),a(null),T(null)}finally{j(!1)}},[e]);(0,C.useEffect)(()=>{e&&B()},[B,e]),(0,C.useEffect)(()=>{if(!e||!t||r?.paired||L)return;let n=window.setInterval(()=>{E(`/api/mobile/pairing-sessions/status`,{method:`GET`},{pairingId:t.pairingId}).then(a).catch(()=>void 0)},1500);return()=>window.clearInterval(n)},[e,t,r?.paired,L]);let V=(0,C.useCallback)(async()=>{!t?.qrPayload||typeof navigator>`u`||!navigator.clipboard||(await navigator.clipboard.writeText(t.qrPayload),F(!0),window.setTimeout(()=>F(!1),1200))},[t?.qrPayload]);return(0,w.jsx)(v,{children:(0,w.jsx)(b,{title:`Mobile App`,icon:(0,w.jsx)(d,{className:`size-3.5`}),headerAction:(0,w.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e?(0,w.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-[11px] font-medium text-muted-foreground`,children:[(0,w.jsx)(`span`,{className:o(`size-1.5 rounded-full`,z.dot,z.pulse&&`animate-pulse`)}),z.label]}):null,(0,w.jsxs)(i,{size:`xs`,variant:`outline`,disabled:k||!e,onClick:()=>void B(),children:[k?(0,w.jsx)(u,{className:`size-3.5 animate-spin`}):(0,w.jsx)(p,{className:`size-3.5`}),`New code`]})]}),children:e?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(y,{title:`Pair your iPhone`,description:`Scan this code from the ShioriCode iOS app — over the same network, or from anywhere when both devices are on Tailscale.`,children:(0,w.jsxs)(`div`,{className:`mt-1 grid gap-4 md:grid-cols-[auto_1fr] md:items-start`,children:[(0,w.jsxs)(`div`,{className:`flex flex-col items-center gap-3`,children:[(0,w.jsx)(`div`,{className:`flex size-56 items-center justify-center rounded-xl border border-border bg-white p-3 shadow-inner sm:size-60`,children:S?(0,w.jsx)(`img`,{src:S,alt:`ShioriCode mobile pairing QR code`,className:`size-full rounded-md`}):(0,w.jsx)(u,{className:`size-6 animate-spin text-muted-foreground`})}),I===null?null:(0,w.jsxs)(`div`,{className:o(`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-[11px] font-medium tabular-nums`,L||I<3e4?`border-warning/30 text-warning`:`border-border text-muted-foreground`),children:[(0,w.jsx)(c,{className:`size-3`}),L?`Expired`:`Expires in ${A(I)}`]})]}),(0,w.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3`,children:[r?.paired?(0,w.jsxs)(_,{variant:`success`,children:[(0,w.jsx)(l,{}),(0,w.jsx)(g,{children:`Paired`}),(0,w.jsxs)(h,{children:[r.pairedDeviceName??`Your iPhone`,` is connected to this desktop.`]})]}):L?(0,w.jsxs)(_,{variant:`warning`,children:[(0,w.jsx)(c,{}),(0,w.jsx)(g,{children:`Code expired`}),(0,w.jsx)(h,{children:`This code is no longer valid. Generate a new one to finish pairing.`})]}):(0,w.jsxs)(_,{variant:`info`,children:[(0,w.jsx)(d,{}),(0,w.jsx)(g,{children:`Waiting for scan`}),(0,w.jsx)(h,{children:`The code is single-use and short-lived.`})]}),M?(0,w.jsxs)(_,{variant:`error`,children:[(0,w.jsx)(g,{children:`Pairing unavailable`}),(0,w.jsx)(h,{children:M})]}):null,r?.paired?(0,w.jsx)(`p`,{className:`text-xs leading-5 text-muted-foreground`,children:`You can now start threads, watch runs, and approve actions from your iPhone.`}):(0,w.jsx)(`ol`,{className:`space-y-2`,children:D.map((e,t)=>(0,w.jsxs)(`li`,{className:`flex items-start gap-2.5`,children:[(0,w.jsx)(`span`,{className:`mt-px flex size-5 shrink-0 items-center justify-center rounded-full border border-border bg-muted/40 text-[11px] font-medium text-muted-foreground`,children:t+1}),(0,w.jsx)(`span`,{className:`text-xs leading-5 text-muted-foreground`,children:e})]},e))}),(0,w.jsx)(`div`,{children:(0,w.jsxs)(i,{size:`sm`,variant:`outline`,disabled:!t?.qrPayload||!R,onClick:()=>void V(),children:[(0,w.jsx)(s,{className:`size-3.5`}),P?`Copied`:`Copy pairing payload`]})})]})]})}),t?.candidates.length?(0,w.jsx)(y,{title:`Network addresses`,description:`The addresses bundled into this code. Your iPhone connects to one of them.`,children:(0,w.jsx)(`ul`,{className:`mt-1 divide-y divide-border overflow-hidden rounded-lg border border-border`,children:t.candidates.map(e=>(0,w.jsxs)(`li`,{className:`flex min-w-0 items-center justify-between gap-3 bg-muted/20 px-3 py-2`,children:[(0,w.jsx)(`code`,{className:`min-w-0 truncate text-xs text-foreground`,children:e.apiBaseUrl}),(0,w.jsx)(`span`,{className:`shrink-0 rounded-full border border-border bg-card px-2 py-0.5 text-[11px] text-muted-foreground`,children:e.label})]},e.apiBaseUrl))})}):null]}):(0,w.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-3 px-6 py-12 text-center`,children:[(0,w.jsx)(`div`,{className:`flex size-10 items-center justify-center rounded-lg border bg-muted/40 text-muted-foreground`,children:(0,w.jsx)(f,{className:`size-5`})}),(0,w.jsxs)(`div`,{className:`space-y-1`,children:[(0,w.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:`Mobile pairing is disabled`}),(0,w.jsx)(`p`,{className:`mx-auto max-w-sm text-xs leading-5 text-muted-foreground`,children:`Mobile pairing is currently disabled for this ShioriCode deployment. Enable it from your server configuration to pair your iPhone.`})]})]})})})}var M=j;export{M as component};
2
- //# sourceMappingURL=settings.mobile-PxkOX11C.js.map
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{s as i}from"./clientSettings-BoLlsjmq.js";import"./vendor-effect-Chd9hYxF.js";import{d as a,t as o}from"./utils-BnXGGW32.js";import"./store-BzqS7zm8.js";import"./terminalStateStore-BhU1c2Sw.js";import"./uiStateStore-CGeY60Rr.js";import{In as s,Ir as c,Nr as l,Wr as u,Xn as d,er as f,jn as p}from"./vendor-ui-CJZCHXkp.js";import"./useSettings-CfiGcPkS.js";import"./useHandleNewThread-CxLIGmcC.js";import"./gitReactQuery-CQYez3In.js";import"./input-C7biIuoM.js";import{At as m,M as h,N as g,j as _}from"./index-ndFBrjHh.js";import"./ProviderModelPicker-DBL7REnB.js";import"./empty-C0odYOnP.js";import"./collapsible-BFxx3cmC.js";import{a as v,o as y,s as b}from"./SettingsPanels-DToV4poM.js";import{t as x}from"./vendor-qrcode-generator-CJtPPqPY.js";var S=n(),C=e(t(),1),w=r();function T(e,t={}){let n=new URL(a({protocol:`http`,pathname:e}));for(let[e,r]of Object.entries(t))n.searchParams.set(e,r);return n.toString()}async function E(e,t,n){let r=await fetch(T(e,n),{...t,headers:{"Content-Type":`application/json`,...t?.headers}}),i=await r.json();if(!r.ok||!i.success)throw Error(i.success?`Mobile pairing request failed.`:i.error);return i.data}var D=[`Install ShioriCode from the App Store on your iPhone.`,`Open the app and tap “Pair a desktop”.`,`Point the camera at the code shown here.`];function O(e){let t=(0,S.c)(5),[n,r]=(0,C.useState)(k),i,a;if(t[0]===e?(i=t[1],a=t[2]):(i=()=>{if(!e)return;let t=window.setInterval(()=>r(Date.now()),1e3);return()=>window.clearInterval(t)},a=[e],t[0]=e,t[1]=i,t[2]=a),(0,C.useEffect)(i,a),!e)return null;let o=new Date(e).getTime()-n,s;return t[3]===o?s=t[4]:(s=Number.isNaN(o)?null:Math.max(0,o),t[3]=o,t[4]=s),s}function k(){return Date.now()}function A(e){let t=Math.ceil(e/1e3);return`${Math.floor(t/60)}:${(t%60).toString().padStart(2,`0`)}`}function j(){let e=m(),[t,n]=(0,C.useState)(null),[r,a]=(0,C.useState)(null),[S,T]=(0,C.useState)(null),[k,j]=(0,C.useState)(!1),[M,N]=(0,C.useState)(null),[P,F]=(0,C.useState)(!1),I=O(t?.expiresAt??null),L=I!==null&&I<=0,R=typeof navigator<`u`&&!!navigator.clipboard,z=(0,C.useMemo)(()=>e?M?{dot:`bg-destructive`,label:`Error`}:r?.paired?{dot:`bg-success`,label:`Paired`}:L?{dot:`bg-warning`,label:`Expired`}:t?{dot:`bg-info`,label:`Waiting`,pulse:!0}:{dot:`bg-muted-foreground/40`,label:`Loading`}:{dot:`bg-muted-foreground/40`,label:`Disabled`},[e,M,r?.paired,L,t]),B=(0,C.useCallback)(async()=>{if(j(!0),N(null),F(!1),!e){n(null),a(null),T(null),j(!1);return}try{let e=await E(`/api/mobile/pairing-sessions`,{method:`POST`,body:`{}`});n(e),a(null);let t=x(0,`M`);t.addData(e.qrPayload,`Byte`),t.make(),T(t.createDataURL(8,1))}catch(e){N(e instanceof Error?e.message:`Failed to create pairing QR code.`),n(null),a(null),T(null)}finally{j(!1)}},[e]);(0,C.useEffect)(()=>{e&&B()},[B,e]),(0,C.useEffect)(()=>{if(!e||!t||r?.paired||L)return;let n=window.setInterval(()=>{E(`/api/mobile/pairing-sessions/status`,{method:`GET`},{pairingId:t.pairingId}).then(a).catch(()=>void 0)},1500);return()=>window.clearInterval(n)},[e,t,r?.paired,L]);let V=(0,C.useCallback)(async()=>{!t?.qrPayload||typeof navigator>`u`||!navigator.clipboard||(await navigator.clipboard.writeText(t.qrPayload),F(!0),window.setTimeout(()=>F(!1),1200))},[t?.qrPayload]);return(0,w.jsx)(v,{children:(0,w.jsx)(b,{title:`Mobile App`,icon:(0,w.jsx)(u,{className:`size-3.5`}),headerAction:(0,w.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e?(0,w.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-[11px] font-medium text-muted-foreground`,children:[(0,w.jsx)(`span`,{className:o(`size-1.5 rounded-full`,z.dot,z.pulse&&`animate-pulse`)}),z.label]}):null,(0,w.jsxs)(i,{size:`xs`,variant:`outline`,disabled:k||!e,onClick:()=>void B(),children:[k?(0,w.jsx)(p,{className:`size-3.5 animate-spin`}):(0,w.jsx)(d,{className:`size-3.5`}),`New code`]})]}),children:e?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(y,{title:`Pair your iPhone`,description:`Scan this code from the ShioriCode iOS app — over the same network, or from anywhere when both devices are on Tailscale.`,children:(0,w.jsxs)(`div`,{className:`mt-1 grid gap-4 md:grid-cols-[auto_1fr] md:items-start`,children:[(0,w.jsxs)(`div`,{className:`flex flex-col items-center gap-3`,children:[(0,w.jsx)(`div`,{className:`flex size-56 items-center justify-center rounded-xl border border-border bg-white p-3 shadow-inner sm:size-60`,children:S?(0,w.jsx)(`img`,{src:S,alt:`ShioriCode mobile pairing QR code`,className:`size-full rounded-md`}):(0,w.jsx)(p,{className:`size-6 animate-spin text-muted-foreground`})}),I===null?null:(0,w.jsxs)(`div`,{className:o(`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-[11px] font-medium tabular-nums`,L||I<3e4?`border-warning/30 text-warning`:`border-border text-muted-foreground`),children:[(0,w.jsx)(s,{className:`size-3`}),L?`Expired`:`Expires in ${A(I)}`]})]}),(0,w.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3`,children:[r?.paired?(0,w.jsxs)(_,{variant:`success`,children:[(0,w.jsx)(c,{}),(0,w.jsx)(g,{children:`Paired`}),(0,w.jsxs)(h,{children:[r.pairedDeviceName??`Your iPhone`,` is connected to this desktop.`]})]}):L?(0,w.jsxs)(_,{variant:`warning`,children:[(0,w.jsx)(s,{}),(0,w.jsx)(g,{children:`Code expired`}),(0,w.jsx)(h,{children:`This code is no longer valid. Generate a new one to finish pairing.`})]}):(0,w.jsxs)(_,{variant:`info`,children:[(0,w.jsx)(u,{}),(0,w.jsx)(g,{children:`Waiting for scan`}),(0,w.jsx)(h,{children:`The code is single-use and short-lived.`})]}),M?(0,w.jsxs)(_,{variant:`error`,children:[(0,w.jsx)(g,{children:`Pairing unavailable`}),(0,w.jsx)(h,{children:M})]}):null,r?.paired?(0,w.jsx)(`p`,{className:`text-xs leading-5 text-muted-foreground`,children:`You can now start threads, watch runs, and approve actions from your iPhone.`}):(0,w.jsx)(`ol`,{className:`space-y-2`,children:D.map((e,t)=>(0,w.jsxs)(`li`,{className:`flex items-start gap-2.5`,children:[(0,w.jsx)(`span`,{className:`mt-px flex size-5 shrink-0 items-center justify-center rounded-full border border-border bg-muted/40 text-[11px] font-medium text-muted-foreground`,children:t+1}),(0,w.jsx)(`span`,{className:`text-xs leading-5 text-muted-foreground`,children:e})]},e))}),(0,w.jsx)(`div`,{children:(0,w.jsxs)(i,{size:`sm`,variant:`outline`,disabled:!t?.qrPayload||!R,onClick:()=>void V(),children:[(0,w.jsx)(l,{className:`size-3.5`}),P?`Copied`:`Copy pairing payload`]})})]})]})}),t?.candidates.length?(0,w.jsx)(y,{title:`Network addresses`,description:`The addresses bundled into this code. Your iPhone connects to one of them.`,children:(0,w.jsx)(`ul`,{className:`mt-1 divide-y divide-border overflow-hidden rounded-lg border border-border`,children:t.candidates.map(e=>(0,w.jsxs)(`li`,{className:`flex min-w-0 items-center justify-between gap-3 bg-muted/20 px-3 py-2`,children:[(0,w.jsx)(`code`,{className:`min-w-0 truncate text-xs text-foreground`,children:e.apiBaseUrl}),(0,w.jsx)(`span`,{className:`shrink-0 rounded-full border border-border bg-card px-2 py-0.5 text-[11px] text-muted-foreground`,children:e.label})]},e.apiBaseUrl))})}):null]}):(0,w.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-3 px-6 py-12 text-center`,children:[(0,w.jsx)(`div`,{className:`flex size-10 items-center justify-center rounded-lg border bg-muted/40 text-muted-foreground`,children:(0,w.jsx)(f,{className:`size-5`})}),(0,w.jsxs)(`div`,{className:`space-y-1`,children:[(0,w.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:`Mobile pairing is disabled`}),(0,w.jsx)(`p`,{className:`mx-auto max-w-sm text-xs leading-5 text-muted-foreground`,children:`Mobile pairing is currently disabled for this ShioriCode deployment. Enable it from your server configuration to pair your iPhone.`})]})]})})})}var M=j;export{M as component};
2
+ //# sourceMappingURL=settings.mobile-Cl_q074X.js.map
@@ -1,2 +1,2 @@
1
- import"./vendor--effect-atom-react-6hEhKm5I.js";import"./vendor--floating-ui-react-dom-CGq-bz3X.js";import{t as e}from"./vendor-react-BvVnE5E6.js";import"./vendor-tanstack-DxB_J8A7.js";import{c as t}from"./vendor--lexical-react-Dg6NVZQt.js";import"./vendor-effect-DldSDsna.js";import{f as n,s as r}from"./clientSettings-333fq8u7.js";import"./utils-X2TItr-k.js";import"./store-8a4nbwgb.js";import"./terminalStateStore-COv6Fwmt.js";import"./uiStateStore-DsIsCBO9.js";import{Hn as i,Mn as a,dr as o,gr as s,hn as c,pr as l,wn as u}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{nt as d}from"./index-DO0-ySqI.js";import"./ProviderModelPicker-DvZxygLs.js";import{t as f}from"./badge-BaTrdaZE.js";import"./empty-Be-8qJMT.js";import"./collapsible-DfWqkHJg.js";import{a as p,p as m,s as h}from"./SettingsPanels-CcxbSb2Y.js";import{s as g}from"./skillsMcpShared-CGi0RTQJ.js";import{a as _,i as v,n as y,r as b,t as x}from"./vendor-react-icons-DzNJMww6.js";var S=e(),C={github:x,notion:y,stripe:b,vercel:_,context7:v,filesystem:s,playwright:l,"sequential-thinking":u};function w(e){return C[e]??c}var T=`marketplace-`,E=[{id:`github`,name:`GitHub`,category:`Developer`,summary:`Repository, issue, pull request, and code search tools for agent sessions.`,commandPreview:`npx -y @modelcontextprotocol/server-github`,docsUrl:`https://github.com/modelcontextprotocol/servers/tree/main/src/github`,requiredEnvironment:[`GITHUB_PERSONAL_ACCESS_TOKEN`],server:{transport:`stdio`,command:`npx`,args:[`-y`,`@modelcontextprotocol/server-github`],providers:[]}},{id:`filesystem`,name:`Filesystem`,category:`Files`,summary:`Read and write files in the current workspace through an MCP server.`,commandPreview:`npx -y @modelcontextprotocol/server-filesystem .`,docsUrl:`https://github.com/modelcontextprotocol/servers/tree/main/src/filesystem`,requiredEnvironment:[],server:{transport:`stdio`,command:`npx`,args:[`-y`,`@modelcontextprotocol/server-filesystem`,`.`],providers:[]}},{id:`context7`,name:`Context7`,category:`Knowledge`,summary:`Fetch current library documentation and code examples during implementation.`,commandPreview:`npx -y @upstash/context7-mcp`,docsUrl:`https://github.com/upstash/context7`,requiredEnvironment:[],server:{transport:`stdio`,command:`npx`,args:[`-y`,`@upstash/context7-mcp`],providers:[]}},{id:`playwright`,name:`Playwright`,category:`Browser`,summary:`Browser automation tools for inspecting, testing, and debugging local web apps.`,commandPreview:`npx -y @playwright/mcp@latest`,docsUrl:`https://github.com/microsoft/playwright-mcp`,requiredEnvironment:[],server:{transport:`stdio`,command:`npx`,args:[`-y`,`@playwright/mcp@latest`],providers:[]}},{id:`stripe`,name:`Stripe`,category:`Payments`,summary:`Inspect Stripe resources and documentation through Stripe's hosted OAuth MCP.`,commandPreview:`https://mcp.stripe.com`,docsUrl:`https://docs.stripe.com/mcp`,requiredEnvironment:[],server:{transport:`http`,url:`https://mcp.stripe.com`,oauthResource:`https://mcp.stripe.com`,providers:[]}},{id:`notion`,name:`Notion`,category:`Knowledge`,summary:`Search and update Notion workspace content through Notion's hosted OAuth MCP.`,commandPreview:`https://mcp.notion.com`,docsUrl:`https://developers.notion.com/guides/mcp/mcp`,requiredEnvironment:[],server:{transport:`http`,url:`https://mcp.notion.com`,oauthResource:`https://mcp.notion.com`,providers:[]}},{id:`vercel`,name:`Vercel`,category:`Developer`,summary:`Manage Vercel projects, deployments, logs, and docs through hosted OAuth MCP.`,commandPreview:`https://mcp.vercel.com`,docsUrl:`https://vercel.com/docs/agent-resources/vercel-mcp`,requiredEnvironment:[],server:{transport:`http`,url:`https://mcp.vercel.com`,oauthResource:`https://mcp.vercel.com`,providers:[]}},{id:`sequential-thinking`,name:`Sequential Thinking`,category:`Reasoning`,summary:`Structured scratchpad tools for planning, decomposition, and revision.`,commandPreview:`npx -y @modelcontextprotocol/server-sequential-thinking`,docsUrl:`https://github.com/modelcontextprotocol/servers/tree/main/src/sequentialthinking`,requiredEnvironment:[],server:{transport:`stdio`,command:`npx`,args:[`-y`,`@modelcontextprotocol/server-sequential-thinking`],providers:[]}}];function D(e){return`${T}${e}`}function O(e){return E.find(t=>t.id===e)}function k(e,t){let n=D(t);return e.find(e=>e.name===n)}function A(e){return{...e.server,name:D(e.id),enabled:!0}}function j(e,t){let n=O(t);if(!n)return[...e];let r=A(n),i=e.findIndex(e=>e.name===r.name);return i<0?[...e,r]:e.map((e,t)=>t===i?{...r,enabled:e.enabled}:e)}function M(e,t,n){let r=D(t);return e.map(e=>e.name===r?{...e,enabled:n}:e)}function N(e,t){let n=D(t);return e.filter(e=>e.name!==n)}var P=t();function F(e){let t=(0,S.c)(8),{servers:n,onInstall:s,onToggle:l,onUninstall:u}=e,d=I,p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,P.jsx)(c,{className:`size-3.5`}),t[0]=p):p=t[0];let g;t[1]!==s||t[2]!==l||t[3]!==u||t[4]!==n?(g=E.map(e=>{let t=k(n,e.id),c=t?.enabled??!1;return(0,P.jsxs)(`div`,{className:`grid gap-3 px-4 py-3.5 sm:grid-cols-[minmax(0,1fr)_auto] sm:items-center sm:px-5`,children:[(0,P.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[(0,P.jsx)(`span`,{className:`mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-lg border bg-card text-foreground`,children:(0,P.jsx)(w(e.id),{className:`size-4`})}),(0,P.jsxs)(`div`,{className:`min-w-0 space-y-2`,children:[(0,P.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,P.jsx)(`h3`,{className:`min-w-0 text-sm font-medium text-foreground`,children:e.name}),(0,P.jsx)(f,{variant:`secondary`,className:`text-[10px]`,children:e.category}),t?(0,P.jsx)(f,{variant:c?`default`:`outline`,className:`text-[10px]`,children:c?`Enabled`:`Installed`}):null]}),(0,P.jsx)(`p`,{className:`max-w-[42rem] text-xs leading-5 text-muted-foreground`,children:e.summary}),(0,P.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1 text-[11px] text-muted-foreground`,children:[(0,P.jsx)(`span`,{className:`min-w-0 truncate font-mono`,children:e.commandPreview}),e.requiredEnvironment?.length?(0,P.jsxs)(`span`,{className:`shrink-0`,children:[`Requires `,e.requiredEnvironment.join(`, `)]}):null]})]})]}),(0,P.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 sm:justify-end`,children:[e.docsUrl?(0,P.jsx)(r,{size:`icon-xs`,variant:`ghost`,"aria-label":`Open ${e.name} connector documentation`,onClick:()=>d(e.docsUrl),children:(0,P.jsx)(o,{className:`size-3.5 text-muted-foreground`})}):null,t?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(m,{checked:c,onCheckedChange:t=>l(e.id,t)}),(0,P.jsx)(r,{size:`icon-xs`,variant:`ghost`,"aria-label":`Uninstall ${e.name} connector`,onClick:()=>u(e.id),children:(0,P.jsx)(a,{className:`size-3.5 text-muted-foreground`})})]}):(0,P.jsxs)(r,{size:`sm`,variant:`outline`,className:`gap-1.5`,onClick:()=>s(e.id),children:[(0,P.jsx)(i,{className:`size-3.5`}),`Install`]})]})]},e.id)}),t[1]=s,t[2]=l,t[3]=u,t[4]=n,t[5]=g):g=t[5];let _;return t[6]===g?_=t[7]:(_=(0,P.jsx)(h,{title:`Plugin Marketplace`,icon:p,children:(0,P.jsx)(`div`,{className:`divide-y divide-border`,children:g})}),t[6]=g,t[7]=_),_}function I(e){n().shell.openExternal(e).catch(()=>{window.open(e,`_blank`,`noopener,noreferrer`)})}function L(){let e=(0,S.c)(14),{servers:t,persistServers:n}=g(),r;e[0]!==n||e[1]!==t?(r=e=>{n(j(t,e));let r=E.find(t=>t.id===e);d.add({type:`success`,title:r?`Installed ${r.name}`:`Installed connector`})},e[0]=n,e[1]=t,e[2]=r):r=e[2];let i=r,a;e[3]!==n||e[4]!==t?(a=(e,r)=>{n(M(t,e,r))},e[3]=n,e[4]=t,e[5]=a):a=e[5];let o=a,s;e[6]!==n||e[7]!==t?(s=e=>{n(N(t,e))},e[6]=n,e[7]=t,e[8]=s):s=e[8];let c=s,l;return e[9]!==i||e[10]!==o||e[11]!==c||e[12]!==t?(l=(0,P.jsx)(p,{children:(0,P.jsx)(F,{servers:t,onInstall:i,onToggle:o,onUninstall:c})}),e[9]=i,e[10]=o,e[11]=c,e[12]=t,e[13]=l):l=e[13],l}var R=L;export{R as component};
2
- //# sourceMappingURL=settings.plugins-CQejJM2o.js.map
1
+ import"./vendor--effect-atom-react-6hEhKm5I.js";import"./vendor--floating-ui-react-dom-CGq-bz3X.js";import{t as e}from"./vendor-react-BvVnE5E6.js";import"./vendor-tanstack-DxB_J8A7.js";import{c as t}from"./vendor--lexical-react-Dg6NVZQt.js";import{f as n,s as r}from"./clientSettings-BoLlsjmq.js";import"./vendor-effect-Chd9hYxF.js";import"./utils-BnXGGW32.js";import"./store-BzqS7zm8.js";import"./terminalStateStore-BhU1c2Sw.js";import"./uiStateStore-CGeY60Rr.js";import{Dn as i,Fn as a,Gn as o,gr as s,mr as c,vn as l,yr as u}from"./vendor-ui-CJZCHXkp.js";import"./useSettings-CfiGcPkS.js";import"./useHandleNewThread-CxLIGmcC.js";import"./gitReactQuery-CQYez3In.js";import"./input-C7biIuoM.js";import{nt as d}from"./index-ndFBrjHh.js";import"./ProviderModelPicker-DBL7REnB.js";import{t as f}from"./badge-DQNpCiTY.js";import"./empty-C0odYOnP.js";import"./collapsible-BFxx3cmC.js";import{a as p,p as m,s as h}from"./SettingsPanels-DToV4poM.js";import{s as g}from"./skillsMcpShared-DzSsN5fy.js";import{a as _,i as v,n as y,r as b,t as x}from"./vendor-react-icons-DzNJMww6.js";var S=e(),C={github:x,notion:y,stripe:b,vercel:_,context7:v,filesystem:u,playwright:s,"sequential-thinking":i};function w(e){return C[e]??l}var T=`marketplace-`,E=[{id:`github`,name:`GitHub`,category:`Developer`,summary:`Repository, issue, pull request, and code search tools for agent sessions.`,commandPreview:`npx -y @modelcontextprotocol/server-github`,docsUrl:`https://github.com/modelcontextprotocol/servers/tree/main/src/github`,requiredEnvironment:[`GITHUB_PERSONAL_ACCESS_TOKEN`],server:{transport:`stdio`,command:`npx`,args:[`-y`,`@modelcontextprotocol/server-github`],providers:[]}},{id:`filesystem`,name:`Filesystem`,category:`Files`,summary:`Read and write files in the current workspace through an MCP server.`,commandPreview:`npx -y @modelcontextprotocol/server-filesystem .`,docsUrl:`https://github.com/modelcontextprotocol/servers/tree/main/src/filesystem`,requiredEnvironment:[],server:{transport:`stdio`,command:`npx`,args:[`-y`,`@modelcontextprotocol/server-filesystem`,`.`],providers:[]}},{id:`context7`,name:`Context7`,category:`Knowledge`,summary:`Fetch current library documentation and code examples during implementation.`,commandPreview:`npx -y @upstash/context7-mcp`,docsUrl:`https://github.com/upstash/context7`,requiredEnvironment:[],server:{transport:`stdio`,command:`npx`,args:[`-y`,`@upstash/context7-mcp`],providers:[]}},{id:`playwright`,name:`Playwright`,category:`Browser`,summary:`Browser automation tools for inspecting, testing, and debugging local web apps.`,commandPreview:`npx -y @playwright/mcp@latest`,docsUrl:`https://github.com/microsoft/playwright-mcp`,requiredEnvironment:[],server:{transport:`stdio`,command:`npx`,args:[`-y`,`@playwright/mcp@latest`],providers:[]}},{id:`stripe`,name:`Stripe`,category:`Payments`,summary:`Inspect Stripe resources and documentation through Stripe's hosted OAuth MCP.`,commandPreview:`https://mcp.stripe.com`,docsUrl:`https://docs.stripe.com/mcp`,requiredEnvironment:[],server:{transport:`http`,url:`https://mcp.stripe.com`,oauthResource:`https://mcp.stripe.com`,providers:[]}},{id:`notion`,name:`Notion`,category:`Knowledge`,summary:`Search and update Notion workspace content through Notion's hosted OAuth MCP.`,commandPreview:`https://mcp.notion.com`,docsUrl:`https://developers.notion.com/guides/mcp/mcp`,requiredEnvironment:[],server:{transport:`http`,url:`https://mcp.notion.com`,oauthResource:`https://mcp.notion.com`,providers:[]}},{id:`vercel`,name:`Vercel`,category:`Developer`,summary:`Manage Vercel projects, deployments, logs, and docs through hosted OAuth MCP.`,commandPreview:`https://mcp.vercel.com`,docsUrl:`https://vercel.com/docs/agent-resources/vercel-mcp`,requiredEnvironment:[],server:{transport:`http`,url:`https://mcp.vercel.com`,oauthResource:`https://mcp.vercel.com`,providers:[]}},{id:`sequential-thinking`,name:`Sequential Thinking`,category:`Reasoning`,summary:`Structured scratchpad tools for planning, decomposition, and revision.`,commandPreview:`npx -y @modelcontextprotocol/server-sequential-thinking`,docsUrl:`https://github.com/modelcontextprotocol/servers/tree/main/src/sequentialthinking`,requiredEnvironment:[],server:{transport:`stdio`,command:`npx`,args:[`-y`,`@modelcontextprotocol/server-sequential-thinking`],providers:[]}}];function D(e){return`${T}${e}`}function O(e){return E.find(t=>t.id===e)}function k(e,t){let n=D(t);return e.find(e=>e.name===n)}function A(e){return{...e.server,name:D(e.id),enabled:!0}}function j(e,t){let n=O(t);if(!n)return[...e];let r=A(n),i=e.findIndex(e=>e.name===r.name);return i<0?[...e,r]:e.map((e,t)=>t===i?{...r,enabled:e.enabled}:e)}function M(e,t,n){let r=D(t);return e.map(e=>e.name===r?{...e,enabled:n}:e)}function N(e,t){let n=D(t);return e.filter(e=>e.name!==n)}var P=t();function F(e){let t=(0,S.c)(8),{servers:n,onInstall:i,onToggle:s,onUninstall:u}=e,d=I,p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,P.jsx)(l,{className:`size-3.5`}),t[0]=p):p=t[0];let g;t[1]!==i||t[2]!==s||t[3]!==u||t[4]!==n?(g=E.map(e=>{let t=k(n,e.id),l=t?.enabled??!1;return(0,P.jsxs)(`div`,{className:`grid gap-3 px-4 py-3.5 sm:grid-cols-[minmax(0,1fr)_auto] sm:items-center sm:px-5`,children:[(0,P.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[(0,P.jsx)(`span`,{className:`mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-lg border bg-card text-foreground`,children:(0,P.jsx)(w(e.id),{className:`size-4`})}),(0,P.jsxs)(`div`,{className:`min-w-0 space-y-2`,children:[(0,P.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,P.jsx)(`h3`,{className:`min-w-0 text-sm font-medium text-foreground`,children:e.name}),(0,P.jsx)(f,{variant:`secondary`,className:`text-[10px]`,children:e.category}),t?(0,P.jsx)(f,{variant:l?`default`:`outline`,className:`text-[10px]`,children:l?`Enabled`:`Installed`}):null]}),(0,P.jsx)(`p`,{className:`max-w-[42rem] text-xs leading-5 text-muted-foreground`,children:e.summary}),(0,P.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1 text-[11px] text-muted-foreground`,children:[(0,P.jsx)(`span`,{className:`min-w-0 truncate font-mono`,children:e.commandPreview}),e.requiredEnvironment?.length?(0,P.jsxs)(`span`,{className:`shrink-0`,children:[`Requires `,e.requiredEnvironment.join(`, `)]}):null]})]})]}),(0,P.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 sm:justify-end`,children:[e.docsUrl?(0,P.jsx)(r,{size:`icon-xs`,variant:`ghost`,"aria-label":`Open ${e.name} connector documentation`,onClick:()=>d(e.docsUrl),children:(0,P.jsx)(c,{className:`size-3.5 text-muted-foreground`})}):null,t?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(m,{checked:l,onCheckedChange:t=>s(e.id,t)}),(0,P.jsx)(r,{size:`icon-xs`,variant:`ghost`,"aria-label":`Uninstall ${e.name} connector`,onClick:()=>u(e.id),children:(0,P.jsx)(a,{className:`size-3.5 text-muted-foreground`})})]}):(0,P.jsxs)(r,{size:`sm`,variant:`outline`,className:`gap-1.5`,onClick:()=>i(e.id),children:[(0,P.jsx)(o,{className:`size-3.5`}),`Install`]})]})]},e.id)}),t[1]=i,t[2]=s,t[3]=u,t[4]=n,t[5]=g):g=t[5];let _;return t[6]===g?_=t[7]:(_=(0,P.jsx)(h,{title:`Plugin Marketplace`,icon:p,children:(0,P.jsx)(`div`,{className:`divide-y divide-border`,children:g})}),t[6]=g,t[7]=_),_}function I(e){n().shell.openExternal(e).catch(()=>{window.open(e,`_blank`,`noopener,noreferrer`)})}function L(){let e=(0,S.c)(14),{servers:t,persistServers:n}=g(),r;e[0]!==n||e[1]!==t?(r=e=>{n(j(t,e));let r=E.find(t=>t.id===e);d.add({type:`success`,title:r?`Installed ${r.name}`:`Installed connector`})},e[0]=n,e[1]=t,e[2]=r):r=e[2];let i=r,a;e[3]!==n||e[4]!==t?(a=(e,r)=>{n(M(t,e,r))},e[3]=n,e[4]=t,e[5]=a):a=e[5];let o=a,s;e[6]!==n||e[7]!==t?(s=e=>{n(N(t,e))},e[6]=n,e[7]=t,e[8]=s):s=e[8];let c=s,l;return e[9]!==i||e[10]!==o||e[11]!==c||e[12]!==t?(l=(0,P.jsx)(p,{children:(0,P.jsx)(F,{servers:t,onInstall:i,onToggle:o,onUninstall:c})}),e[9]=i,e[10]=o,e[11]=c,e[12]=t,e[13]=l):l=e[13],l}var R=L;export{R as component};
2
+ //# sourceMappingURL=settings.plugins-Bz_Jt-h5.js.map
@@ -0,0 +1,2 @@
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{_ as i,s as a}from"./clientSettings-BoLlsjmq.js";import"./vendor-effect-Chd9hYxF.js";import"./utils-BnXGGW32.js";import"./store-BzqS7zm8.js";import"./terminalStateStore-BhU1c2Sw.js";import"./uiStateStore-CGeY60Rr.js";import{Fr as o,Ir as s,Nr as c,Wr as l,Xn as u,br as d,er as f,gr as p,jn as m,jr as h,mr as g,zn as _}from"./vendor-ui-CJZCHXkp.js";import"./useSettings-CfiGcPkS.js";import"./useHandleNewThread-CxLIGmcC.js";import"./gitReactQuery-CQYez3In.js";import{t as v}from"./input-C7biIuoM.js";import{M as y,N as b,c as x,j as S,l as C}from"./index-ndFBrjHh.js";import"./ProviderModelPicker-DBL7REnB.js";import"./empty-C0odYOnP.js";import"./collapsible-BFxx3cmC.js";import{a as w,o as T,s as E}from"./SettingsPanels-DToV4poM.js";import{t as D}from"./vendor-qrcode-generator-CJtPPqPY.js";var O=n(),k=e(t(),1),A=r();function ee(e){let t=(0,O.c)(24),{url:n}=e,[r,i]=(0,k.useState)(!1),[o,u]=(0,k.useState)(!1),d,f;if(t[0]!==n){let e=D(0,`M`);e.addData(n,`Byte`),e.make(),f=e.createDataURL(7,2),t[0]=n,t[1]=f}else f=t[1];d=f;let p=d,m=typeof navigator<`u`&&!!navigator.clipboard,h;t[2]===n?h=t[3]:(h=async()=>{m&&(await navigator.clipboard.writeText(n),u(!0),window.setTimeout(()=>u(!1),1200))},t[2]=n,t[3]=h);let g=h,_;t[4]===n?_=t[5]:(_=(0,A.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]===o?y=t[9]:(y=o?(0,A.jsx)(s,{className:`size-3.5`}):(0,A.jsx)(c,{className:`size-3.5`}),t[8]=o,t[9]=y);let b=o?`Copied`:`Copy`,x;t[10]!==v||t[11]!==y||t[12]!==b?(x=(0,A.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,A.jsxs)(a,{size:`sm`,variant:`outline`,onClick:()=>i(j),children:[(0,A.jsx)(l,{className:`size-3.5`}),`QR`]}),t[14]=S):S=t[14];let C;t[15]!==_||t[16]!==x?(C=(0,A.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,A.jsxs)(`div`,{className:`flex flex-col items-center gap-2 rounded-xl border border-border bg-white p-4`,children:[(0,A.jsx)(`img`,{src:p,alt:`Remote access QR code`,className:`size-56 max-w-full rounded-md`}),(0,A.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,A.jsxs)(`div`,{className:`space-y-3`,children:[C,w]}),t[21]=C,t[22]=w,t[23]=T):T=t[23],T}function j(e){return!e}var M=[{id:`method`,title:`Who can reach it`},{id:`prerequisites`,title:`Get ready`},{id:`credentials`,title:`Sign-in`},{id:`enable`,title:`Turn on`}],N=[{value:`shiori-link`,label:`Shiori Link`,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 P(e,t){if(e===`shiori-link`)return[{id:`shiori-account`,label:`Shiori account is connected`,ok:t.link.accountLinked,hint:t.link.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 F(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 I=4e3;function L({status:e,onStatus:t,onClose:n,initialMethod:r}){let[c,l]=(0,k.useState)(`method`),[d,f]=(0,k.useState)(r??`shiori-link`),[p,h]=(0,k.useState)(e.username??``),[w,T]=(0,k.useState)(``),[E,D]=(0,k.useState)(``),[O,j]=(0,k.useState)(e.authConfigured),[L,R]=(0,k.useState)(!1),[z,B]=(0,k.useState)(null),[V,H]=(0,k.useState)(!1),[U,W]=(0,k.useState)(null),[G,K]=(0,k.useState)(!1),q=M.findIndex(e=>e.id===c),J=(0,k.useCallback)(async()=>{try{t(await i().remote.getStatus())}catch{}},[t]);(0,k.useEffect)(()=>{if(c!==`prerequisites`)return;let e=window.setInterval(()=>void J(),I);return()=>window.clearInterval(e)},[c,J]);let te=(0,k.useCallback)(()=>{B(null);let e=M[q-1];e&&!V&&l(e.id)},[q,V]),ne=(0,k.useCallback)(()=>{B(null),l(`prerequisites`)},[]),re=(0,k.useCallback)(()=>{B(null),l(`credentials`)},[]),ie=(0,k.useCallback)(async()=>{R(!0),B(null);try{let e=await i().remote.beginLinkSignIn({provider:`github`});(await window.desktopBridge?.openExternal(e.authUrl)===!1||window.desktopBridge===void 0)&&window.open(e.authUrl,`_blank`,`noopener,noreferrer`)}catch(e){B(e instanceof Error?e.message:`Couldn't start Shiori sign-in.`)}finally{R(!1)}},[]),Y=(0,k.useCallback)(async()=>{B(null);let e=F({username:p,password:w,confirm:E,keepExisting:O});if(e){B(e);return}if(O){l(`enable`);return}R(!0);try{t(await i().remote.setCredentials({username:p.trim(),password:w})),await C(p.trim(),w),T(``),D(``),l(`enable`)}catch(e){B(e instanceof Error?e.message:`Couldn't save the credentials.`)}finally{R(!1)}},[p,w,E,O,t]),X=(0,k.useCallback)(async()=>{B(null),R(!0);try{t(await i().remote.setExposure({method:d})),H(!0)}catch(e){B(e instanceof Error?e.message:`Couldn't turn on remote access.`)}finally{R(!1)}},[d,t]),Z=(0,k.useCallback)(async()=>{K(!0),W(null);try{W(await i().remote.testConnection())}catch(e){W({ok:!1,url:null,latencyMs:null,error:e instanceof Error?e.message:`Test failed.`})}finally{K(!1)}},[]),Q=P(d,e),ae=Q.every(e=>e.ok),$=N.find(e=>e.value===d);return(0,A.jsxs)(`div`,{className:`space-y-4 px-4 py-4 sm:px-5`,children:[(0,A.jsx)(`ol`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-[11px]`,children:M.map((e,t)=>{let n=t<q?`done`:t===q?`current`:`upcoming`;return(0,A.jsxs)(`li`,{className:`flex items-center gap-2`,children:[t>0?(0,A.jsx)(`span`,{className:`text-muted-foreground/40`,children:`—`}):null,(0,A.jsxs)(`span`,{className:n===`current`?`font-medium text-foreground`:n===`done`?`text-primary`:`text-muted-foreground`,children:[t+1,`. `,e.title]})]},e.id)})}),z?(0,A.jsxs)(S,{variant:`error`,children:[(0,A.jsx)(b,{children:`Couldn't continue`}),(0,A.jsx)(y,{children:z})]}):null,c===`method`?(0,A.jsx)(`div`,{className:`space-y-3`,children:(0,A.jsx)(`div`,{className:`grid gap-2`,children:N.map(e=>{let t=d===e.value;return(0,A.jsxs)(`button`,{type:`button`,onClick:()=>f(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,A.jsxs)(`span`,{className:`flex items-center gap-2 text-sm font-medium text-foreground`,children:[t?(0,A.jsx)(s,{className:`size-3.5 text-primary`}):null,e.label,(0,A.jsx)(`span`,{className:`rounded-full border border-border px-1.5 py-px text-[10px] font-normal text-muted-foreground`,children:e.badge})]}),(0,A.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.description})]},e.value)})})}):null,c===`prerequisites`?(0,A.jsxs)(`div`,{className:`space-y-3`,children:[(0,A.jsx)(`ul`,{className:`divide-y divide-border rounded-lg border border-border`,children:Q.map(e=>(0,A.jsxs)(`li`,{className:`flex items-start gap-2.5 px-3 py-2.5`,children:[e.ok?(0,A.jsx)(s,{className:`mt-0.5 size-4 shrink-0 text-emerald-500`}):(0,A.jsx)(o,{className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),(0,A.jsxs)(`div`,{className:`min-w-0 space-y-0.5`,children:[(0,A.jsx)(`div`,{className:`text-sm text-foreground`,children:e.label}),!e.ok&&e.hint?(0,A.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[e.hint,` `,e.href?(0,A.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-0.5 text-primary hover:underline`,children:[`Open`,(0,A.jsx)(g,{className:`size-3`})]}):null]}):null]})]},e.id))}),(0,A.jsxs)(`p`,{className:`flex items-center gap-1.5 text-[11px] text-muted-foreground`,children:[(0,A.jsx)(u,{className:`size-3 animate-spin [animation-duration:3s]`}),`Checking automatically — finish the steps above and they'll turn green.`]}),d===`shiori-link`&&!e.link.accountLinked?(0,A.jsxs)(a,{size:`sm`,disabled:L,onClick:()=>void ie(),children:[L?(0,A.jsx)(m,{className:`size-3.5 animate-spin`}):null,`Sign in with GitHub`,(0,A.jsx)(g,{className:`size-3.5`})]}):null]}):null,c===`credentials`?(0,A.jsxs)(`div`,{className:`space-y-3`,children:[e.authConfigured?(0,A.jsx)(S,{variant:`info`,children:(0,A.jsxs)(y,{children:[`A sign-in is already set`,e.username?` for “${e.username}”`:``,`.`,` `,(0,A.jsx)(`button`,{type:`button`,className:`font-medium text-primary hover:underline`,onClick:()=>j(e=>!e),children:O?`Set a new one instead`:`Keep the existing one`})]})}):(0,A.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.`}),O?null:(0,A.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:[(0,A.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,A.jsx)(x,{htmlFor:`wizard-username`,children:`Username`}),(0,A.jsx)(v,{id:`wizard-username`,autoComplete:`username`,value:p,onChange:e=>h(e.target.value),disabled:L})]}),(0,A.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,A.jsx)(x,{htmlFor:`wizard-password`,children:`Password`}),(0,A.jsx)(v,{id:`wizard-password`,type:`password`,autoComplete:`new-password`,value:w,onChange:e=>T(e.target.value),disabled:L})]}),(0,A.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,A.jsx)(x,{htmlFor:`wizard-confirm`,children:`Confirm password`}),(0,A.jsx)(v,{id:`wizard-confirm`,type:`password`,autoComplete:`new-password`,value:E,onChange:e=>D(e.target.value),disabled:L})]})]})]}):null,c===`enable`?(0,A.jsx)(`div`,{className:`space-y-3`,children:V?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(S,{variant:`success`,children:[(0,A.jsx)(b,{children:`Remote access is on`}),(0,A.jsx)(y,{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,A.jsx)(ee,{url:e.url}):null,(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsxs)(a,{size:`sm`,variant:`outline`,disabled:G,onClick:()=>void Z(),children:[G?(0,A.jsx)(m,{className:`size-3.5 animate-spin`}):null,`Test connection`]}),U?(0,A.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-xs ${U.ok?`text-emerald-600 dark:text-emerald-400`:`text-destructive`}`,children:[U.ok?(0,A.jsx)(s,{className:`size-3.5`}):(0,A.jsx)(o,{className:`size-3.5`}),U.ok?`Reachable${U.latencyMs===null?``:` · ${U.latencyMs}ms`}`:U.error??`Not reachable.`]}):null]})]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Ready to go:`,` `,(0,A.jsx)(`span`,{className:`font-medium text-foreground`,children:$?.label}),`. Sign-in required for every device.`,d===`tailscale-funnel`?` The first public request can take a minute while Tailscale provisions the TLS certificate.`:d===`shiori-link`?` The first setup downloads a checksum-verified connector and can take a moment.`:``]}),(0,A.jsxs)(a,{disabled:L,onClick:()=>void X(),children:[L?(0,A.jsx)(m,{className:`size-3.5 animate-spin`}):null,`Turn on remote access`]})]})}):null,(0,A.jsxs)(`div`,{className:`flex items-center justify-between border-t border-border pt-3`,children:[(0,A.jsx)(`div`,{children:q>0&&!V?(0,A.jsxs)(a,{size:`sm`,variant:`ghost`,disabled:L,onClick:te,children:[(0,A.jsx)(_,{className:`size-3.5`}),`Back`]}):null}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(a,{size:`sm`,variant:`ghost`,disabled:L,onClick:n,children:V?`Done`:`Cancel`}),c===`method`?(0,A.jsx)(a,{size:`sm`,onClick:ne,children:`Continue`}):null,c===`prerequisites`?(0,A.jsx)(a,{size:`sm`,disabled:L||!ae,onClick:re,children:`Continue`}):null,c===`credentials`?(0,A.jsxs)(a,{size:`sm`,disabled:L,onClick:()=>void Y(),children:[L?(0,A.jsx)(m,{className:`size-3.5 animate-spin`}):null,`Continue`]}):null]})]})]})}var R=`__local__`;function z(e){try{return new URL(e).hostname}catch{return e}}function B(){let e=window.desktopBridge,t=typeof e?.getRemoteConnection==`function`&&typeof e.connectToRemote==`function`&&typeof e.disconnectFromRemote==`function`,[n,r]=(0,k.useState)(null),[i,o]=(0,k.useState)(``),[s,c]=(0,k.useState)(!1),[l,u]=(0,k.useState)(null);if((0,k.useEffect)(()=>{if(!t||!e?.getRemoteConnection)return;let n=!1;return e.getRemoteConnection().then(e=>{n||r(e)}),()=>{n=!0}},[e,t]),!t||!e)return null;let d=async t=>{c(!0),u(null);try{let n=await e.connectToRemote?.(t);n&&r(n.state),n&&!n.ok&&u(n.error??`The remote could not be reached.`)}catch(e){u(e instanceof Error?e.message:`The remote could not be reached.`)}finally{c(!1)}},f=async()=>{c(!0),u(null);try{let t=await e.disconnectFromRemote?.();t&&r(t)}catch(e){u(e instanceof Error?e.message:`Could not switch to this computer.`)}finally{c(!1)}};return(0,A.jsx)(E,{title:`Connection`,icon:(0,A.jsx)(h,{className:`size-3.5`}),children:(0,A.jsxs)(T,{title:`Run ShioriCode on`,description:`Switch between this computer and saved remote servers.`,status:n?.remoteUrl?z(n.remoteUrl):`This computer`,children:[l?(0,A.jsx)(S,{variant:`error`,className:`mb-3`,children:(0,A.jsx)(y,{children:l})}):null,(0,A.jsxs)(`div`,{className:`grid gap-3`,children:[(0,A.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,A.jsx)(x,{htmlFor:`desktop-environment`,children:`Current environment`}),(0,A.jsxs)(`select`,{id:`desktop-environment`,className:`border-input bg-background h-9 w-full rounded-md border px-3 text-sm shadow-xs outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,value:n?.remoteUrl??R,disabled:s,onChange:e=>{let t=e.target.value;t===R?f():d(t)},children:[(0,A.jsx)(`option`,{value:R,children:`This computer`}),(n?.savedRemoteUrls??[]).map(e=>(0,A.jsx)(`option`,{value:e,children:z(e)},e))]})]}),(0,A.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,A.jsx)(x,{htmlFor:`desktop-remote-url`,children:`Add a remote`}),(0,A.jsxs)(`div`,{className:`flex gap-2`,children:[(0,A.jsx)(v,{id:`desktop-remote-url`,type:`url`,inputMode:`url`,placeholder:`sc-….link.shiori.codes`,value:i,disabled:s,onChange:e=>o(e.target.value),onKeyDown:e=>{e.key===`Enter`&&i.trim()&&d(i)}}),(0,A.jsx)(a,{disabled:s||!i.trim(),onClick:()=>void d(i),children:s?`Connecting…`:`Connect`})]})]})]})]})})}var V=[{value:`off`,label:`Off`,hint:`This machine only`},{value:`shiori-link`,label:`Link`,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 H(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 U(){let[e,t]=(0,k.useState)(null),[n,r]=(0,k.useState)(!0),[c,l]=(0,k.useState)(!1),[h,g]=(0,k.useState)(!1),[_,C]=(0,k.useState)(null),[D,O]=(0,k.useState)(!1),[j,M]=(0,k.useState)(void 0),[N,P]=(0,k.useState)(null),[F,I]=(0,k.useState)(!1),R=(0,k.useRef)(!1),[z,U]=(0,k.useState)(``),[W,G]=(0,k.useState)(``),K=(0,k.useCallback)(async()=>{l(!0),C(null);try{t(await i().remote.getStatus())}catch(e){C(e instanceof Error?e.message:`Failed to load remote status.`)}finally{l(!1)}},[]);(0,k.useEffect)(()=>{let e=!1;return i().remote.getStatus().then(n=>{e||(t(n),!R.current&&n.desiredMethod===`off`&&!n.enabled&&(R.current=!0,O(!0)))}).catch(t=>{e||C(t instanceof Error?t.message:`Failed to load remote status.`)}).finally(()=>{e||r(!1)}),()=>{e=!0}},[]),(0,k.useEffect)(()=>{e?.username&&U(e.username)},[e?.username]);let q=(0,k.useCallback)(async e=>{g(!0),C(null);try{t(await e())}catch(e){C(e instanceof Error?e.message:`Something went wrong.`)}finally{g(!1)}},[]),J=(0,k.useCallback)(e=>q(()=>i().remote.setExposure({method:e})),[q]),te=(0,k.useCallback)(()=>q(()=>i().remote.setCredentials({username:z.trim(),password:W}).then(e=>(G(``),e))),[q,z,W]),ne=(0,k.useCallback)(e=>q(()=>i().remote.revokeSession({sessionId:e})),[q]),re=(0,k.useCallback)(()=>q(()=>i().remote.disconnectLinkAccount({})),[q]),ie=(0,k.useCallback)(async()=>{I(!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{I(!1)}},[]),Y=(0,k.useCallback)(e=>{M(e),O(!0)},[]),X=e?.tailscale,Z=e?.link,Q=!!Z?.accountLinked,ae=!!X?.installed,$=!!(X?.installed&&X.httpsEnabled),oe=!!(e&&e.desiredMethod!==`off`&&e.desiredMethod!==e.method),se=(0,k.useMemo)(()=>e?e.enabled?e.reachability===`public`?`Public`:`Live`:`Off`:`…`,[e]);return n?(0,A.jsx)(w,{children:(0,A.jsxs)(`div`,{className:`flex items-center gap-2 px-1 py-8 text-sm text-muted-foreground`,children:[(0,A.jsx)(m,{className:`size-4 animate-spin`}),`Loading remote access…`]})}):(0,A.jsxs)(w,{children:[(0,A.jsx)(B,{}),(0,A.jsx)(E,{title:`Remote access`,icon:(0,A.jsx)(p,{className:`size-3.5`}),headerAction:(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.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,A.jsx)(`span`,{className:`size-1.5 rounded-full ${e?.enabled?`bg-emerald-500`:`bg-muted-foreground/50`}`}),se]}),(0,A.jsx)(a,{size:`xs`,variant:`outline`,disabled:h||c,onClick:()=>void K(),children:(0,A.jsx)(u,{className:`size-3.5 ${c?`animate-spin`:``}`})})]}),children:D&&e?(0,A.jsx)(L,{status:e,onStatus:t,onClose:()=>{O(!1),M(void 0)},...j===void 0?{}:{initialMethod:j}},j??`default`):(0,A.jsxs)(T,{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,A.jsx)(a,{size:`sm`,variant:`outline`,disabled:h,onClick:()=>Y(),children:e?.enabled?`Run setup again`:`Set up remote access`}),children:[_?(0,A.jsxs)(S,{variant:`error`,className:`mb-3`,children:[(0,A.jsx)(b,{children:`Couldn't complete that`}),(0,A.jsx)(y,{children:_})]}):null,oe&&e?(0,A.jsxs)(S,{variant:`warning`,className:`mb-3`,children:[(0,A.jsx)(b,{children:`Remote access was interrupted`}),(0,A.jsx)(y,{children:(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,A.jsx)(`span`,{children:e.notice??`The exposure no longer matches what you set up.`}),(0,A.jsx)(a,{size:`xs`,variant:`outline`,disabled:h,onClick:()=>void J(e.desiredMethod),children:`Repair`})]})})]}):null,e?.enabled&&e.url?(0,A.jsxs)(`div`,{className:`space-y-3`,children:[(0,A.jsx)(ee,{url:e.url}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsxs)(a,{size:`sm`,variant:`outline`,disabled:F,onClick:()=>void ie(),children:[F?(0,A.jsx)(m,{className:`size-3.5 animate-spin`}):null,`Test connection`]}),N?(0,A.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,A.jsx)(s,{className:`size-3.5`}):(0,A.jsx)(o,{className:`size-3.5`}),N.ok?`Reachable${N.latencyMs===null?``:` · ${N.latencyMs}ms`}`:N.error??`Not reachable.`]}):null]})]}):(0,A.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&&!oe?(0,A.jsx)(S,{variant:`warning`,className:`mt-3`,children:(0,A.jsx)(y,{children:e.notice})}):null]})}),D?null:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(E,{title:`How it's reached`,icon:(0,A.jsx)(d,{className:`size-3.5`}),children:(0,A.jsxs)(T,{title:`Access method`,description:Z?.accountLinked?`Link is ready. Tailscale remains available for private tailnet-only access.`:X?.installed?X.running?`Connect Shiori for Link, or keep using this machine's Tailscale connection.`:`Connect Shiori for Link without Tailscale, or reconnect the Tailscale app.`:`Shiori Link gives this machine a hosted link without Tailscale, ports, or DNS setup.`,children:[(0,A.jsx)(`div`,{className:`mt-1 grid gap-2 sm:grid-cols-2 lg:grid-cols-4`,children:V.map(t=>{let n=e?.method===t.value;return(0,A.jsxs)(`button`,{type:`button`,disabled:h||t.value===`shiori-link`&&!Q||t.value===`tailscale-serve`&&!ae||t.value===`tailscale-funnel`&&!$,onClick:()=>void J(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,A.jsxs)(`span`,{className:`flex items-center gap-1.5 text-sm font-medium text-foreground`,children:[n?(0,A.jsx)(s,{className:`size-3.5 text-primary`}):null,t.label]}),(0,A.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:t.hint})]},t.value)})}),X&&!X.installed?(0,A.jsxs)(`p`,{className:`mt-2 text-[11px] text-muted-foreground`,children:[(0,A.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,$||e?.method===`tailscale-funnel`?null:X?.installed&&!X.httpsEnabled?(0,A.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,A.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,A.jsxs)(`div`,{children:[(0,A.jsx)(`div`,{className:`text-sm text-foreground`,children:`Shiori Link`}),(0,A.jsx)(`div`,{className:`text-[11px] text-muted-foreground`,children:Z?.accountLinked?Z.endpoint?`Connected · ${Z.endpoint}`:`Shiori account connected`:`No Shiori account connected`})]}),Z?.accountLinked?(0,A.jsx)(a,{size:`xs`,variant:`ghost`,disabled:h,onClick:()=>void re(),children:`Disconnect`}):(0,A.jsx)(a,{size:`xs`,variant:`outline`,onClick:()=>Y(`shiori-link`),children:`Connect`})]})]})}),(0,A.jsx)(E,{title:`Sign-in`,children:(0,A.jsx)(T,{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,A.jsxs)(`div`,{className:`mt-1 grid gap-3 sm:grid-cols-[1fr_1fr_auto] sm:items-end`,children:[(0,A.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,A.jsx)(x,{htmlFor:`remote-username`,children:`Username`}),(0,A.jsx)(v,{id:`remote-username`,autoComplete:`username`,value:z,onChange:e=>U(e.target.value),disabled:h})]}),(0,A.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,A.jsx)(x,{htmlFor:`remote-password`,children:e?.authConfigured?`New password`:`Password`}),(0,A.jsx)(v,{id:`remote-password`,type:`password`,autoComplete:`new-password`,value:W,onChange:e=>G(e.target.value),disabled:h})]}),(0,A.jsx)(a,{disabled:h||z.trim().length===0||W.length===0,onClick:()=>void te(),children:e?.authConfigured?`Update`:`Set password`})]})})}),(0,A.jsx)(E,{title:`Devices`,icon:(0,A.jsx)(f,{className:`size-3.5`}),children:(0,A.jsx)(T,{title:`Connected devices`,description:`Sessions that have signed in remotely. Revoke one to sign it out immediately.`,children:e&&e.sessions.length>0?(0,A.jsx)(`div`,{className:`mt-1 divide-y divide-border rounded-lg border border-border`,children:e.sessions.map(e=>(0,A.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-3 px-3 py-2.5`,children:[(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`div`,{className:`truncate text-sm text-foreground`,children:e.label??e.username}),(0,A.jsxs)(`div`,{className:`text-[11px] text-muted-foreground`,children:[`last seen `,H(e.lastSeenAt)]})]}),(0,A.jsx)(a,{size:`xs`,variant:`ghost`,disabled:h,onClick:()=>void ne(e.id),children:`Revoke`})]},e.id))}):(0,A.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`No devices connected yet.`})})})]})]})}var W=U;export{W as component};
2
+ //# sourceMappingURL=settings.remote-COKGS805.js.map
@@ -1,2 +1,2 @@
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,m as i}from"./vendor-tanstack-DxB_J8A7.js";import{c as a}from"./vendor--lexical-react-Dg6NVZQt.js";import"./vendor-effect-DldSDsna.js";import{f as o,s}from"./clientSettings-333fq8u7.js";import"./utils-X2TItr-k.js";import"./store-8a4nbwgb.js";import"./terminalStateStore-COv6Fwmt.js";import"./uiStateStore-DsIsCBO9.js";import{Mn as c,wn as l}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"./ProviderModelPicker-DvZxygLs.js";import{t as u}from"./badge-BaTrdaZE.js";import{a as d,i as f,o as p,r as m,t as h}from"./empty-Be-8qJMT.js";import"./collapsible-DfWqkHJg.js";import{a as g,s as _}from"./SettingsPanels-CcxbSb2Y.js";import{a as v,i as y,n as b,o as x,r as S}from"./skillsMcpShared-CGi0RTQJ.js";var C=n(),w=e(t(),1),T=a();function E(e){let t=(0,C.c)(18),{skill:n,onDelete:r}=e,i;t[0]===n.name?i=t[1]:(i=(0,T.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:n.name}),t[0]=n.name,t[1]=i);let a;t[2]===n.scope?a=t[3]:(a=(0,T.jsx)(u,{variant:`outline`,className:`text-[10px] capitalize`,children:n.scope}),t[2]=n.scope,t[3]=a);let o;t[4]!==i||t[5]!==a?(o=(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6];let l;t[7]===n.description?l=t[8]:(l=n.description?(0,T.jsx)(`p`,{className:`mt-0.5 line-clamp-1 text-xs text-muted-foreground`,children:n.description}):null,t[7]=n.description,t[8]=l);let d;t[9]!==o||t[10]!==l?(d=(0,T.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[o,l]}),t[9]=o,t[10]=l,t[11]=d):d=t[11];let f;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,T.jsx)(c,{className:`size-3.5 text-muted-foreground`}),t[12]=f):f=t[12];let p;t[13]===r?p=t[14]:(p=(0,T.jsx)(s,{size:`icon-xs`,variant:`ghost`,onClick:r,children:f}),t[13]=r,t[14]=p);let m;return t[15]!==d||t[16]!==p?(m=(0,T.jsxs)(`div`,{className:`flex items-center gap-3 border-t border-border/60 px-4 py-2.5 pl-10 sm:px-5 sm:pl-11`,children:[d,p]}),t[15]=d,t[16]=p,t[17]=m):m=t[17],m}function D({skills:e,onDelete:t}){let[n,r]=(0,w.useState)(``),i=(0,w.useMemo)(()=>n?e.filter(e=>x(n,e.name,e.description,e.source,e.scope)):e,[e,n]),a=(0,w.useMemo)(()=>v(i),[i]),o=e.length>5,s=a.size>1;return(0,T.jsx)(_,{title:`Skills`,icon:(0,T.jsx)(l,{className:`size-3.5`}),children:e.length===0?(0,T.jsxs)(h,{className:`min-h-36`,children:[(0,T.jsx)(d,{variant:`icon`,children:(0,T.jsx)(l,{})}),(0,T.jsxs)(f,{children:[(0,T.jsx)(p,{children:`No skills found`}),(0,T.jsx)(m,{children:`Add skills under ~/.agents/skills or workspace .agents/skills.`})]})]}):(0,T.jsxs)(T.Fragment,{children:[o?(0,T.jsx)(S,{value:n,onChange:r,placeholder:`Filter skills…`,resultCount:i.length,totalCount:e.length}):null,(0,T.jsx)(`div`,{className:`max-h-96 overflow-y-auto`,children:i.length===0?(0,T.jsxs)(`p`,{className:`px-4 py-6 text-center text-sm text-muted-foreground sm:px-5`,children:[`No skills match “`,n,`”`]}):s?Array.from(a.entries()).map(([e,n])=>(0,T.jsx)(y,{source:e,count:n.length,defaultOpen:!0,children:n.map(e=>(0,T.jsx)(E,{skill:e,onDelete:()=>t(e)},`${e.scope}|${e.path}`))},e)):i.map(e=>(0,T.jsx)(E,{skill:e,onDelete:()=>t(e)},`${e.source}|${e.scope}|${e.path}`))})]})})}function O(){let e=(0,C.c)(7),t=i(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={queryKey:b,queryFn:k,staleTime:5e3},e[0]=n):n=e[0];let a=r(n),s;e[1]===t?s=e[2]:(s=e=>{o().server.removeSkill({source:e.source,name:e.name,path:e.path}).then(()=>t.invalidateQueries({queryKey:b}))},e[1]=t,e[2]=s);let c=s,u;return e[3]!==c||e[4]!==a.data?.skills||e[5]!==a.isLoading?(u=(0,T.jsx)(g,{children:a.isLoading?(0,T.jsx)(_,{title:`Skills`,icon:(0,T.jsx)(l,{className:`size-3.5`}),children:(0,T.jsxs)(h,{className:`min-h-36`,children:[(0,T.jsx)(d,{variant:`icon`,children:(0,T.jsx)(l,{})}),(0,T.jsxs)(f,{children:[(0,T.jsx)(p,{children:`Loading skills`}),(0,T.jsx)(m,{children:`Checking ShioriCode, Codex, and Claude skill locations.`})]})]})}):(0,T.jsx)(D,{skills:a.data?.skills??[],onDelete:c})}),e[3]=c,e[4]=a.data?.skills,e[5]=a.isLoading,e[6]=u):u=e[6],u}function k(){return o().server.listSkills()}var A=O;export{A as component};
2
- //# sourceMappingURL=settings.skills-Cg57qd7S.js.map
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,m as i}from"./vendor-tanstack-DxB_J8A7.js";import{c as a}from"./vendor--lexical-react-Dg6NVZQt.js";import{f as o,s}from"./clientSettings-BoLlsjmq.js";import"./vendor-effect-Chd9hYxF.js";import"./utils-BnXGGW32.js";import"./store-BzqS7zm8.js";import"./terminalStateStore-BhU1c2Sw.js";import"./uiStateStore-CGeY60Rr.js";import{Dn as c,Fn as l}from"./vendor-ui-CJZCHXkp.js";import"./useSettings-CfiGcPkS.js";import"./useHandleNewThread-CxLIGmcC.js";import"./gitReactQuery-CQYez3In.js";import"./input-C7biIuoM.js";import"./ProviderModelPicker-DBL7REnB.js";import{t as u}from"./badge-DQNpCiTY.js";import{a as d,i as f,o as p,r as m,t as h}from"./empty-C0odYOnP.js";import"./collapsible-BFxx3cmC.js";import{a as g,s as _}from"./SettingsPanels-DToV4poM.js";import{a as v,i as y,n as b,o as x,r as S}from"./skillsMcpShared-DzSsN5fy.js";var C=n(),w=e(t(),1),T=a();function E(e){let t=(0,C.c)(18),{skill:n,onDelete:r}=e,i;t[0]===n.name?i=t[1]:(i=(0,T.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:n.name}),t[0]=n.name,t[1]=i);let a;t[2]===n.scope?a=t[3]:(a=(0,T.jsx)(u,{variant:`outline`,className:`text-[10px] capitalize`,children:n.scope}),t[2]=n.scope,t[3]=a);let o;t[4]!==i||t[5]!==a?(o=(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6];let c;t[7]===n.description?c=t[8]:(c=n.description?(0,T.jsx)(`p`,{className:`mt-0.5 line-clamp-1 text-xs text-muted-foreground`,children:n.description}):null,t[7]=n.description,t[8]=c);let d;t[9]!==o||t[10]!==c?(d=(0,T.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[o,c]}),t[9]=o,t[10]=c,t[11]=d):d=t[11];let f;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,T.jsx)(l,{className:`size-3.5 text-muted-foreground`}),t[12]=f):f=t[12];let p;t[13]===r?p=t[14]:(p=(0,T.jsx)(s,{size:`icon-xs`,variant:`ghost`,onClick:r,children:f}),t[13]=r,t[14]=p);let m;return t[15]!==d||t[16]!==p?(m=(0,T.jsxs)(`div`,{className:`flex items-center gap-3 border-t border-border/60 px-4 py-2.5 pl-10 sm:px-5 sm:pl-11`,children:[d,p]}),t[15]=d,t[16]=p,t[17]=m):m=t[17],m}function D({skills:e,onDelete:t}){let[n,r]=(0,w.useState)(``),i=(0,w.useMemo)(()=>n?e.filter(e=>x(n,e.name,e.description,e.source,e.scope)):e,[e,n]),a=(0,w.useMemo)(()=>v(i),[i]),o=e.length>5,s=a.size>1;return(0,T.jsx)(_,{title:`Skills`,icon:(0,T.jsx)(c,{className:`size-3.5`}),children:e.length===0?(0,T.jsxs)(h,{className:`min-h-36`,children:[(0,T.jsx)(d,{variant:`icon`,children:(0,T.jsx)(c,{})}),(0,T.jsxs)(f,{children:[(0,T.jsx)(p,{children:`No skills found`}),(0,T.jsx)(m,{children:`Add skills under ~/.agents/skills or workspace .agents/skills.`})]})]}):(0,T.jsxs)(T.Fragment,{children:[o?(0,T.jsx)(S,{value:n,onChange:r,placeholder:`Filter skills…`,resultCount:i.length,totalCount:e.length}):null,(0,T.jsx)(`div`,{className:`max-h-96 overflow-y-auto`,children:i.length===0?(0,T.jsxs)(`p`,{className:`px-4 py-6 text-center text-sm text-muted-foreground sm:px-5`,children:[`No skills match “`,n,`”`]}):s?Array.from(a.entries()).map(([e,n])=>(0,T.jsx)(y,{source:e,count:n.length,defaultOpen:!0,children:n.map(e=>(0,T.jsx)(E,{skill:e,onDelete:()=>t(e)},`${e.scope}|${e.path}`))},e)):i.map(e=>(0,T.jsx)(E,{skill:e,onDelete:()=>t(e)},`${e.source}|${e.scope}|${e.path}`))})]})})}function O(){let e=(0,C.c)(7),t=i(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={queryKey:b,queryFn:k,staleTime:5e3},e[0]=n):n=e[0];let a=r(n),s;e[1]===t?s=e[2]:(s=e=>{o().server.removeSkill({source:e.source,name:e.name,path:e.path}).then(()=>t.invalidateQueries({queryKey:b}))},e[1]=t,e[2]=s);let l=s,u;return e[3]!==l||e[4]!==a.data?.skills||e[5]!==a.isLoading?(u=(0,T.jsx)(g,{children:a.isLoading?(0,T.jsx)(_,{title:`Skills`,icon:(0,T.jsx)(c,{className:`size-3.5`}),children:(0,T.jsxs)(h,{className:`min-h-36`,children:[(0,T.jsx)(d,{variant:`icon`,children:(0,T.jsx)(c,{})}),(0,T.jsxs)(f,{children:[(0,T.jsx)(p,{children:`Loading skills`}),(0,T.jsx)(m,{children:`Checking ShioriCode, Codex, and Claude skill locations.`})]})]})}):(0,T.jsx)(D,{skills:a.data?.skills??[],onDelete:l})}),e[3]=l,e[4]=a.data?.skills,e[5]=a.isLoading,e[6]=u):u=e[6],u}function k(){return o().server.listSkills()}var A=O;export{A as component};
2
+ //# sourceMappingURL=settings.skills-DbcoPmK9.js.map