shioricode 0.5.1 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.mjs +1 -1
- package/dist/client/apple-touch-icon.png +0 -0
- package/dist/client/assets/{ArtifactPanel-1Tg5ZLm5.js → ArtifactPanel-BPQ8FX7l.js} +2 -2
- package/dist/client/assets/{ChatMarkdown-BvwoXC6z.js → ChatMarkdown-jcE8Pq97.js} +2 -2
- package/dist/client/assets/{DiffPanel-D-xp36wD.js → DiffPanel-CPmbtIC0.js} +3 -3
- package/dist/client/assets/{DiffPanelShell-DdBr4p9c.js → DiffPanelShell-CqS9jPrk.js} +2 -2
- package/dist/client/assets/{DiffWorkerPoolProvider--93ReMXi.js → DiffWorkerPoolProvider-CEnxoS9v.js} +2 -2
- package/dist/client/assets/{NoActiveThreadState-B_C5Y_aO.js → NoActiveThreadState-Bt_jFQ4-.js} +2 -2
- package/dist/client/assets/{ProviderModelPicker-BWTkQW8f.js → ProviderModelPicker-BRDu3BzU.js} +2 -2
- package/dist/client/assets/SettingsPanels-BX2dAbn4.js +4 -0
- package/dist/client/assets/{_chat-BhqvWJHj.js → _chat-C_aCgqFw.js} +2 -2
- package/dist/client/assets/_chat._threadId-DLIOcnXQ.js +289 -0
- package/dist/client/assets/{_chat.index-oZTnMcB3.js → _chat.index-B9u7xlCv.js} +2 -2
- package/dist/client/assets/automations-CJVFqqLv.js +2 -0
- package/dist/client/assets/{badge-BkzSFcY-.js → badge-iReKY3O4.js} +2 -2
- package/dist/client/assets/{clientSettings--1UP2ayD.js → clientSettings-DFgmWajw.js} +2 -2
- package/dist/client/assets/{collapsible-CqRg_DyH.js → collapsible-BEW6Xu4N.js} +2 -2
- package/dist/client/assets/{dialog-C7Ppq2qI.js → dialog-BwIZs3EF.js} +2 -2
- package/dist/client/assets/{gitReactQuery-BBOGuHot.js → gitReactQuery-BxToLb49.js} +2 -2
- package/dist/client/assets/{index-DvBh1mNh.js → index-DKZPXV4a.js} +5 -5
- package/dist/client/assets/{input-emuaAuIe.js → input-CthhcRBE.js} +2 -2
- package/dist/client/assets/pull-requests-CQHYo-fV.js +46 -0
- package/dist/client/assets/{queuedTurnsStore-I4LoXHLF.js → queuedTurnsStore-CYufNsaQ.js} +2 -2
- package/dist/client/assets/{scroll-area-kK2XF1gm.js → scroll-area-D6P_hAXV.js} +2 -2
- package/dist/client/assets/{separator-CSqq2xHm.js → separator-ByukCTaZ.js} +2 -2
- package/dist/client/assets/{settings-C9R1j3GG.js → settings-i7-rb7s9.js} +2 -2
- package/dist/client/assets/{settings.appearance-Cac_fbGk.js → settings.appearance-Dwkl1cOq.js} +2 -2
- package/dist/client/assets/settings.archived-DZPSjNZJ.js +2 -0
- package/dist/client/assets/{settings.computer-use-BL801Zu5.js → settings.computer-use-CLy6GP7W.js} +2 -2
- package/dist/client/assets/{settings.credits-Brx-cGXe.js → settings.credits-DiXAbJQa.js} +2 -2
- package/dist/client/assets/settings.general-CuNCor2d.js +2 -0
- package/dist/client/assets/{settings.mcp-DEMm4v5q.js → settings.mcp-DwWQDGSB.js} +2 -2
- package/dist/client/assets/{settings.mobile-DF1raoba.js → settings.mobile-B73fICiz.js} +2 -2
- package/dist/client/assets/{settings.plugins-CewrpoKP.js → settings.plugins-BjW05gj4.js} +2 -2
- package/dist/client/assets/{settings.remote-BufK_lG_.js → settings.remote-D_iWhzEN.js} +2 -2
- package/dist/client/assets/{settings.skills-Cz9xy1ba.js → settings.skills-BCB4uvnE.js} +2 -2
- package/dist/client/assets/{settings.theme-builder-BU_DRAvo.js → settings.theme-builder-CS2XB4es.js} +2 -2
- package/dist/client/assets/{skillsMcpShared-DxxY1mEt.js → skillsMcpShared-CiunLdEL.js} +2 -2
- package/dist/client/assets/{store-BQMb1nBV.js → store-LT9wKN7R.js} +3 -3
- package/dist/client/assets/{terminalStateStore-C38k-Eaw.js → terminalStateStore-B-V7Awi_.js} +2 -2
- package/dist/client/assets/{textarea-DXuuOfmM.js → textarea-DAzODx1v.js} +2 -2
- package/dist/client/assets/{toggle-group-CvAnsecf.js → toggle-group-CMWeXyeK.js} +2 -2
- package/dist/client/assets/{toggle-nUm5N7vp.js → toggle-uzFsauJb.js} +2 -2
- package/dist/client/assets/{uiStateStore-Di3ieZaJ.js → uiStateStore-CgvPrTF8.js} +2 -2
- package/dist/client/assets/{useHandleNewThread-WYMZPumx.js → useHandleNewThread-Chs2blac.js} +2 -2
- package/dist/client/assets/{useSettings-DOuHg9jg.js → useSettings-CaigvboL.js} +2 -2
- package/dist/client/assets/{useTheme-Dhz9U3on.js → useTheme-7QjQMsSZ.js} +2 -2
- package/dist/client/assets/{vendor-ui-DmvKhMzf.js → vendor-ui-Ds9VgrYb.js} +2 -2
- package/dist/client/favicon-16x16.png +0 -0
- package/dist/client/favicon-32x32.png +0 -0
- package/dist/client/favicon.ico +0 -0
- package/dist/client/index.html +12 -12
- package/package.json +5 -38
- package/dist/BunHttpServer-BvXfeDdm.cjs +0 -375
- package/dist/BunPTY-l5TwbZzE.cjs +0 -91
- package/dist/BunServices-07vLsX26.cjs +0 -74
- package/dist/NodeHttpServer-OQzpZjfj.cjs +0 -4142
- package/dist/NodePTY-BNeKL1sW.cjs +0 -86
- package/dist/NodeSqliteClient-K1HOOjni.cjs +0 -147
- package/dist/SqlError-UTW5yuSG.cjs +0 -262
- package/dist/SqliteClient-CVOnk2wf.cjs +0 -125
- package/dist/bin.cjs +0 -703456
- package/dist/client/assets/SettingsPanels-DGYlfoWv.js +0 -4
- package/dist/client/assets/_chat._threadId-Blwb3CRP.js +0 -289
- package/dist/client/assets/automations-ChGelqHO.js +0 -2
- package/dist/client/assets/pull-requests-xKFO2G81.js +0 -46
- package/dist/client/assets/settings.archived-KRU4XARw.js +0 -2
- package/dist/client/assets/settings.general-BXcV60tY.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-B6TeCrpE.js";import{t as n}from"./utils-B-Di8CjF.js";import{
|
|
2
|
-
//# sourceMappingURL=input-
|
|
1
|
+
import{t as e}from"./vendor-react-BvVnE5E6.js";import{c as t}from"./vendor--lexical-react-B6TeCrpE.js";import{t as n}from"./utils-B-Di8CjF.js";import{Tt as r}from"./vendor-ui-Ds9VgrYb.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-CthhcRBE.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-CM5SpFmF.js";import{c as l}from"./vendor--lexical-react-B6TeCrpE.js";import{P as u,h as d,l as f,s as p,u as m}from"./clientSettings-DFgmWajw.js";import"./vendor-effect-Chd9hYxF.js";import{V as h,c as g,t as _}from"./utils-B-Di8CjF.js";import{Ct as v,St as y,i as b,jt as x,ot as S,vt as C}from"./store-LT9wKN7R.js";import{t as w}from"./uiStateStore-CgvPrTF8.js";import{Cr as T,Hn as E,In as D,Jn as O,Nr as k,Pr as A,Tn as j,Vn as M,ar as N,dr as ee,ir as te,wn as P,zn as ne}from"./vendor-ui-Ds9VgrYb.js";import{L as re,a as ie,n as ae}from"./vendor-diffs-TCBcYN7E.js";import{a as oe,c as F,i as se,o as ce,r as le,s as ue}from"./gitReactQuery-BxToLb49.js";import"./input-CthhcRBE.js";import{t as de}from"./scroll-area-D6P_hAXV.js";import"./separator-ByukCTaZ.js";import{G as I,J as L,K as R,U as z,V as fe,X as B,Y as V,i as pe,q as H}from"./index-DKZPXV4a.js";import{a as me,i as he,l as ge,s as _e}from"./DiffPanelShell-CqS9jPrk.js";import{t as ve}from"./useTheme-7QjQMsSZ.js";import"./vendor--shikijs-core-BvuCEFk2.js";import"./vendor-hast-util-to-jsx-runtime-Cj_7lYX5.js";import"./vendor-hast-util-raw-DrJxi__t.js";import"./vendor-extend-BW3CRMi7.js";import"./vendor-katex-C_40Fys8.js";import{t as U}from"./ChatMarkdown-jcE8Pq97.js";import"./vendor--shikijs-engine-javascript-9nIWxzwA.js";import"./vendor-diff-BC6ceXD2.js";import{n as ye,r as be,t as xe}from"./toggle-group-CMWeXyeK.js";import"./toggle-uzFsauJb.js";import{t as Se}from"./badge-iReKY3O4.js";import{t as Ce}from"./DockedSidebarResizeHandle-C2HyIoOR.js";import{a as W,i as G,n as we,o as K,r as q,t as J}from"./empty-CwEqZDMX.js";import{n as Te,r as Ee,t as De}from"./collapsible-BEW6Xu4N.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=z(),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)(B,{side:`bottom`,showCloseButton:!1,keepMounted:!0,className:`h-[min(92dvh,900px)] w-full max-w-full p-0`,children:(0,Z.jsx)(Ye,{filter:r,projectId:a,number:o,onClose:s})}),t[10]=r,t[11]=o,t[12]=s,t[13]=a,t[14]=n):n=t[14];let c;return t[15]!==i||t[16]!==e||t[17]!==n?(c=(0,Z.jsx)(V,{open:i,onOpenChange:e,children:n}),t[15]=i,t[16]=e,t[17]=n,t[18]=c):c=t[18],c}let D;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(D=_(`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,O=a(le({cwd:w,filter:e})),k=(0,X.useMemo)(()=>O.data?O.data.pullRequests.find(e=>e.number===n)??null:null,[O.data,n]),A=a(ce({cwd:w,number:n})),M=A.data?.diff??``,P=(0,X.useMemo)(()=>{let e=M.trim();return e.length===0?null:_e(e,`pull-requests-panel:${u}`)},[M,u]),F=(0,X.useMemo)(()=>{let e=M.trim();if(e.length===0)return[];try{return re(e,P??void 0).flatMap(e=>e.files).toSorted((e,t)=>Ge(e).localeCompare(Ge(t),void 0,{numeric:!0,sensitivity:`base`}))}catch{return[]}},[P,M]),de=be({rootRef:f,enabled:!A.isLoading&&!A.isError&&F.length>0&&!!P,dependencyKey:`${P??`none`}:${A.isError?`error`:`ok`}:${A.isLoading?`loading`:`ready`}:${F.length}:${u}`}),I=a(ue({cwd:w,number:n,pullRequest:k})),R=a(oe({cwd:w,number:n})),[z,fe]=(0,X.useState)(`files`),B=I.data?.summary??null,V=i(se({cwd:w,queryClient:l})),pe=(0,X.useCallback)(()=>{if(!k)return;let e=d();e&&e.shell.openExternal(k.url).catch(e=>{console.warn(`Failed to open pull request in browser.`,e)})},[k]),H=(0,X.useCallback)(async()=>{if(!(!k||!w))try{let e=await V.mutateAsync({reference:String(k.number),mode:`worktree`});o({to:`/`,search:t=>({...t,branch:e.branch,worktreePath:e.worktreePath})})}catch(e){console.warn(`Failed to checkout pull request.`,e)}},[o,V,w,k]),Ce=(0,X.useCallback)(()=>{if(!k||!m)return;let e=B&&B.length>0?`\n\n**AI summary of changes:**\n${B}`:``,t=[`Please review pull request #${k.number}: **${k.title}**.`,``,`- URL: ${k.url}`,`- State: ${k.state}`,`- Base branch: \`${k.baseBranch}\``,`- Head branch: \`${k.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=S.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,k,B]),we=k?.state===`open`?`success`:k?.state===`merged`?`secondary`:`error`,Te=!A.isLoading&&!A.isError&&F.length>0&&!de;return(0,Z.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,Z.jsxs)(`header`,{children:[(0,Z.jsxs)(`div`,{className:`flex items-start gap-2.5 px-4 pt-3.5 pb-2.5`,children:[k?(0,Z.jsx)(`span`,{className:_(`mt-px flex size-8 shrink-0 items-center justify-center rounded-lg`,ke[Ae(k)]),"aria-hidden":!0,children:(0,Z.jsx)(N,{className:`size-4`})}):(0,Z.jsx)(L,{className:`mt-px size-8 shrink-0 rounded-lg`}),(0,Z.jsx)(`div`,{className:`min-w-0 flex-1`,children:k?(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:k.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:k.state}),k.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:[`#`,k.number]})]}),(0,Z.jsxs)(`div`,{className:`mt-1 flex min-w-0 items-center gap-1 text-[11px]`,children:[(0,Z.jsx)(ne,{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:k.headBranch}),(0,Z.jsx)(D,{className:`size-2.5 shrink-0 text-muted-foreground/40`,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`max-w-[45%] truncate font-mono text-muted-foreground/50`,children:k.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)(E,{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:!k||V.isPending,className:`gap-1.5 rounded-r-none`,onClick:()=>{H()},children:[(0,Z.jsx)(T,{className:`size-3.5`,"aria-hidden":!0}),V.isPending?`Checking out…`:`Checkout`]}),(0,Z.jsxs)(C,{children:[(0,Z.jsx)(x,{render:(0,Z.jsx)(p,{type:`button`,size:`xs`,"aria-label":`More checkout options`,disabled:!k||V.isPending,className:`-ml-px rounded-l-none border-l border-l-primary-foreground/20 px-1.5`}),children:(0,Z.jsx)(te,{className:`size-3.5`,"aria-hidden":!0})}),(0,Z.jsxs)(v,{align:`end`,side:`bottom`,children:[(0,Z.jsxs)(y,{onClick:()=>{H()},children:[(0,Z.jsx)(T,{className:`size-3.5`,"aria-hidden":!0}),`Checkout`]}),(0,Z.jsxs)(y,{onClick:pe,children:[(0,Z.jsx)(ee,{className:`size-3.5`,"aria-hidden":!0}),`Open in GitHub`]})]})]})]}),(0,Z.jsxs)(p,{type:`button`,size:`xs`,variant:`outline`,disabled:!k||!m,className:`gap-1.5`,onClick:Ce,children:[(0,Z.jsx)(j,{className:`size-3.5`,"aria-hidden":!0}),`Review`]})]}),(0,Z.jsx)(`div`,{className:`border-t border-border/60 px-4 py-3`,children:I.isLoading?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1.5`,"aria-label":`Loading pull request summary`,children:[(0,Z.jsx)(L,{className:`h-3 w-11/12 rounded-full`}),(0,Z.jsx)(L,{className:`h-3 w-10/12 rounded-full`}),(0,Z.jsx)(L,{className:`h-3 w-9/12 rounded-full`}),(0,Z.jsx)(L,{className:`h-3 w-8/12 rounded-full`})]}):I.isError?(0,Z.jsx)(`p`,{className:`text-pretty text-xs text-muted-foreground/80`,children:`Failed to summarize this pull request.`}):B&&B.length>0?(0,Z.jsx)(U,{text:B,cwd:w??void 0,className:`text-xs leading-relaxed text-muted-foreground`}):(0,Z.jsx)(`p`,{className:`text-pretty text-xs text-muted-foreground/60`,children:`No summary generated for this pull request.`})})]}),(0,Z.jsx)(`div`,{className:`my-2 flex h-9 shrink-0 items-center px-4`,children:(0,Z.jsxs)(ye,{value:[z],onValueChange:e=>{let t=e[0];(t===`files`||t===`conversation`)&&fe(t)},className:`h-7 gap-1`,children:[(0,Z.jsx)(xe,{value:`files`,className:`h-6 px-2 text-xs`,children:`Files`}),(0,Z.jsxs)(xe,{value:`conversation`,className:`h-6 gap-1 px-2 text-xs`,children:[`Conversation`,R.data?(()=>{let e=R.data.comments.length+R.data.reviews.length;return e>0?(0,Z.jsx)(`span`,{className:`ml-1 tabular-nums text-muted-foreground/60`,children:e}):null})():null]})]})}),z===`conversation`?(0,Z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:(0,Z.jsx)(tt,{query:R,projectCwd:w,pullRequestUrl:k?.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)(E,{})}),(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)(ie,{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)(ae,{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)(M,{className:`size-3.5`}),t[7]=c,t[8]=l);let u;return t[9]===l?u=t[10]:(u=(0,Z.jsx)(`div`,{className:`flex size-7 shrink-0 items-center justify-center rounded-full bg-muted text-[11px] font-medium text-muted-foreground`,"aria-hidden":!0,children:l}),t[9]=l,t[10]=u),u}function et(e){let t=(0,Y.c)(25),{author:n,createdAt:r,children:i,headerExtra:a,url:o}=e,s;t[0]===n?s=t[1]:(s=(0,Z.jsx)($e,{author:n}),t[0]=n,t[1]=s);let c=n??`Unknown user`,l;t[2]===c?l=t[3]:(l=(0,Z.jsx)(`span`,{className:`truncate font-medium text-foreground`,children:c}),t[2]=c,t[3]=l);let u;t[4]===a?u=t[5]:(u=a?(0,Z.jsx)(`span`,{className:`truncate`,children:a}):null,t[4]=a,t[5]=u);let d;t[6]===r?d=t[7]:(d=Ze(r),t[6]=r,t[7]=d);let f;t[8]===d?f=t[9]:(f=(0,Z.jsx)(`span`,{className:`ml-auto shrink-0 tabular-nums text-muted-foreground/70`,children:d}),t[8]=d,t[9]=f);let p;t[10]===o?p=t[11]:(p=o?(0,Z.jsx)(`a`,{href:o,target:`_blank`,rel:`noopener noreferrer`,className:`text-muted-foreground/70 transition-colors hover:text-foreground`,"aria-label":`Open on GitHub`,children:(0,Z.jsx)(ee,{className:`size-3`})}):null,t[10]=o,t[11]=p);let m;t[12]!==l||t[13]!==u||t[14]!==f||t[15]!==p?(m=(0,Z.jsxs)(`header`,{className:`flex items-center gap-2 border-b border-border/60 px-3 py-1.5 text-xs text-muted-foreground`,children:[l,u,f,p]}),t[12]=l,t[13]=u,t[14]=f,t[15]=p,t[16]=m):m=t[16];let h;t[17]===i?h=t[18]:(h=(0,Z.jsx)(`div`,{className:`px-3 py-2`,children:i}),t[17]=i,t[18]=h);let g;t[19]!==m||t[20]!==h?(g=(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1 rounded-lg border border-border/60 bg-card/60`,children:[m,h]}),t[19]=m,t[20]=h,t[21]=g):g=t[21];let _;return t[22]!==s||t[23]!==g?(_=(0,Z.jsxs)(`article`,{className:`flex gap-3 text-sm`,children:[s,g]}),t[22]=s,t[23]=g,t[24]=_):_=t[24],_}function tt(e){let t=(0,Y.c)(29),{query:n,projectCwd:r}=e;if(n.isLoading){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(`div`,{className:`flex h-full flex-col gap-3 overflow-hidden p-4`,children:[0,1,2].map(nt)}),t[0]=e):e=t[0],e}if(n.isError){let e,r;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(W,{variant:`icon`,children:(0,Z.jsx)(E,{})}),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=de,l=`h-full`,o=`flex flex-col gap-3 p-4`,t[14]!==i.description||t[15]!==i.descriptionAuthor||t[16]!==i.descriptionCreatedAt||t[17]!==r?(s=i.description.length>0?(0,Z.jsx)(et,{author:i.descriptionAuthor,createdAt:i.descriptionCreatedAt??``,headerExtra:`opened this pull request`,children:(0,Z.jsx)(U,{text:i.description,cwd:r??void 0,className:`text-xs leading-relaxed text-foreground/90`})}):null,t[14]=i.description,t[15]=i.descriptionAuthor,t[16]=i.descriptionCreatedAt,t[17]=r,t[18]=s):s=t[18];let n;t[19]===r?n=t[20]:(n=e=>e.kind===`comment`?(0,Z.jsx)(et,{author:e.data.author,createdAt:e.data.createdAt,headerExtra:`commented`,...e.data.url?{url:e.data.url}:{},children:(0,Z.jsx)(U,{text:e.data.body,cwd:r??void 0,className:`text-xs leading-relaxed text-foreground/90`})},e.id):(0,Z.jsx)(rt,{review:e.data,projectCwd:r},e.id),t[19]=r,t[20]=n),c=e.map(n)}t[5]=i,t[6]=r,t[7]=a,t[8]=o,t[9]=s,t[10]=c,t[11]=l,t[12]=u}else a=t[7],o=t[8],s=t[9],c=t[10],l=t[11],u=t[12];if(u!==Symbol.for(`react.early_return_sentinel`))return u;let d;t[21]!==o||t[22]!==s||t[23]!==c?(d=(0,Z.jsxs)(`div`,{className:o,children:[s,c]}),t[21]=o,t[22]=s,t[23]=c,t[24]=d):d=t[24];let f;return t[25]!==a||t[26]!==l||t[27]!==d?(f=(0,Z.jsx)(a,{className:l,children:d}),t[25]=a,t[26]=l,t[27]=d,t[28]=f):f=t[28],f}function nt(e){return(0,Z.jsxs)(`div`,{className:`flex gap-3`,children:[(0,Z.jsx)(L,{className:`size-7 rounded-full`}),(0,Z.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,Z.jsx)(L,{className:`h-3 w-36 rounded-full`}),(0,Z.jsx)(L,{className:`h-3 w-11/12 rounded-full`}),(0,Z.jsx)(L,{className:`h-3 w-9/12 rounded-full`})]})]},e)}function rt(e){let t=(0,Y.c)(21),{review:n,projectCwd:r}=e,i;t[0]===n.state?i=t[1]:(i=Qe(n.state),t[0]=n.state,t[1]=i);let{label:a,tone:o}=i,s=n.state===`approved`?k:n.state===`changes_requested`?P: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=>le({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)(N,{})}),(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)(I,{children:[(0,Z.jsx)(H,{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)(O,{className:`size-3.5`,"aria-hidden":!0})})}),(0,Z.jsx)(R,{children:`Refresh`})]})]})}),(0,Z.jsx)(de,{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)(te,{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)(L,{className:`h-3 w-5 rounded-full`}):null:(0,Z.jsx)(`span`,{className:`shrink-0 rounded-full bg-muted-foreground/10 px-1.5 text-[10px] font-semibold tabular-nums text-muted-foreground normal-case tracking-normal`,children:s})]}),(0,Z.jsx)(Te,{children:(0,Z.jsx)(at,{filter:e,projectId:i.id,state:a,visiblePullRequests:o,selectedProjectId:t,selectedNumber:n,onSelect:r})})]},i.id)}),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)(N,{})}),(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)(L,{className:`size-7 shrink-0 rounded-md`}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1.5`,children:[(0,Z.jsx)(L,{className:`h-3 w-[70%] rounded-full`}),(0,Z.jsx)(L,{className:`h-2.5 w-[40%] rounded-full`})]})]},e)}function st(e){let t=(0,Y.c)(34),{pullRequest:n,isActive:r,onSelect:i}=e,a=ke[Ae(n)],o=r||void 0,s=r&&`border-border/60 bg-sidebar-accent`,c;t[0]===s?c=t[1]:(c=_(`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)(N,{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)(D,{className:`size-2.5 shrink-0 text-muted-foreground/40`,"aria-hidden":!0}),t[19]=v):v=t[19];let y;t[20]===n.baseBranch?y=t[21]:(y=(0,Z.jsx)(`span`,{className:`max-w-[45%] truncate font-mono text-muted-foreground/50`,children:n.baseBranch}),t[20]=n.baseBranch,t[21]=y);let b;t[22]!==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)(N,{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)(N,{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)(fe,{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=pe.useSearch(),n;return e[0]===t?n=e[1]:(n=(0,Z.jsx)(ct,{search:t}),e[0]=t,e[1]=n),n}export{lt as component};
|
|
46
|
+
//# sourceMappingURL=pull-requests-CQHYo-fV.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Y as e}from"./vendor--effect-atom-react-6hEhKm5I.js";import{Q as t}from"./utils-B-Di8CjF.js";import{i as n,n as r,r as i}from"./vendor-zustand-qsUGoIcm.js";import{Xt as a,Yt as o,Zt as s}from"./store-
|
|
2
|
-
//# sourceMappingURL=queuedTurnsStore-
|
|
1
|
+
import{Y as e}from"./vendor--effect-atom-react-6hEhKm5I.js";import{Q as t}from"./utils-B-Di8CjF.js";import{i as n,n as r,r as i}from"./vendor-zustand-qsUGoIcm.js";import{Xt as a,Yt as o,Zt as s}from"./store-LT9wKN7R.js";var c=`shioricode:queued-turns:v1`,l=1,u=Object.freeze({queuedTurnsByThreadId:{}}),d=Object.freeze([]),f=o(typeof localStorage<`u`?localStorage:a(),300);s(`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-CYufNsaQ.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-B6TeCrpE.js";import{t as i}from"./utils-B-Di8CjF.js";import{Ct as a,St as o,
|
|
2
|
-
//# sourceMappingURL=scroll-area-
|
|
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-B6TeCrpE.js";import{t as i}from"./utils-B-Di8CjF.js";import{Ct as a,St as o,bt as s,wt as c,xt as l}from"./vendor-ui-Ds9VgrYb.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)(a,{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)(c,{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-D6P_hAXV.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as e}from"./vendor-react-BvVnE5E6.js";import{c as t}from"./vendor--lexical-react-B6TeCrpE.js";import{t as n}from"./utils-B-Di8CjF.js";import{
|
|
2
|
-
//# sourceMappingURL=separator-
|
|
1
|
+
import{t as e}from"./vendor-react-BvVnE5E6.js";import{c as t}from"./vendor--lexical-react-B6TeCrpE.js";import{t as n}from"./utils-B-Di8CjF.js";import{en as r}from"./vendor-ui-Ds9VgrYb.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-ByukCTaZ.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{w as r,y as i}from"./vendor-tanstack-CM5SpFmF.js";import{c as a}from"./vendor--lexical-react-B6TeCrpE.js";import{P as o,s}from"./clientSettings
|
|
2
|
-
//# sourceMappingURL=settings-
|
|
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-CM5SpFmF.js";import{c as a}from"./vendor--lexical-react-B6TeCrpE.js";import{P as o,s}from"./clientSettings-DFgmWajw.js";import"./vendor-effect-Chd9hYxF.js";import"./utils-B-Di8CjF.js";import"./store-LT9wKN7R.js";import"./terminalStateStore-B-V7Awi_.js";import"./uiStateStore-CgvPrTF8.js";import{sr as c}from"./vendor-ui-Ds9VgrYb.js";import"./useSettings-CaigvboL.js";import"./useHandleNewThread-Chs2blac.js";import"./gitReactQuery-BxToLb49.js";import"./input-CthhcRBE.js";import"./scroll-area-D6P_hAXV.js";import"./separator-ByukCTaZ.js";import{Q as l,V as u,Z as d}from"./index-DKZPXV4a.js";import"./ProviderModelPicker-BRDu3BzU.js";import"./empty-CwEqZDMX.js";import"./collapsible-BEW6Xu4N.js";import{d as f}from"./SettingsPanels-BX2dAbn4.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(d()))},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)(u,{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-i7-rb7s9.js.map
|
package/dist/client/assets/{settings.appearance-Cac_fbGk.js → settings.appearance-Dwkl1cOq.js}
RENAMED
|
@@ -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}from"./vendor-tanstack-CM5SpFmF.js";import{c as i}from"./vendor--lexical-react-B6TeCrpE.js";import{P as a,s as o}from"./clientSettings--1UP2ayD.js";import"./vendor-effect-Chd9hYxF.js";import{S as s,v as c,y as l}from"./utils-B-Di8CjF.js";import"./store-BQMb1nBV.js";import"./terminalStateStore-C38k-Eaw.js";import"./uiStateStore-Di3ieZaJ.js";import{Br as u,Nn as d,Un as ee}from"./vendor-ui-DmvKhMzf.js";import{n as te,r as ne}from"./useSettings-DOuHg9jg.js";import"./useHandleNewThread-WYMZPumx.js";import"./gitReactQuery-BBOGuHot.js";import{t as f}from"./input-emuaAuIe.js";import{G as p,K as m,h as re,it as h,q as g}from"./index-DvBh1mNh.js";import{i as ie,t as ae}from"./useTheme-Dhz9U3on.js";import{a as _,i as v,o as y,r as b,s as x}from"./ProviderModelPicker-BWTkQW8f.js";import"./empty-CwEqZDMX.js";import"./collapsible-CqRg_DyH.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-DGYlfoWv.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)(d,{className:`size-3`}),t[2]=s):s=t[2];let c;t[3]!==i||t[4]!==a?(c=(0,M.jsx)(g,{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)(m,{side:`top`,children:`Reset to default`}),t[6]=l):l=t[6];let u;return t[7]===c?u=t[8]:(u=(0,M.jsxs)(p,{children:[c,l]}),t[7]=c,t[8]=u),u}function I(){let{theme:e,setTheme:t,importedThemes:n,lightThemeId:i,darkThemeId:d,setThemeAssignment:p,importTheme:m,removeImportedTheme:g,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){h.add({type:`error`,title:`Could not import ${e.name}`,description:t instanceof Error?t.message:`The theme file is invalid JSON.`})}n.length>0&&h.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:d===`builtin:shioricode-dark`?null:(0,M.jsx)(F,{label:`dark theme`,onClick:()=>p(`dark`,c)}),control:(0,M.jsxs)(b,{value:d,onValueChange:e=>{e&&p(`dark`,e)},children:[(0,M.jsx)(y,{className:`w-full sm:w-52`,"aria-label":`Dark theme`,children:(0,M.jsx)(x,{children:A.dark.find(e=>e.id===d)?.name??`Shiori Dark`})}),(0,M.jsx)(_,{align:`end`,alignItemWithTrigger:!1,children:A.dark.map(e=>(0,M.jsx)(v,{hideIndicator:!0,value:e.id,children:e.name},e.id))})]})}),(0,M.jsxs)(T,{title:`Import themes`,description:`Import JSON theme files. Each file targets either the light or dark appearance and becomes the active theme for that appearance.`,control:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`input`,{ref:q,type:`file`,accept:`.json,application/json`,multiple:!0,className:`hidden`,onChange:le}),(0,M.jsx)(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`&&d===e.id?(0,M.jsx)(`span`,{className:`rounded-full bg-primary/12 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.12em] text-primary`,children:`Active`}):null]}),e.description?(0,M.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.description}):null,(0,M.jsx)(`p`,{className:`text-[11px] text-muted-foreground/80`,children:e.author?`By ${e.author}`:`Imported theme`})]}),(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,M.jsx)(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:()=>g(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)(u,{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-
|
|
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-CM5SpFmF.js";import{c as i}from"./vendor--lexical-react-B6TeCrpE.js";import{P as a,s as o}from"./clientSettings-DFgmWajw.js";import"./vendor-effect-Chd9hYxF.js";import{S as s,v as c,y as l}from"./utils-B-Di8CjF.js";import"./store-LT9wKN7R.js";import"./terminalStateStore-B-V7Awi_.js";import"./uiStateStore-CgvPrTF8.js";import{Hn as u,Mn as d,zr as ee}from"./vendor-ui-Ds9VgrYb.js";import{n as te,r as ne}from"./useSettings-CaigvboL.js";import"./useHandleNewThread-Chs2blac.js";import"./gitReactQuery-BxToLb49.js";import{t as f}from"./input-CthhcRBE.js";import{G as p,K as m,h as re,it as h,q as g}from"./index-DKZPXV4a.js";import{i as ie,t as ae}from"./useTheme-7QjQMsSZ.js";import{a as _,i as v,o as y,r as b,s as x}from"./ProviderModelPicker-BRDu3BzU.js";import"./empty-CwEqZDMX.js";import"./collapsible-BEW6Xu4N.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-BX2dAbn4.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)(d,{className:`size-3`}),t[2]=s):s=t[2];let c;t[3]!==i||t[4]!==a?(c=(0,M.jsx)(g,{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)(m,{side:`top`,children:`Reset to default`}),t[6]=l):l=t[6];let u;return t[7]===c?u=t[8]:(u=(0,M.jsxs)(p,{children:[c,l]}),t[7]=c,t[8]=u),u}function I(){let{theme:e,setTheme:t,importedThemes:n,lightThemeId:i,darkThemeId:d,setThemeAssignment:p,importTheme:m,removeImportedTheme:g,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){h.add({type:`error`,title:`Could not import ${e.name}`,description:t instanceof Error?t.message:`The theme file is invalid JSON.`})}n.length>0&&h.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:d===`builtin:shioricode-dark`?null:(0,M.jsx)(F,{label:`dark theme`,onClick:()=>p(`dark`,c)}),control:(0,M.jsxs)(b,{value:d,onValueChange:e=>{e&&p(`dark`,e)},children:[(0,M.jsx)(y,{className:`w-full sm:w-52`,"aria-label":`Dark theme`,children:(0,M.jsx)(x,{children:A.dark.find(e=>e.id===d)?.name??`Shiori Dark`})}),(0,M.jsx)(_,{align:`end`,alignItemWithTrigger:!1,children:A.dark.map(e=>(0,M.jsx)(v,{hideIndicator:!0,value:e.id,children:e.name},e.id))})]})}),(0,M.jsxs)(T,{title:`Import themes`,description:`Import JSON theme files. Each file targets either the light or dark appearance and becomes the active theme for that appearance.`,control:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`input`,{ref:q,type:`file`,accept:`.json,application/json`,multiple:!0,className:`hidden`,onChange:le}),(0,M.jsx)(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`&&d===e.id?(0,M.jsx)(`span`,{className:`rounded-full bg-primary/12 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.12em] text-primary`,children:`Active`}):null]}),e.description?(0,M.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.description}):null,(0,M.jsx)(`p`,{className:`text-[11px] text-muted-foreground/80`,children:e.author?`By ${e.author}`:`Imported theme`})]}),(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,M.jsx)(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:()=>g(e.id),children:(0,M.jsx)(u,{className:`size-3.5`})})]})]},e.id))}):(0,M.jsx)(`div`,{className:`mt-4 rounded-xl border border-dashed border-border/80 bg-background/40 px-3 py-4 text-xs text-muted-foreground`,children:`Imported themes will appear here after you add a JSON file.`}),(0,M.jsxs)(r,{to:`/settings/theme-builder`,className:`mt-3 inline-flex items-center gap-1.5 text-xs text-muted-foreground transition-colors hover:text-foreground`,children:[(0,M.jsx)(ee,{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-Dwkl1cOq.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-CM5SpFmF.js";import"./vendor--lexical-react-B6TeCrpE.js";import"./clientSettings-DFgmWajw.js";import"./vendor-effect-Chd9hYxF.js";import"./utils-B-Di8CjF.js";import"./store-LT9wKN7R.js";import"./terminalStateStore-B-V7Awi_.js";import"./uiStateStore-CgvPrTF8.js";import"./vendor-ui-Ds9VgrYb.js";import"./useSettings-CaigvboL.js";import"./useHandleNewThread-Chs2blac.js";import"./gitReactQuery-BxToLb49.js";import"./input-CthhcRBE.js";import"./ProviderModelPicker-BRDu3BzU.js";import"./empty-CwEqZDMX.js";import"./collapsible-BEW6Xu4N.js";import{t as e}from"./SettingsPanels-BX2dAbn4.js";var t=e;export{t as component};
|
|
2
|
+
//# sourceMappingURL=settings.archived-DZPSjNZJ.js.map
|
package/dist/client/assets/{settings.computer-use-BL801Zu5.js → settings.computer-use-CLy6GP7W.js}
RENAMED
|
@@ -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-CM5SpFmF.js";import{c as t}from"./vendor--lexical-react-B6TeCrpE.js";import{h as n}from"./clientSettings
|
|
2
|
-
//# sourceMappingURL=settings.computer-use-
|
|
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-CM5SpFmF.js";import{c as t}from"./vendor--lexical-react-B6TeCrpE.js";import{h as n}from"./clientSettings-DFgmWajw.js";import"./vendor-effect-Chd9hYxF.js";import"./utils-B-Di8CjF.js";import"./store-LT9wKN7R.js";import"./terminalStateStore-B-V7Awi_.js";import"./uiStateStore-CgvPrTF8.js";import{Or as r}from"./vendor-ui-Ds9VgrYb.js";import{n as i,r as a}from"./useSettings-CaigvboL.js";import"./useHandleNewThread-Chs2blac.js";import"./gitReactQuery-BxToLb49.js";import"./input-CthhcRBE.js";import"./ProviderModelPicker-BRDu3BzU.js";import"./empty-CwEqZDMX.js";import"./collapsible-BEW6Xu4N.js";import{a as o,o as s,p as c,s as l}from"./SettingsPanels-BX2dAbn4.js";var u=e(),d=t();function f(){let e=(0,u.c)(9),t=i(),{updateSettings:f}=a(),m;e[0]!==t.computerUse.enabled||e[1]!==f?(m=function(e){e!==t.computerUse.enabled&&(f({computerUse:{enabled:e}}),n()?.server.refreshProviders().catch(p))},e[0]=t.computerUse.enabled,e[1]=f,e[2]=m):m=e[2];let h=m,g;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,d.jsx)(r,{className:`size-3.5`}),e[3]=g):g=e[3];let _;e[4]===h?_=e[5]:(_=e=>h(!!e),e[4]=h,e[5]=_);let v;return e[6]!==t.computerUse.enabled||e[7]!==_?(v=(0,d.jsx)(o,{children:(0,d.jsx)(l,{title:`Computer Use`,icon:g,children:(0,d.jsx)(s,{title:`Enable Computer Use`,description:`Allow agents to see and control this Mac using screenshots, the pointer, keyboard, and scrolling.`,control:(0,d.jsx)(c,{checked:t.computerUse.enabled,onCheckedChange:_,"aria-label":`Enable Computer Use`})})})}),e[6]=t.computerUse.enabled,e[7]=_,e[8]=v):v=e[8],v}function p(e){console.warn(`[computer-use] failed to refresh providers after settings change`,e)}var m=f;export{m as component};
|
|
2
|
+
//# sourceMappingURL=settings.computer-use-CLy6GP7W.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-B6TeCrpE.js";import"./vendor-effect-Chd9hYxF.js";import"./utils-B-Di8CjF.js";import{
|
|
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-B6TeCrpE.js";import"./vendor-effect-Chd9hYxF.js";import"./utils-B-Di8CjF.js";import{ir as i}from"./vendor-ui-Ds9VgrYb.js";import{n as a,t as o}from"./collapsible-BEW6Xu4N.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-
|
|
30
|
+
//# sourceMappingURL=settings.credits-DiXAbJQa.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-CM5SpFmF.js";import"./vendor--lexical-react-B6TeCrpE.js";import"./clientSettings-DFgmWajw.js";import"./vendor-effect-Chd9hYxF.js";import"./utils-B-Di8CjF.js";import"./store-LT9wKN7R.js";import"./terminalStateStore-B-V7Awi_.js";import"./uiStateStore-CgvPrTF8.js";import"./vendor-ui-Ds9VgrYb.js";import"./useSettings-CaigvboL.js";import"./useHandleNewThread-Chs2blac.js";import"./gitReactQuery-BxToLb49.js";import"./input-CthhcRBE.js";import"./ProviderModelPicker-BRDu3BzU.js";import"./empty-CwEqZDMX.js";import"./collapsible-BEW6Xu4N.js";import{i as e}from"./SettingsPanels-BX2dAbn4.js";var t=e;export{t as component};
|
|
2
|
+
//# sourceMappingURL=settings.general-CuNCor2d.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}from"./vendor-tanstack-CM5SpFmF.js";import{c as i}from"./vendor--lexical-react-B6TeCrpE.js";import{f as a,s as o}from"./clientSettings--1UP2ayD.js";import"./vendor-effect-Chd9hYxF.js";import{rt as s,t as c}from"./utils-B-Di8CjF.js";import"./store-BQMb1nBV.js";import"./terminalStateStore-C38k-Eaw.js";import"./uiStateStore-Di3ieZaJ.js";import{Pn as l,Wn as u,Wr as d,fr as f,vr as p,wn as m}from"./vendor-ui-DmvKhMzf.js";import"./useSettings-DOuHg9jg.js";import"./useHandleNewThread-WYMZPumx.js";import"./gitReactQuery-BBOGuHot.js";import{t as h}from"./input-emuaAuIe.js";import"./scroll-area-kK2XF1gm.js";import{F as g,N as _,P as v,d as y,it as b}from"./index-DvBh1mNh.js";import{a as x,i as S,o as C,r as w,s as T}from"./ProviderModelPicker-BWTkQW8f.js";import{a as E,c as D,i as O,l as k,n as A,r as ee,s as te,t as ne}from"./dialog-C7Ppq2qI.js";import{t as re}from"./badge-BkzSFcY-.js";import{a as j,i as M,o as ie,r as N,t as ae}from"./empty-CwEqZDMX.js";import"./collapsible-CqRg_DyH.js";import{a as P,f as oe,o as F,p as I,s as L}from"./SettingsPanels-DGYlfoWv.js";import{a as se,i as R,o as z,r as B,s as V,t as H}from"./skillsMcpShared-DxxY1mEt.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)(re,{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,f;t[0]!==n.args||t[1]!==n.command||t[2]!==n.transport||t[3]!==n.url?(f=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]=f):f=t[4];let p=f,m=n.auth.status===`unauthenticated`,h=n.auth.message??`Authentication required`,g=n.auth.status===`authenticated`?`Authenticated`:null,_=m&&typeof a==`function`,v=u&&`pl-10 sm:pl-11`,y;t[5]===v?y=t[6]:(y=c(`flex items-center gap-3 border-t border-border/60 px-4 py-2.5 sm:px-5`,v),t[5]=v,t[6]=y);let b;t[7]===n?b=t[8]:(b=q(n),t[7]=n,t[8]=b);let x;t[9]===b?x=t[10]:(x=(0,G.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:b}),t[9]=b,t[10]=x);let S;t[11]!==h||t[12]!==m?(S=m?(0,G.jsx)(`span`,{title:h,children:(0,G.jsx)(d,{className:`size-3.5 shrink-0 text-amber-600`,"aria-label":h})}):null,t[11]=h,t[12]=m,t[13]=S):S=t[13];let C;t[14]===n.transport?C=t[15]:(C=(0,G.jsx)(Z,{transport:n.transport}),t[14]=n.transport,t[15]=C);let w;t[16]!==x||t[17]!==S||t[18]!==C?(w=(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[x,S,C]}),t[16]=x,t[17]=S,t[18]=C,t[19]=w):w=t[19];let T;t[20]===p?T=t[21]:(T=(0,G.jsx)(`p`,{className:`truncate font-mono text-[11px] text-muted-foreground`,children:p}),t[20]=p,t[21]=T);let E;t[22]!==w||t[23]!==T?(E=(0,G.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[w,T]}),t[22]=w,t[23]=T,t[24]=E):E=t[24];let D;t[25]!==g||t[26]!==h||t[27]!==s||t[28]!==a||t[29]!==_?(D=_?(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:h,children:s?`Authenticating…`:`Authenticate`}):g?(0,G.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:g}):null,t[25]=g,t[26]=h,t[27]=s,t[28]=a,t[29]=_,t[30]=D):D=t[30];let O;t[31]!==r||t[32]!==n.enabled||t[33]!==n.readOnly?(O=(0,G.jsx)(I,{checked:n.enabled,disabled:n.readOnly,onCheckedChange:r}),t[31]=r,t[32]=n.enabled,t[33]=n.readOnly,t[34]=O):O=t[34];let k;t[35]===i?k=t[36]:(k=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]=k);let A;t[37]!==D||t[38]!==O||t[39]!==k?(A=(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[D,O,k]}),t[37]=D,t[38]=O,t[39]=k,t[40]=A):A=t[40];let ee;return t[41]!==E||t[42]!==A||t[43]!==y?(ee=(0,G.jsxs)(`div`,{className:y,children:[E,A]}),t[41]=E,t[42]=A,t[43]=y,t[44]=ee):ee=t[44],ee}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,m]=(0,W.useState)(``),[g,_]=(0,W.useState)(``),v;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(v=[],t[0]=v):v=t[0];let[y,b]=(0,W.useState)(v),S;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(S=()=>{s(``),l(`stdio`),f(``),m(``),_(``),b([])},t[1]=S):S=t[1];let re=S,j=a.trim().length>0&&(c===`stdio`?p.trim().length>0:d.trim().length>0),M;t[2]!==g||t[3]!==p||t[4]!==j||t[5]!==a||t[6]!==n||t[7]!==y||t[8]!==c||t[9]!==d?(M=()=>{j&&(n({name:a.trim(),transport:c,enabled:!0,providers:y,...c===`stdio`?{command:p.trim(),...g.trim()?{args:g.trim().split(/\s+/)}:{}}:{url:d.trim()}}),re(),i(!1))},t[2]=g,t[3]=p,t[4]=j,t[5]=a,t[6]=n,t[7]=y,t[8]=c,t[9]=d,t[10]=M):M=t[10];let ie=M,N;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(N=e=>{b(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},t[11]=N):N=t[11];let ae=N,P;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,G.jsx)(k,{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]=P):P=t[12];let F;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,G.jsxs)(E,{children:[(0,G.jsx)(D,{children:`Add MCP Server`}),(0,G.jsx)(ee,{children:`Configure an MCP server to extend your coding agent with additional tools.`})]}),t[13]=F):F=t[13];let I;t[14]===ie?I=t[15]:(I=e=>{e.preventDefault(),ie()},t[14]=ie,t[15]=I);let L;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(L=(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]=L):L=t[16];let se;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(se=e=>s(e.target.value),t[17]=se):se=t[17];let R;t[18]===a?R=t[19]:(R=(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[L,(0,G.jsx)(h,{id:`mcp-server-name`,required:!0,autoComplete:`off`,placeholder:`e.g. GitHub, Filesystem`,value:a,onChange:se})]}),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)(C,{children:(0,G.jsx)(T,{})}),t[22]=V):V=t[22];let H;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,G.jsx)(x,{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)(w,{value:c,onValueChange:B,children:[V,H]})]}),t[24]=c,t[25]=K);let q;t[26]!==g||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)(h,{id:`mcp-server-command`,required:!0,autoComplete:`off`,placeholder:`e.g. npx, node, python`,value:p,onChange:e=>m(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)(h,{id:`mcp-server-args`,autoComplete:`off`,placeholder:`e.g. -y @modelcontextprotocol/server-github`,value:g,onChange:e=>_(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)(h,{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]=g,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]===y?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)(oe,{checked:y.includes(e.value),onCheckedChange:()=>ae(e.value)}),(0,G.jsx)(`span`,{className:`select-none`,children:e.label})]},e.value)),t[32]=y,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)(A,{render:(0,G.jsx)(o,{variant:`outline`,type:`button`,children:`Cancel`})}),t[41]=ce):ce=t[41];let de=!j,Q;t[42]===de?Q=t[43]:(Q=(0,G.jsxs)(O,{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]!==I?($=(0,G.jsxs)(te,{className:`sm:max-w-md`,children:[F,(0,G.jsxs)(`form`,{className:`contents`,onSubmit:I,children:[Z,Q]})]}),t[44]=Z,t[45]=Q,t[46]=I,t[47]=$):$=t[47];let pe;return t[48]!==r||t[49]!==$?(pe=(0,G.jsxs)(ne,{open:r,onOpenChange:i,children:[P,$]}),t[48]=r,t[49]=$,t[50]=pe):pe=t[50],pe}function fe(e){return(0,G.jsx)(S,{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)(m,{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)(L,{title:`Codex`,icon:n,children:(0,G.jsx)(F,{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)(f,{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)(m,{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)(L,{title:`Claude`,icon:n,children:(0,G.jsx)(F,{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)(f,{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,f]=(0,W.useState)(``),m=(0,W.useCallback)(t=>{if(t.readOnly)return-1;let n=K(t);return e.findIndex(e=>K(e)===n)},[e]),h=(0,W.useMemo)(()=>u?t.filter(e=>z(u,e.name,e.source,e.transport,e.url,e.command)):t,[t,u]),y=(0,W.useMemo)(()=>se(h),[h]),b=t.length>5,x=y.size>1,S=(e,t)=>{let n=m(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)(L,{title:`MCP Servers`,icon:(0,G.jsx)(p,{className:`size-3.5`}),headerAction:(0,G.jsx)(de,{onAdd:a}),children:[n.length>0?(0,G.jsx)(`div`,{className:`px-4 pb-0 pt-4 sm:px-5`,children:(0,G.jsxs)(_,{variant:`warning`,className:`rounded-2xl`,children:[(0,G.jsx)(d,{}),(0,G.jsx)(g,{children:`MCP needs attention`}),(0,G.jsx)(v,{children:n.map(e=>(0,G.jsx)(`p`,{children:e},e))})]})}):null,t.length===0?(0,G.jsxs)(ae,{className:`min-h-48`,children:[(0,G.jsx)(j,{variant:`icon`,children:(0,G.jsx)(p,{})}),(0,G.jsxs)(M,{children:[(0,G.jsx)(ie,{children:r?`Loading MCP servers`:`No MCP servers configured`}),(0,G.jsx)(N,{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:[b?(0,G.jsx)(B,{value:u,onChange:f,placeholder:`Filter MCP servers…`,resultCount:h.length,totalCount:t.length}):null,(0,G.jsx)(`div`,{className:`max-h-96 overflow-y-auto`,children:h.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,`”`]}):x?Array.from(y.entries()).map(([e,t])=>(0,G.jsx)(R,{source:e,count:t.length,defaultOpen:!0,children:t.map(e=>S(e,!0))},e)):h.map(e=>S(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]),m=(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]),h=(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}:{}}),b.add({type:`success`,title:`Authenticated ${q(e)}`})}catch(e){b.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)(P,{children:[(0,G.jsx)(_e,{servers:e,displayedServers:l,warnings:u,isLoading:s.isLoading,authenticatingServerKey:i,onAdd:d,onAuthenticate:h,onToggle:f,onDelete:p,onDeleteExternal:m}),(0,G.jsx)(Q,{}),(0,G.jsx)(me,{})]})}var ye=ve;export{ye as component};
|
|
2
|
-
//# sourceMappingURL=settings.mcp-
|
|
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-CM5SpFmF.js";import{c as i}from"./vendor--lexical-react-B6TeCrpE.js";import{f as a,s as o}from"./clientSettings-DFgmWajw.js";import"./vendor-effect-Chd9hYxF.js";import{rt as s,t as c}from"./utils-B-Di8CjF.js";import"./store-LT9wKN7R.js";import"./terminalStateStore-B-V7Awi_.js";import"./uiStateStore-CgvPrTF8.js";import{Cn as l,Nn as u,Un as d,Ur as f,_r as p,dr as m}from"./vendor-ui-Ds9VgrYb.js";import"./useSettings-CaigvboL.js";import"./useHandleNewThread-Chs2blac.js";import"./gitReactQuery-BxToLb49.js";import{t as h}from"./input-CthhcRBE.js";import"./scroll-area-D6P_hAXV.js";import{F as g,N as _,P as v,d as y,it as b}from"./index-DKZPXV4a.js";import{a as x,i as S,o as C,r as w,s as T}from"./ProviderModelPicker-BRDu3BzU.js";import{a as E,c as D,i as O,l as k,n as A,r as ee,s as te,t as ne}from"./dialog-BwIZs3EF.js";import{t as re}from"./badge-iReKY3O4.js";import{a as j,i as M,o as ie,r as N,t as ae}from"./empty-CwEqZDMX.js";import"./collapsible-BEW6Xu4N.js";import{a as P,f as oe,o as F,p as I,s as L}from"./SettingsPanels-BX2dAbn4.js";import{a as se,i as R,o as z,r as B,s as V,t as H}from"./skillsMcpShared-CiunLdEL.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)(re,{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:l}=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 p=d,m=n.auth.status===`unauthenticated`,h=n.auth.message??`Authentication required`,g=n.auth.status===`authenticated`?`Authenticated`:null,_=m&&typeof a==`function`,v=l&&`pl-10 sm:pl-11`,y;t[5]===v?y=t[6]:(y=c(`flex items-center gap-3 border-t border-border/60 px-4 py-2.5 sm:px-5`,v),t[5]=v,t[6]=y);let b;t[7]===n?b=t[8]:(b=q(n),t[7]=n,t[8]=b);let x;t[9]===b?x=t[10]:(x=(0,G.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:b}),t[9]=b,t[10]=x);let S;t[11]!==h||t[12]!==m?(S=m?(0,G.jsx)(`span`,{title:h,children:(0,G.jsx)(f,{className:`size-3.5 shrink-0 text-amber-600`,"aria-label":h})}):null,t[11]=h,t[12]=m,t[13]=S):S=t[13];let C;t[14]===n.transport?C=t[15]:(C=(0,G.jsx)(Z,{transport:n.transport}),t[14]=n.transport,t[15]=C);let w;t[16]!==x||t[17]!==S||t[18]!==C?(w=(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[x,S,C]}),t[16]=x,t[17]=S,t[18]=C,t[19]=w):w=t[19];let T;t[20]===p?T=t[21]:(T=(0,G.jsx)(`p`,{className:`truncate font-mono text-[11px] text-muted-foreground`,children:p}),t[20]=p,t[21]=T);let E;t[22]!==w||t[23]!==T?(E=(0,G.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[w,T]}),t[22]=w,t[23]=T,t[24]=E):E=t[24];let D;t[25]!==g||t[26]!==h||t[27]!==s||t[28]!==a||t[29]!==_?(D=_?(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:h,children:s?`Authenticating…`:`Authenticate`}):g?(0,G.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:g}):null,t[25]=g,t[26]=h,t[27]=s,t[28]=a,t[29]=_,t[30]=D):D=t[30];let O;t[31]!==r||t[32]!==n.enabled||t[33]!==n.readOnly?(O=(0,G.jsx)(I,{checked:n.enabled,disabled:n.readOnly,onCheckedChange:r}),t[31]=r,t[32]=n.enabled,t[33]=n.readOnly,t[34]=O):O=t[34];let k;t[35]===i?k=t[36]:(k=i?(0,G.jsx)(o,{size:`icon-xs`,variant:`ghost`,onClick:i,children:(0,G.jsx)(u,{className:`size-3.5 text-muted-foreground`})}):null,t[35]=i,t[36]=k);let A;t[37]!==D||t[38]!==O||t[39]!==k?(A=(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[D,O,k]}),t[37]=D,t[38]=O,t[39]=k,t[40]=A):A=t[40];let ee;return t[41]!==E||t[42]!==A||t[43]!==y?(ee=(0,G.jsxs)(`div`,{className:y,children:[E,A]}),t[41]=E,t[42]=A,t[43]=y,t[44]=ee):ee=t[44],ee}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`),[u,f]=(0,W.useState)(``),[p,m]=(0,W.useState)(``),[g,_]=(0,W.useState)(``),v;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(v=[],t[0]=v):v=t[0];let[y,b]=(0,W.useState)(v),S;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(S=()=>{s(``),l(`stdio`),f(``),m(``),_(``),b([])},t[1]=S):S=t[1];let re=S,j=a.trim().length>0&&(c===`stdio`?p.trim().length>0:u.trim().length>0),M;t[2]!==g||t[3]!==p||t[4]!==j||t[5]!==a||t[6]!==n||t[7]!==y||t[8]!==c||t[9]!==u?(M=()=>{j&&(n({name:a.trim(),transport:c,enabled:!0,providers:y,...c===`stdio`?{command:p.trim(),...g.trim()?{args:g.trim().split(/\s+/)}:{}}:{url:u.trim()}}),re(),i(!1))},t[2]=g,t[3]=p,t[4]=j,t[5]=a,t[6]=n,t[7]=y,t[8]=c,t[9]=u,t[10]=M):M=t[10];let ie=M,N;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(N=e=>{b(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},t[11]=N):N=t[11];let ae=N,P;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,G.jsx)(k,{render:(0,G.jsxs)(o,{size:`sm`,variant:`outline`,className:`gap-1.5`,children:[(0,G.jsx)(d,{className:`size-3.5`}),`Add Server`]})}),t[12]=P):P=t[12];let F;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,G.jsxs)(E,{children:[(0,G.jsx)(D,{children:`Add MCP Server`}),(0,G.jsx)(ee,{children:`Configure an MCP server to extend your coding agent with additional tools.`})]}),t[13]=F):F=t[13];let I;t[14]===ie?I=t[15]:(I=e=>{e.preventDefault(),ie()},t[14]=ie,t[15]=I);let L;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(L=(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]=L):L=t[16];let se;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(se=e=>s(e.target.value),t[17]=se):se=t[17];let R;t[18]===a?R=t[19]:(R=(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[L,(0,G.jsx)(h,{id:`mcp-server-name`,required:!0,autoComplete:`off`,placeholder:`e.g. GitHub, Filesystem`,value:a,onChange:se})]}),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)(C,{children:(0,G.jsx)(T,{})}),t[22]=V):V=t[22];let H;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,G.jsx)(x,{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)(w,{value:c,onValueChange:B,children:[V,H]})]}),t[24]=c,t[25]=K);let q;t[26]!==g||t[27]!==p||t[28]!==c||t[29]!==u?(q=c===`stdio`?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsxs)(`label`,{htmlFor:`mcp-server-command`,className:`text-sm font-medium`,children:[`Command `,(0,G.jsx)(`span`,{className:`text-destructive`,children:`*`})]}),(0,G.jsx)(h,{id:`mcp-server-command`,required:!0,autoComplete:`off`,placeholder:`e.g. npx, node, python`,value:p,onChange:e=>m(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)(h,{id:`mcp-server-args`,autoComplete:`off`,placeholder:`e.g. -y @modelcontextprotocol/server-github`,value:g,onChange:e=>_(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)(h,{id:`mcp-server-url`,required:!0,autoComplete:`url`,placeholder:`https://mcp.example.com/sse`,value:u,onChange:e=>f(e.target.value),className:`font-mono`})]}),t[26]=g,t[27]=p,t[28]=c,t[29]=u,t[30]=q):q=t[30];let J;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,G.jsxs)(`div`,{className:`text-sm font-medium`,children:[`Providers `,(0,G.jsx)(`span`,{className:`font-normal text-muted-foreground`,children:`(none = all)`})]}),t[31]=J):J=t[31];let Y;t[32]===y?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)(oe,{checked:y.includes(e.value),onCheckedChange:()=>ae(e.value)}),(0,G.jsx)(`span`,{className:`select-none`,children:e.label})]},e.value)),t[32]=y,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)(A,{render:(0,G.jsx)(o,{variant:`outline`,type:`button`,children:`Cancel`})}),t[41]=ce):ce=t[41];let de=!j,Q;t[42]===de?Q=t[43]:(Q=(0,G.jsxs)(O,{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]!==I?($=(0,G.jsxs)(te,{className:`sm:max-w-md`,children:[F,(0,G.jsxs)(`form`,{className:`contents`,onSubmit:I,children:[Z,Q]})]}),t[44]=Z,t[45]=Q,t[46]=I,t[47]=$):$=t[47];let pe;return t[48]!==r||t[49]!==$?(pe=(0,G.jsxs)(ne,{open:r,onOpenChange:i,children:[P,$]}),t[48]=r,t[49]=$,t[50]=pe):pe=t[50],pe}function fe(e){return(0,G.jsx)(S,{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)(l,{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)(L,{title:`Codex`,icon:n,children:(0,G.jsx)(F,{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)(m,{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)(l,{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)(L,{title:`Claude`,icon:n,children:(0,G.jsx)(F,{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)(m,{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)(``),m=(0,W.useCallback)(t=>{if(t.readOnly)return-1;let n=K(t);return e.findIndex(e=>K(e)===n)},[e]),h=(0,W.useMemo)(()=>u?t.filter(e=>z(u,e.name,e.source,e.transport,e.url,e.command)):t,[t,u]),y=(0,W.useMemo)(()=>se(h),[h]),b=t.length>5,x=y.size>1,S=(e,t)=>{let n=m(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)(L,{title:`MCP Servers`,icon:(0,G.jsx)(p,{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)(f,{}),(0,G.jsx)(g,{children:`MCP needs attention`}),(0,G.jsx)(v,{children:n.map(e=>(0,G.jsx)(`p`,{children:e},e))})]})}):null,t.length===0?(0,G.jsxs)(ae,{className:`min-h-48`,children:[(0,G.jsx)(j,{variant:`icon`,children:(0,G.jsx)(p,{})}),(0,G.jsxs)(M,{children:[(0,G.jsx)(ie,{children:r?`Loading MCP servers`:`No MCP servers configured`}),(0,G.jsx)(N,{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:[b?(0,G.jsx)(B,{value:u,onChange:d,placeholder:`Filter MCP servers…`,resultCount:h.length,totalCount:t.length}):null,(0,G.jsx)(`div`,{className:`max-h-96 overflow-y-auto`,children:h.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,`”`]}):x?Array.from(y.entries()).map(([e,t])=>(0,G.jsx)(R,{source:e,count:t.length,defaultOpen:!0,children:t.map(e=>S(e,!0))},e)):h.map(e=>S(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]),m=(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]),h=(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}:{}}),b.add({type:`success`,title:`Authenticated ${q(e)}`})}catch(e){b.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)(P,{children:[(0,G.jsx)(_e,{servers:e,displayedServers:l,warnings:u,isLoading:s.isLoading,authenticatingServerKey:i,onAdd:d,onAuthenticate:h,onToggle:f,onDelete:p,onDeleteExternal:m}),(0,G.jsx)(Q,{}),(0,G.jsx)(me,{})]})}var ye=ve;export{ye as component};
|
|
2
|
+
//# sourceMappingURL=settings.mcp-DwWQDGSB.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-CM5SpFmF.js";import{c as r}from"./vendor--lexical-react-B6TeCrpE.js";import{s as i}from"./clientSettings
|
|
2
|
-
//# sourceMappingURL=settings.mobile-
|
|
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-CM5SpFmF.js";import{c as r}from"./vendor--lexical-react-B6TeCrpE.js";import{s as i}from"./clientSettings-DFgmWajw.js";import"./vendor-effect-Chd9hYxF.js";import{d as a,t as o}from"./utils-B-Di8CjF.js";import"./store-LT9wKN7R.js";import"./terminalStateStore-B-V7Awi_.js";import"./uiStateStore-CgvPrTF8.js";import{Br as s,Jn as c,Mr as l,Pn as u,Qn as d,kn as f,kr as p}from"./vendor-ui-Ds9VgrYb.js";import"./useSettings-CaigvboL.js";import"./useHandleNewThread-Chs2blac.js";import"./gitReactQuery-BxToLb49.js";import"./input-CthhcRBE.js";import{F as m,N as h,P as g,jt as _}from"./index-DKZPXV4a.js";import"./ProviderModelPicker-BRDu3BzU.js";import"./empty-CwEqZDMX.js";import"./collapsible-BEW6Xu4N.js";import{a as v,o as y,s as b}from"./SettingsPanels-BX2dAbn4.js";import{t as x}from"./vendor-qrcode-generator-BI2MWdJH.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=_(),[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)(s,{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)(f,{className:`size-3.5 animate-spin`}):(0,w.jsx)(c,{className:`size-3.5`}),`New code`]})]}),children:e?(0,w.jsx)(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)(f,{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)(u,{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)(h,{variant:`success`,children:[(0,w.jsx)(l,{}),(0,w.jsx)(m,{children:`Paired`}),(0,w.jsxs)(g,{children:[r.pairedDeviceName??`Your iPhone`,` is connected to this desktop.`]})]}):L?(0,w.jsxs)(h,{variant:`warning`,children:[(0,w.jsx)(u,{}),(0,w.jsx)(m,{children:`Code expired`}),(0,w.jsx)(g,{children:`This code is no longer valid. Generate a new one to finish pairing.`})]}):(0,w.jsxs)(h,{variant:`info`,children:[(0,w.jsx)(s,{}),(0,w.jsx)(m,{children:`Waiting for scan`}),(0,w.jsx)(g,{children:`The code is single-use and short-lived.`})]}),M?(0,w.jsxs)(h,{variant:`error`,children:[(0,w.jsx)(m,{children:`Pairing unavailable`}),(0,w.jsx)(g,{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)(p,{className:`size-3.5`}),P?`Copied`:`Copy pairing payload`]})})]})]})})}):(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)(d,{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-B73fICiz.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-CM5SpFmF.js";import{c as t}from"./vendor--lexical-react-B6TeCrpE.js";import{f as n,s as r}from"./clientSettings
|
|
2
|
-
//# sourceMappingURL=settings.plugins-
|
|
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-CM5SpFmF.js";import{c as t}from"./vendor--lexical-react-B6TeCrpE.js";import{f as n,s as r}from"./clientSettings-DFgmWajw.js";import"./vendor-effect-Chd9hYxF.js";import"./utils-B-Di8CjF.js";import"./store-LT9wKN7R.js";import"./terminalStateStore-B-V7Awi_.js";import"./uiStateStore-CgvPrTF8.js";import{Nn as i,Tn as a,Un as o,dr as s,gr as c,pr as l,vn as u}from"./vendor-ui-Ds9VgrYb.js";import"./useSettings-CaigvboL.js";import"./useHandleNewThread-Chs2blac.js";import"./gitReactQuery-BxToLb49.js";import"./input-CthhcRBE.js";import{it as d}from"./index-DKZPXV4a.js";import"./ProviderModelPicker-BRDu3BzU.js";import{t as f}from"./badge-iReKY3O4.js";import"./empty-CwEqZDMX.js";import"./collapsible-BEW6Xu4N.js";import{a as p,p as m,s as h}from"./SettingsPanels-BX2dAbn4.js";import{s as g}from"./skillsMcpShared-CiunLdEL.js";import{a as _,i as v,n as y,r as b,t as x}from"./vendor-react-icons-DMjx4moa.js";var S=e(),C={github:x,notion:y,stripe:b,vercel:_,context7:v,filesystem:c,playwright:l,"sequential-thinking":a};function w(e){return C[e]??u}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:a,onToggle:c,onUninstall:l}=e,d=I,p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,P.jsx)(u,{className:`size-3.5`}),t[0]=p):p=t[0];let g;t[1]!==a||t[2]!==c||t[3]!==l||t[4]!==n?(g=E.map(e=>{let t=k(n,e.id),u=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:u?`default`:`outline`,className:`text-[10px]`,children:u?`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)(s,{className:`size-3.5 text-muted-foreground`})}):null,t?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(m,{checked:u,onCheckedChange:t=>c(e.id,t)}),(0,P.jsx)(r,{size:`icon-xs`,variant:`ghost`,"aria-label":`Uninstall ${e.name} connector`,onClick:()=>l(e.id),children:(0,P.jsx)(i,{className:`size-3.5 text-muted-foreground`})})]}):(0,P.jsxs)(r,{size:`sm`,variant:`outline`,className:`gap-1.5`,onClick:()=>a(e.id),children:[(0,P.jsx)(o,{className:`size-3.5`}),`Install`]})]})]},e.id)}),t[1]=a,t[2]=c,t[3]=l,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-BjW05gj4.js.map
|