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,4 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{Ci as t,si as n}from"./vendor--effect-atom-react-6hEhKm5I.js";import{t as r}from"./vendor-react-BvVnE5E6.js";import{C as i,m as a}from"./vendor-tanstack-CM5SpFmF.js";import{c as o}from"./vendor--lexical-react-B6TeCrpE.js";import{C as s,D as c,O as l,P as u,f as d,h as f,s as p}from"./clientSettings--1UP2ayD.js";import{C as m,S as h,_ as g,h as _,rt as v,t as y,u as b,w as x,x as S}from"./utils-B-Di8CjF.js";import{$ as C,G as w,J as T,W as E,Y as D,i as O}from"./store-BQMb1nBV.js";import{Cn as k,Nn as A,Pn as j,Un as M,Ur as N,Yn as P,_r as F,ar as I,i as L,n as ee,r as te,t as ne}from"./vendor-ui-DmvKhMzf.js";import{n as re,r as ie}from"./useSettings-DOuHg9jg.js";import{t as ae}from"./input-emuaAuIe.js";import{$ as R,B as oe,G as se,I as z,K as ce,L as le,Mt as B,Nt as ue,O as V,R as H,et as de,f as fe,h as pe,it as U,k as me,q as W,rt as he,z as ge}from"./index-DvBh1mNh.js";import{t as _e}from"./assistantPersonalityOptions-35I7ygr6.js";import{a as ve,i as ye,n as be,o as xe,r as Se,s as Ce}from"./ProviderModelPicker-BWTkQW8f.js";import{a as G,i as K,o as we,r as Te,t as Ee}from"./empty-CwEqZDMX.js";import{n as De,t as Oe}from"./collapsible-CqRg_DyH.js";var q=r(),J=o();function Y(e){let t=(0,q.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=y(`inline-flex h-[calc(var(--thumb-size)+2px)] w-[calc(var(--thumb-size)*2-2px)] shrink-0 cursor-pointer items-center rounded-full p-px outline-none transition-[background-color,box-shadow] duration-200 [--thumb-size:--spacing(5)] focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background data-checked:bg-primary data-unchecked:bg-input data-disabled:cursor-not-allowed data-disabled:opacity-64 sm:[--thumb-size:--spacing(4)]`,n),t[3]=n,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,J.jsx)(te,{className:y(`pointer-events-none block aspect-square h-full origin-left in-[[role=switch]:active,[data-slot=label]:active,[data-slot=field-label]:active]:not-data-disabled:scale-x-110 in-[[role=switch]:active,[data-slot=label]:active,[data-slot=field-label]:active]:rounded-[var(--thumb-size)/calc(var(--thumb-size)*1.1)] rounded-(--thumb-size) bg-background shadow-sm/5 will-change-transform [transition:translate_.15s,border-radius_.15s,scale_.1s_.1s,transform-origin_.15s] data-checked:origin-[var(--thumb-size)_50%] data-checked:translate-x-[calc(var(--thumb-size)-4px)]`),"data-slot":`switch-thumb`}),t[5]=a):a=t[5];let o;return t[6]!==r||t[7]!==i?(o=(0,J.jsx)(L,{className:i,"data-slot":`switch`,...r,children:a}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o}function ke(e){let t=(0,q.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=y(`relative inline-flex size-4.5 shrink-0 items-center justify-center rounded-[.25rem] border border-input bg-background not-dark:bg-clip-padding shadow-xs/5 outline-none ring-ring transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[3px] not-data-disabled:not-data-checked:not-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-offset-background aria-invalid:border-destructive/36 focus-visible:aria-invalid:border-destructive/64 focus-visible:aria-invalid:ring-destructive/48 data-disabled:opacity-64 sm:size-4 dark:not-data-checked:bg-input/32 dark:aria-invalid:ring-destructive/24 dark:not-data-disabled:not-data-checked:not-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)] [[data-disabled],[data-checked],[aria-invalid]]:shadow-none`,n),t[3]=n,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,J.jsx)(ne,{className:`-inset-px absolute flex items-center justify-center rounded-[.25rem] text-primary-foreground data-unchecked:hidden data-checked:bg-primary data-indeterminate:text-foreground`,"data-slot":`checkbox-indicator`,render:Ae}),t[5]=a):a=t[5];let o;return t[6]!==r||t[7]!==i?(o=(0,J.jsx)(ee,{className:i,"data-slot":`checkbox`,...r,children:a}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o}function Ae(e,t){return(0,J.jsx)(`span`,{...e,children:t.indeterminate?(0,J.jsx)(`svg`,{className:`size-3.5 sm:size-3`,fill:`none`,height:`24`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`3`,viewBox:`0 0 24 24`,width:`24`,xmlns:`http://www.w3.org/2000/svg`,children:(0,J.jsx)(`path`,{d:`M5.252 12h13.496`})}):(0,J.jsx)(`svg`,{className:`size-3.5 sm:size-3`,fill:`none`,height:`24`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`3`,viewBox:`0 0 24 24`,width:`24`,xmlns:`http://www.w3.org/2000/svg`,children:(0,J.jsx)(`path`,{d:`M5.252 12.7 10.2 18.63 18.748 5.37`})})})}var X=e(t(),1),je=new Set;function Me(e){let t=(0,q.c)(17),{cwd:n,className:r}=e,i;t[0]===n?i=t[1]:(i=b(`/api/project-favicon`,{cwd:n}),t[0]=n,t[1]=i);let a=i,o;t[2]===a?o=t[3]:(o=()=>je.has(a)?`loaded`:`loading`,t[2]=a,t[3]=o);let[s,c]=(0,X.useState)(o),l;t[4]!==r||t[5]!==s?(l=s===`loaded`?null:(0,J.jsx)(F,{className:`size-3.5 shrink-0 text-muted-foreground/50 ${r??``}`}),t[4]=r,t[5]=s,t[6]=l):l=t[6];let u=`size-3.5 shrink-0 rounded-sm object-contain ${s===`loaded`?``:`hidden`} ${r??``}`,d;t[7]===a?d=t[8]:(d=()=>{je.add(a),c(`loaded`)},t[7]=a,t[8]=d);let f;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(f=()=>c(`error`),t[9]=f):f=t[9];let p;t[10]!==a||t[11]!==u||t[12]!==d?(p=(0,J.jsx)(`img`,{src:a,alt:``,className:u,onLoad:d,onError:f}),t[10]=a,t[11]=u,t[12]=d,t[13]=p):p=t[13];let m;return t[14]!==l||t[15]!==p?(m=(0,J.jsxs)(J.Fragment,{children:[l,p]}),t[14]=l,t[15]=p,t[16]=m):m=t[16],m}var Ne={locale:`System default`,"12-hour":`12-hour`,"24-hour":`24-hour`},Pe={value:S,label:`System Sans`},Fe={value:g,label:`System Monospace`};function Ie(e,t,n){let r=[n,...e.map(e=>({value:e,label:e}))];return t!==n.value&&!r.some(e=>e.value===t)&&r.push({value:t,label:t}),r}function Le(e,t){let n=t.trim().toLocaleLowerCase();return n.length===0?[...e]:e.filter(e=>e.label.toLocaleLowerCase().includes(n))}var Re={kimiCode:{provider:`kimiCode`,title:`Kimi Code`,textFields:[{key:`binaryPath`,label:`Kimi binary path`,placeholder:`kimi`,description:`Path to the Kimi Code binary.`},{key:`shareDir`,label:`Kimi share directory`,placeholder:`Kimi share directory`,description:`Optional directory for Kimi Code shared runtime files.`}]},gemini:{provider:`gemini`,title:`Antigravity`,textFields:[{key:`binaryPath`,label:`Antigravity harness path`,placeholder:`localharness`,description:`Optional path to the Antigravity localharness runtime.`},{key:`googleCloudProject`,label:`Google Cloud project`,placeholder:`GOOGLE_CLOUD_PROJECT`,description:`Optional Vertex AI project used by the Antigravity SDK.`}]},glm:{provider:`glm`,title:`GLM`,textFields:[{key:`binaryPath`,label:`Claude Code binary path`,placeholder:`claude`,description:`Path to Claude Code used for GLM Coding Plan.`},{key:`apiBaseUrl`,label:`Anthropic API base URL`,placeholder:m,description:`Z.AI's Anthropic-compatible GLM Coding Plan endpoint.`},{key:`apiKey`,label:`API key`,placeholder:`zai-...`,inputType:`password`,description:`Your Z.AI GLM Coding Plan API key. Kept in local ShioriCode settings.`},{key:`apiKeyEnvVar`,label:`API key env var`,placeholder:x,description:`Optional fallback environment variable when the API key field is empty.`}]},cursor:{provider:`cursor`,title:`Cursor`,textFields:[{key:`binaryPath`,label:`Cursor agent binary path`,placeholder:`agent`,description:`Path to the Cursor agent binary.`},{key:`apiEndpoint`,label:`API endpoint`,placeholder:`Cursor API endpoint`,description:"Optional endpoint passed to `agent -e`."}]},codex:{provider:`codex`,title:`Codex`,textFields:[{key:`binaryPath`,label:`Codex binary path`,placeholder:`codex`,description:`Path to the Codex binary.`}],homePathKey:`codexHomePath`,homePlaceholder:`CODEX_HOME`,homeDescription:`Optional custom Codex home and config directory.`},claudeAgent:{provider:`claudeAgent`,title:`Claude`,textFields:[{key:`binaryPath`,label:`Claude binary path`,placeholder:`claude`,description:`Path to the Claude binary.`}]}},ze=Object.values(Re),Be={disabled:{dot:`bg-amber-400`},error:{dot:`bg-destructive`},ready:{dot:`bg-success`},warning:{dot:`bg-warning`}};function Ve(e,t){if(!e&&!t)return{headline:`Disabled`,detail:`This provider is disabled in ShioriCode settings.`};if(!e)return{headline:`Checking provider status`,detail:`Waiting for the server to report installation and authentication details.`};if(!e.enabled)return{headline:`Disabled`,detail:e.message??`This provider is installed but disabled for new sessions in ShioriCode.`};if(!e.installed)return{headline:`Not found`,detail:e.message??`CLI not detected on PATH.`};if(e.auth.status===`authenticated`){let t=e.auth.label??e.auth.type;return{headline:t?`Authenticated · ${t}`:`Authenticated`,detail:e.message??null}}return e.auth.status===`unauthenticated`?{headline:`Not authenticated`,detail:e.message??null}:e.status===`warning`?{headline:`Needs attention`,detail:e.message??`The provider is installed, but the server could not fully verify it.`}:e.status===`error`?{headline:`Unavailable`,detail:e.message??`The provider failed its startup checks.`}:{headline:`Available`,detail:e.message??`Installed and ready, but authentication could not be verified.`}}function He(e){return e?e.startsWith(`v`)?e:`v${e}`:null}function Ue(e,t,n){switch(t){case`kimiCode`:return n===`binaryPath`?e.kimiCode.binaryPath:n===`shareDir`?e.kimiCode.shareDir:null;case`gemini`:return n===`binaryPath`?e.gemini.binaryPath:n===`googleCloudProject`?e.gemini.googleCloudProject:null;case`glm`:return n===`binaryPath`?e.glm.binaryPath:n===`apiBaseUrl`?e.glm.apiBaseUrl:n===`apiKey`?e.glm.apiKey:n===`apiKeyEnvVar`?e.glm.apiKeyEnvVar:null;case`cursor`:return n===`binaryPath`?e.cursor.binaryPath:n===`apiEndpoint`?e.cursor.apiEndpoint:null;case`codex`:return n===`binaryPath`?e.codex.binaryPath:null;case`claudeAgent`:return n===`binaryPath`?e.claudeAgent.binaryPath:null}}function We(e,t,n,r){switch(t){case`kimiCode`:return n===`binaryPath`?{...e,kimiCode:{...e.kimiCode,binaryPath:r}}:n===`shareDir`?{...e,kimiCode:{...e.kimiCode,shareDir:r}}:e;case`gemini`:return n===`binaryPath`?{...e,gemini:{...e.gemini,binaryPath:r}}:n===`googleCloudProject`?{...e,gemini:{...e.gemini,googleCloudProject:r}}:e;case`glm`:return n===`binaryPath`?{...e,glm:{...e.glm,binaryPath:r}}:n===`apiBaseUrl`?{...e,glm:{...e.glm,apiBaseUrl:r}}:n===`apiKey`?{...e,glm:{...e.glm,apiKey:r}}:n===`apiKeyEnvVar`?{...e,glm:{...e.glm,apiKeyEnvVar:r}}:e;case`cursor`:return n===`binaryPath`?{...e,cursor:{...e.cursor,binaryPath:r}}:n===`apiEndpoint`?{...e,cursor:{...e.cursor,apiEndpoint:r}}:e;case`codex`:return n===`binaryPath`?{...e,codex:{...e.codex,binaryPath:r}}:e;case`claudeAgent`:return n===`binaryPath`?{...e,claudeAgent:{...e.claudeAgent,binaryPath:r}}:e}}function Ge(e,t,n){let r=[];for(let i of n??[]){let n=Ue(e,t,i.key);n!==null&&r.push({key:i.key,label:i.label,placeholder:i.placeholder,description:i.description,value:n})}return r}function Ke(e){let t=(0,q.c)(3),n=e===void 0?1e3:e,[r,i]=(0,X.useState)(qe),a,o;return t[0]===n?(a=t[1],o=t[2]):(a=()=>{let e=setInterval(()=>i(Date.now()),n);return()=>clearInterval(e)},o=[n],t[0]=n,t[1]=a,t[2]=o),(0,X.useEffect)(a,o),r}function qe(){return Date.now()}function Je(e){let t=(0,q.c)(5),{lastCheckedAt:n}=e;Ke();let r;t[0]===n?r=t[1]:(r=n?R(n):null,t[0]=n,t[1]=r);let i=r;if(!i)return null;let a;return t[2]!==i.suffix||t[3]!==i.value?(a=(0,J.jsx)(`span`,{className:`text-[11px] text-muted-foreground/60`,children:i.suffix?(0,J.jsxs)(J.Fragment,{children:[`Checked `,(0,J.jsx)(`span`,{className:`font-mono tabular-nums`,children:i.value}),` `,i.suffix]}):(0,J.jsxs)(J.Fragment,{children:[`Checked `,i.value]})}),t[2]=i.suffix,t[3]=i.value,t[4]=a):a=t[4],a}function Z(e){let t=(0,q.c)(15),{title:n,icon:r,headerAction:i,children:a}=e,o;t[0]===n?o=t[1]:(o=(0,J.jsx)(`span`,{className:`truncate`,children:n}),t[0]=n,t[1]=o);let s;t[2]!==r||t[3]!==o?(s=(0,J.jsxs)(`h2`,{className:`flex min-w-0 items-center gap-1.5 text-[11px] font-medium text-muted-foreground`,children:[r,o]}),t[2]=r,t[3]=o,t[4]=s):s=t[4];let c;t[5]===i?c=t[6]:(c=i?(0,J.jsx)(`div`,{className:`shrink-0`,children:i}):null,t[5]=i,t[6]=c);let l;t[7]!==s||t[8]!==c?(l=(0,J.jsxs)(`div`,{className:`flex min-h-7 items-center justify-between gap-3`,children:[s,c]}),t[7]=s,t[8]=c,t[9]=l):l=t[9];let u;t[10]===a?u=t[11]:(u=(0,J.jsx)(`div`,{className:`relative overflow-hidden rounded-lg 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-lg)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] dark:before:shadow-[0_-1px_--theme(--color-white/6%)]`,children:a}),t[10]=a,t[11]=u);let d;return t[12]!==l||t[13]!==u?(d=(0,J.jsxs)(`section`,{className:`space-y-2.5`,children:[l,u]}),t[12]=l,t[13]=u,t[14]=d):d=t[14],d}function Q(e){let t=(0,q.c)(25),{title:n,description:r,status:i,resetAction:a,control:o,children:s}=e,c;t[0]===n?c=t[1]:(c=(0,J.jsx)(`h3`,{className:`min-w-0 text-sm font-medium text-foreground`,children:n}),t[0]=n,t[1]=c);let l;t[2]===a?l=t[3]:(l=(0,J.jsx)(`span`,{className:`inline-flex h-5 w-5 shrink-0 items-center justify-center`,children:a}),t[2]=a,t[3]=l);let u;t[4]!==c||t[5]!==l?(u=(0,J.jsxs)(`div`,{className:`flex min-h-5 items-center gap-1.5`,children:[c,l]}),t[4]=c,t[5]=l,t[6]=u):u=t[6];let d;t[7]===r?d=t[8]:(d=(0,J.jsx)(`p`,{className:`max-w-[42rem] text-xs leading-5 text-muted-foreground`,children:r}),t[7]=r,t[8]=d);let f;t[9]===i?f=t[10]:(f=i?(0,J.jsx)(`div`,{className:`pt-1 text-[11px] text-muted-foreground`,children:i}):null,t[9]=i,t[10]=f);let p;t[11]!==u||t[12]!==d||t[13]!==f?(p=(0,J.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[u,d,f]}),t[11]=u,t[12]=d,t[13]=f,t[14]=p):p=t[14];let m;t[15]===o?m=t[16]:(m=o?(0,J.jsx)(`div`,{className:`flex w-full min-w-0 shrink-0 items-center gap-2 sm:min-w-48 sm:justify-end`,children:o}):null,t[15]=o,t[16]=m);let h;t[17]!==p||t[18]!==m?(h=(0,J.jsxs)(`div`,{className:`grid min-w-0 gap-3 sm:grid-cols-[minmax(0,1fr)_minmax(12rem,auto)] sm:items-center`,children:[p,m]}),t[17]=p,t[18]=m,t[19]=h):h=t[19];let g;t[20]===s?g=t[21]:(g=s?(0,J.jsx)(`div`,{className:`mt-3 min-w-0`,children:s}):null,t[20]=s,t[21]=g);let _;return t[22]!==h||t[23]!==g?(_=(0,J.jsxs)(`div`,{className:`min-h-[4.75rem] border-t border-border px-4 py-3.5 first:border-t-0 sm:px-5`,children:[h,g]}),t[22]=h,t[23]=g,t[24]=_):_=t[24],_}function $(e){let t=(0,q.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 o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,J.jsx)(A,{className:`size-3`}),t[2]=o):o=t[2];let s;t[3]!==i||t[4]!==a?(s=(0,J.jsx)(W,{render:(0,J.jsx)(p,{size:`icon-xs`,variant:`ghost`,"aria-label":i,className:`size-5 rounded-sm p-0 text-muted-foreground hover:text-foreground`,onClick:a,children:o})}),t[3]=i,t[4]=a,t[5]=s):s=t[5];let c;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,J.jsx)(ce,{side:`top`,children:`Reset to default`}),t[6]=c):c=t[6];let l;return t[7]===s?l=t[8]:(l=(0,J.jsxs)(se,{children:[s,c]}),t[7]=s,t[8]=l),l}function Ye(e){let t=(0,q.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,J.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto [scrollbar-gutter:stable]`,children:(0,J.jsx)(`div`,{className:`mx-auto flex w-full max-w-[56rem] flex-col gap-5 px-4 py-5 sm:px-6 sm:py-6`,children:n})}),t[0]=n,t[1]=r),r}function Xe(){let e=(0,q.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,J.jsx)(`span`,{children:`Version`}),(0,J.jsx)(`code`,{className:`text-[11px] font-medium text-muted-foreground`,children:B})]}),e[0]=t):t=e[0],t}function Ze(){let e=(0,q.c)(26),t=a(),n=me().data??null,r;e[0]!==t||e[1]!==n?(r=()=>{let e=window.desktopBridge;if(!e)return;let r=n?oe(n):`none`;if(r===`download`){e.downloadUpdate().then(e=>{V(t,e.state)}).catch(et);return}if(r===`install`){if(!window.confirm(H(n??{availableVersion:null,downloadedVersion:null})))return;e.installUpdate().then(e=>{V(t,e.state)}).catch($e);return}typeof e.checkForUpdate==`function`&&e.checkForUpdate().then(e=>{V(t,e.state),e.checked||U.add({type:`error`,title:`Could not check for updates`,description:e.state.message??`Automatic updates are not available in this build.`})}).catch(Qe)},e[0]=t,e[1]=n,e[2]=r):r=e[2];let i=r,o;e[3]===n?o=e[4]:(o=n?oe(n):`none`,e[3]=n,e[4]=o);let s=o,c;e[5]===n?c=e[6]:(c=n?le(n):null,e[5]=n,e[6]=c);let l=c,u;e[7]!==s||e[8]!==n?(u=s===`none`?!z(n):ge(n),e[7]=s,e[8]=n,e[9]=u):u=e[9];let d=u,f;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(f={download:`Download`,install:`Install`},e[10]=f):f=e[10];let m=f,h;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(h={checking:`Checking…`,downloading:`Downloading…`,"up-to-date":`Up to Date`},e[11]=h):h=e[11];let g=h,_=m[s]??g[n?.status??``]??`Check for Updates`,v=s===`download`||s===`install`?`Update available.`:`Current version of the application.`,y;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,J.jsx)(Xe,{}),e[12]=y):y=e[12];let b=s===`install`?`default`:`outline`,x;e[13]!==d||e[14]!==_||e[15]!==i||e[16]!==b?(x=(0,J.jsx)(W,{render:(0,J.jsx)(p,{size:`xs`,variant:b,disabled:d,onClick:i,children:_})}),e[13]=d,e[14]=_,e[15]=i,e[16]=b,e[17]=x):x=e[17];let S;e[18]===l?S=e[19]:(S=l?(0,J.jsx)(ce,{children:l}):null,e[18]=l,e[19]=S);let C;e[20]!==x||e[21]!==S?(C=(0,J.jsxs)(se,{children:[x,S]}),e[20]=x,e[21]=S,e[22]=C):C=e[22];let w;return e[23]!==v||e[24]!==C?(w=(0,J.jsx)(Q,{title:y,description:v,control:C}),e[23]=v,e[24]=C,e[25]=w):w=e[25],w}function Qe(e){U.add({type:`error`,title:`Could not check for updates`,description:e instanceof Error?e.message:`Update check failed.`})}function $e(e){U.add({type:`error`,title:`Could not install update`,description:e instanceof Error?e.message:`Install failed.`})}function et(e){U.add({type:`error`,title:`Could not download update`,description:e instanceof Error?e.message:`Download failed.`})}var tt=`npm install --global shioricode`;function nt(){let e=(0,q.c)(15),[t,n]=(0,X.useState)(null),[r,i]=(0,X.useState)(!1),a=u&&window.desktopBridge!==void 0,o,s;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>{if(!a||!window.desktopBridge)return;let e=!1;return i(!0),window.desktopBridge.getCompanionCliState().then(t=>{e||n(t)}).catch(t=>{e||n({status:`error`,version:null,binaryPath:null,lastError:t instanceof Error?t.message:`Failed to read CLI status.`,installCommand:tt})}).finally(()=>{e||i(!1)}),()=>{e=!0}},s=[a],e[0]=o,e[1]=s):(o=e[0],s=e[1]),(0,X.useEffect)(o,s);let c;e[2]===r?c=e[3]:(c=()=>{!window.desktopBridge||r||(i(!0),window.desktopBridge.installCompanionCli().then(e=>{n(e.state),e.completed||U.add({type:`error`,title:`Could not install ShioriCode CLI`,description:e.state.lastError??`Install failed.`})}).catch(e=>{let t=e instanceof Error?e.message:`Install failed.`;n(e=>({status:`error`,version:e?.version??null,binaryPath:e?.binaryPath??null,lastError:t,installCommand:e?.installCommand??tt})),U.add({type:`error`,title:`Could not install ShioriCode CLI`,description:t})}).finally(()=>{i(!1)}))},e[2]=r,e[3]=c);let l=c,d=t?.installCommand??tt,f=t?.status??`not-installed`,m=f===`installing`?`Installing...`:f===`installed`?`Reinstall`:`Install`,h;e[4]!==d||e[5]!==t||e[6]!==f?(h=(0,J.jsx)(`div`,{className:`space-y-1`,children:a?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`span`,{className:`block`,children:f===`installed`?`Installed${t?.version?` · v${t.version}`:``}`:f===`installing`?`Installing companion CLI…`:`Not installed`}),t?.binaryPath?(0,J.jsx)(`code`,{className:`block break-all text-[11px] text-foreground`,children:t.binaryPath}):null,t?.lastError?(0,J.jsx)(`span`,{className:`block text-destructive`,children:t.lastError}):null,(0,J.jsx)(`code`,{className:`block break-all text-[11px] text-muted-foreground`,children:d})]}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`span`,{className:`block`,children:`Desktop install is unavailable in the browser build.`}),(0,J.jsx)(`code`,{className:`block break-all text-[11px] text-foreground`,children:tt})]})}),e[4]=d,e[5]=t,e[6]=f,e[7]=h):h=e[7];let g;e[8]!==m||e[9]!==l||e[10]!==r?(g=u?(0,J.jsx)(p,{size:`xs`,variant:`outline`,disabled:r,onClick:l,children:m}):null,e[8]=m,e[9]=l,e[10]=r,e[11]=g):g=e[11];let _;return e[12]!==h||e[13]!==g?(_=(0,J.jsx)(Q,{title:`ShioriCode CLI`,description:"Install the unified `shioricode` CLI to open projects and control local or hosted ShioriCode.",status:h,control:g}),e[12]=h,e[13]=g,e[14]=_):_=e[14],_}function rt(e){let t=(0,q.c)(70),r=re(),{resetSettings:i}=ie(),a=!n(r.textGenerationModelSelection??null,h.textGenerationModelSelection??null),o=!n(r.defaultModelSelection??null,h.defaultModelSelection??null),s;t[0]===r.providers?s=t[1]:(s=ze.some(e=>{let t=r.providers[e.provider],i=h.providers[e.provider];return!n(t,i)}),t[0]=r.providers,t[1]=s);let c=s,l,u;t[2]===r.themeMode?u=t[3]:(u=r.themeMode===h.themeMode?[]:[`Theme mode`],t[2]=r.themeMode,t[3]=u);let p;t[4]===r.lightThemeId?p=t[5]:(p=r.lightThemeId===h.lightThemeId?[]:[`Light theme`],t[4]=r.lightThemeId,t[5]=p);let m;t[6]===r.darkThemeId?m=t[7]:(m=r.darkThemeId===h.darkThemeId?[]:[`Dark theme`],t[6]=r.darkThemeId,t[7]=m);let g;t[8]===r.blurPersonalData?g=t[9]:(g=r.blurPersonalData===h.blurPersonalData?[]:[`Hide personal details`],t[8]=r.blurPersonalData,t[9]=g);let _;t[10]===r.composerVimMode?_=t[11]:(_=r.composerVimMode===h.composerVimMode?[]:[`Composer Vim mode`],t[10]=r.composerVimMode,t[11]=_);let v;t[12]===r.uiFontFamily?v=t[13]:(v=r.uiFontFamily===h.uiFontFamily?[]:[`UI font`],t[12]=r.uiFontFamily,t[13]=v);let y;t[14]===r.codeFontFamily?y=t[15]:(y=r.codeFontFamily===h.codeFontFamily?[]:[`Code font`],t[14]=r.codeFontFamily,t[15]=y);let b;t[16]===r.importedThemes.length?b=t[17]:(b=r.importedThemes.length>0?[`Imported themes`]:[],t[16]=r.importedThemes.length,t[17]=b);let x;t[18]===r.timestampFormat?x=t[19]:(x=r.timestampFormat===h.timestampFormat?[]:[`Time format`],t[18]=r.timestampFormat,t[19]=x);let S;t[20]===r.diffWordWrap?S=t[21]:(S=r.diffWordWrap===h.diffWordWrap?[]:[`Diff line wrapping`],t[20]=r.diffWordWrap,t[21]=S);let C;t[22]===r.enableAssistantStreaming?C=t[23]:(C=r.enableAssistantStreaming===h.enableAssistantStreaming?[]:[`Assistant output`],t[22]=r.enableAssistantStreaming,t[23]=C);let w;t[24]===r.generateMemories?w=t[25]:(w=r.generateMemories===h.generateMemories?[]:[`Memories`],t[24]=r.generateMemories,t[25]=w);let T;t[26]===r.assistantPersonality?T=t[27]:(T=r.assistantPersonality===`default`?[]:[`Assistant personality`],t[26]=r.assistantPersonality,t[27]=T);let E;t[28]===r.defaultThreadEnvMode?E=t[29]:(E=r.defaultThreadEnvMode===h.defaultThreadEnvMode?[]:[`New Thread mode`],t[28]=r.defaultThreadEnvMode,t[29]=E);let D;t[30]===o?D=t[31]:(D=o?[`Default model`]:[],t[30]=o,t[31]=D);let O;t[32]===r.confirmThreadDelete?O=t[33]:(O=r.confirmThreadDelete===h.confirmThreadDelete?[]:[`Delete confirmation`],t[32]=r.confirmThreadDelete,t[33]=O);let k;t[34]===r.quitWithoutConfirmation?k=t[35]:(k=r.quitWithoutConfirmation===h.quitWithoutConfirmation?[]:[`Quit confirmation`],t[34]=r.quitWithoutConfirmation,t[35]=k);let A;t[36]===r.onboarding?A=t[37]:(A=n(r.onboarding,h.onboarding)?[]:[`Onboarding`],t[36]=r.onboarding,t[37]=A);let j;t[38]===a?j=t[39]:(j=a?[`Git writing model`]:[],t[38]=a,t[39]=j);let M;t[40]===c?M=t[41]:(M=c?[`Providers`]:[],t[40]=c,t[41]=M);let N;t[42]!==x||t[43]!==S||t[44]!==C||t[45]!==w||t[46]!==T||t[47]!==E||t[48]!==D||t[49]!==O||t[50]!==k||t[51]!==A||t[52]!==u||t[53]!==j||t[54]!==M||t[55]!==p||t[56]!==m||t[57]!==g||t[58]!==_||t[59]!==v||t[60]!==y||t[61]!==b?(N=[...u,...p,...m,...g,..._,...v,...y,...b,...x,...S,...C,...w,...T,...E,...D,...O,...k,...A,...j,...M],t[42]=x,t[43]=S,t[44]=C,t[45]=w,t[46]=T,t[47]=E,t[48]=D,t[49]=O,t[50]=k,t[51]=A,t[52]=u,t[53]=j,t[54]=M,t[55]=p,t[56]=m,t[57]=g,t[58]=_,t[59]=v,t[60]=y,t[61]=b,t[62]=N):N=t[62],l=N;let P=l,F;t[63]!==P||t[64]!==e||t[65]!==i?(F=async()=>{P.length!==0&&await(f()??d()).dialogs.confirm([`Restore default settings?`,`This will reset: ${P.join(`, `)}.`].join(`
|
|
2
|
-
`))&&(i(),e?.())},t[63]=P,t[64]=e,t[65]=i,t[66]=F):F=t[66];let I=F,L;return t[67]!==P||t[68]!==I?(L={changedSettingLabels:P,restoreDefaults:I},t[67]=P,t[68]=I,t[69]=L):L=t[69],L}function it(){let e=re(),{updateSettings:t}=ie(),r=(0,X.useMemo)(()=>ue(e.onboarding),[e.onboarding]),[a,o]=(0,X.useState)(null),[f,m]=(0,X.useState)(!1),[g,b]=(0,X.useState)(!1),[x,S]=(0,X.useState)(null),[O,A]=(0,X.useState)({kimiCode:e.providers.kimiCode.binaryPath!==h.providers.kimiCode.binaryPath||e.providers.kimiCode.shareDir!==h.providers.kimiCode.shareDir||e.providers.kimiCode.customModels.length>0,gemini:e.providers.gemini.binaryPath!==h.providers.gemini.binaryPath||e.providers.gemini.googleCloudProject!==h.providers.gemini.googleCloudProject||e.providers.gemini.customModels.length>0,glm:e.providers.glm.binaryPath!==h.providers.glm.binaryPath||e.providers.glm.apiBaseUrl!==h.providers.glm.apiBaseUrl||e.providers.glm.apiKey!==h.providers.glm.apiKey||e.providers.glm.apiKeyEnvVar!==h.providers.glm.apiKeyEnvVar||e.providers.glm.customModels.length>0,cursor:e.providers.cursor.binaryPath!==h.providers.cursor.binaryPath||e.providers.cursor.apiEndpoint!==h.providers.cursor.apiEndpoint||e.providers.cursor.customModels.length>0,codex:e.providers.codex.binaryPath!==h.providers.codex.binaryPath||e.providers.codex.homePath!==h.providers.codex.homePath||e.providers.codex.customModels.length>0,claudeAgent:e.providers.claudeAgent.binaryPath!==h.providers.claudeAgent.binaryPath||e.providers.claudeAgent.customModels.length>0}),[j,N]=(0,X.useState)(!1),F=(0,X.useRef)(!1),L=(0,X.useRef)({}),ee=(0,X.useCallback)(()=>{F.current||(F.current=!0,N(!0),d().server.refreshProviders().catch(e=>{console.warn(`Failed to refresh providers`,e)}).finally(()=>{F.current=!1,N(!1)}))},[]),te=(0,X.useCallback)(e=>{o(e),d().onboarding.completeStep({stepId:e}).catch(e=>{U.add({type:`error`,title:`Could not complete onboarding step`,description:e instanceof Error?e.message:`The onboarding step could not be completed.`})}).finally(()=>{o(t=>t===e?null:t)})},[]),ne=(0,X.useCallback)(()=>{m(!0),d().onboarding.reset().catch(e=>{U.add({type:`error`,title:`Could not reset onboarding`,description:e instanceof Error?e.message:`The onboarding progress could not be reset.`})}).finally(()=>{m(!1)})},[]),R=c(),oe=s(),z=l(),le=e.providers.codex.homePath,B=D(e.defaultModelSelection,e,z),V=B.provider,H=B.model,de=B.options,me=w(e,z,V,H),he=!n(e.defaultModelSelection??null,h.defaultModelSelection??null),ge=T(e,z),G=ge.provider,K=ge.model,we=ge.options,Te=_e.find(t=>t.value===e.assistantPersonality)??_e[0],Ee=w(e,z,G,K),q=!n(e.textGenerationModelSelection??null,h.textGenerationModelSelection??null),Ae=(0,X.useCallback)(()=>{if(!R)return;S(null),b(!0);let e=fe(oe??[]);if(!e){S(`No available editors found.`),b(!1);return}d().shell.openInEditor(R,e).catch(e=>{S(e instanceof Error?e.message:`Unable to open keybindings file.`)}).finally(()=>{b(!1)})},[oe,R]),je=(0,X.useCallback)((n,r)=>{t({providers:{...e.providers,[n]:{...e.providers[n],customModels:e.providers[n].customModels.filter(e=>e!==r)}}})},[e,t]),Me=ze.map(t=>{let r=z.find(e=>e.provider===t.provider),i=e.providers[t.provider],a=h.providers[t.provider],o=r?.status??(i.enabled?`warning`:`disabled`),s=Ve(r,i.enabled),c=i.customModels.map(e=>({slug:e,name:e,isCustom:!0,capabilities:null})),l=r?.models??c;return{provider:t.provider,title:t.title,textFields:Ge(e.providers,t.provider,t.textFields),homePathKey:t.homePathKey,homePlaceholder:t.homePlaceholder,homeDescription:t.homeDescription,isDirty:!n(i,a),liveProvider:r,models:l,providerConfig:i,statusStyle:Be[o],summary:s,versionLabel:He(r?.version)}}),Ne=z.length>0?z.reduce((e,t)=>t.checkedAt>e?t.checkedAt:e,z[0].checkedAt):null;return(0,J.jsxs)(Ye,{children:[(0,J.jsxs)(Z,{title:`Onboarding`,headerAction:void 0,children:[(0,J.jsx)(Q,{title:`Flow status`,description:`Track first-run setup and jump back into the guided welcome flow when you need it.`,status:r.completed?`All steps completed.`:`${r.completedCount}/${r.totalSteps} steps completed.`,control:(0,J.jsx)(p,{size:`xs`,variant:`outline`,disabled:f||r.completedCount===0,onClick:ne,children:f?`Resetting...`:`Reset`})}),r.steps.map(e=>{let t=!e.completed&&r.currentStepId!==null&&r.currentStepId!==e.id,n=a===e.id;return(0,J.jsx)(Q,{title:e.title,description:e.description,status:e.completed?`Completed`:t?`Locked until previous steps are completed.`:`Current step`,control:(0,J.jsx)(p,{size:`xs`,variant:`outline`,disabled:e.completed||t||n,onClick:()=>te(e.id),children:e.completed?`Done`:n?`Saving...`:`Complete step`})},e.id)})]}),(0,J.jsxs)(Z,{title:`General`,children:[(0,J.jsx)(Q,{title:`Composer Vim mode`,description:`Use a lightweight Vim editing mode in the message composer.`,resetAction:e.composerVimMode===h.composerVimMode?null:(0,J.jsx)($,{label:`Composer Vim mode`,onClick:()=>t({composerVimMode:h.composerVimMode})}),control:(0,J.jsx)(Y,{checked:e.composerVimMode,onCheckedChange:e=>t({composerVimMode:!!e}),"aria-label":`Enable composer Vim mode`})}),(0,J.jsx)(Q,{title:`Assistant output`,description:`Show token-by-token output while a response is in progress.`,resetAction:e.enableAssistantStreaming===h.enableAssistantStreaming?null:(0,J.jsx)($,{label:`assistant output`,onClick:()=>t({enableAssistantStreaming:h.enableAssistantStreaming})}),control:(0,J.jsx)(Y,{checked:e.enableAssistantStreaming,onCheckedChange:e=>t({enableAssistantStreaming:!!e}),"aria-label":`Stream assistant messages`})}),(0,J.jsx)(Q,{title:`Memories`,description:`Ask supported runtimes to generate and refresh durable memories for future turns.`,resetAction:e.generateMemories===h.generateMemories?null:(0,J.jsx)($,{label:`memories`,onClick:()=>t({generateMemories:h.generateMemories})}),control:(0,J.jsx)(Y,{checked:e.generateMemories,onCheckedChange:e=>t({generateMemories:!!e}),"aria-label":`Generate memories`}),children:(0,J.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:`When enabled, ShioriCode adds a memory-generation overlay to provider prompts for runtimes that support persistent memories.`})}),(0,J.jsx)(Q,{title:`Assistant personality`,description:`Adds a tone appendix to ShioriCode, Codex, and Claude provider instructions.`,resetAction:e.assistantPersonality===`default`?null:(0,J.jsx)($,{label:`assistant personality`,onClick:()=>t({assistantPersonality:_})}),control:(0,J.jsxs)(Se,{value:e.assistantPersonality,onValueChange:e=>{(e===`default`||e===`friendly`||e===`sassy`||e===`coach`||e===`pragmatic`)&&t({assistantPersonality:e})},children:[(0,J.jsx)(xe,{className:`w-full sm:w-44`,"aria-label":`Assistant personality`,children:(0,J.jsx)(Ce,{children:Te.label})}),(0,J.jsx)(ve,{align:`end`,alignItemWithTrigger:!1,children:_e.map(e=>(0,J.jsx)(ye,{hideIndicator:!0,value:e.value,children:e.label},e.value))})]}),children:(0,J.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:Te.description})}),(0,J.jsx)(Q,{title:`New Threads`,description:`Pick the default workspace mode for newly created draft threads.`,resetAction:e.defaultThreadEnvMode===h.defaultThreadEnvMode?null:(0,J.jsx)($,{label:`new threads`,onClick:()=>t({defaultThreadEnvMode:h.defaultThreadEnvMode})}),control:(0,J.jsxs)(Se,{value:e.defaultThreadEnvMode,onValueChange:e=>{(e===`local`||e===`worktree`)&&t({defaultThreadEnvMode:e})},children:[(0,J.jsx)(xe,{className:`w-full sm:w-44`,"aria-label":`Default thread mode`,children:(0,J.jsx)(Ce,{children:e.defaultThreadEnvMode===`worktree`?`New worktree`:`Local`})}),(0,J.jsxs)(ve,{align:`end`,alignItemWithTrigger:!1,children:[(0,J.jsx)(ye,{hideIndicator:!0,value:`local`,children:`Local`}),(0,J.jsx)(ye,{hideIndicator:!0,value:`worktree`,children:`New worktree`})]})]})}),(0,J.jsx)(Q,{title:`Quit without asking`,description:`Skip the desktop quit confirmation window.`,resetAction:e.quitWithoutConfirmation===h.quitWithoutConfirmation?null:(0,J.jsx)($,{label:`quit confirmation`,onClick:()=>t({quitWithoutConfirmation:h.quitWithoutConfirmation})}),control:(0,J.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2 text-sm text-foreground`,children:[(0,J.jsx)(ke,{checked:e.quitWithoutConfirmation,onCheckedChange:e=>t({quitWithoutConfirmation:!!e}),"aria-label":`Quit without asking`}),(0,J.jsx)(`span`,{className:`select-none`,children:`Quit without asking`})]})}),(0,J.jsx)(Q,{title:`Delete confirmation`,description:`Ask before deleting a thread and its chat history.`,resetAction:e.confirmThreadDelete===h.confirmThreadDelete?null:(0,J.jsx)($,{label:`delete confirmation`,onClick:()=>t({confirmThreadDelete:h.confirmThreadDelete})}),control:(0,J.jsx)(Y,{checked:e.confirmThreadDelete,onCheckedChange:e=>t({confirmThreadDelete:!!e}),"aria-label":`Confirm thread deletion`})}),(0,J.jsx)(nt,{}),(0,J.jsx)(Q,{title:`Default model`,description:`Choose the model new projects use by default for their first thread.`,resetAction:he?(0,J.jsx)($,{label:`default model`,onClick:()=>t({defaultModelSelection:h.defaultModelSelection})}):null,control:(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-1.5`,children:[(0,J.jsx)(be,{provider:V,model:H,lockedProvider:null,providers:z,modelOptionsByProvider:me,modelOptions:de,triggerVariant:`outline`,triggerClassName:`min-w-0 max-w-none shrink-0 text-foreground/90 hover:text-foreground`,onProviderModelChange:(n,r)=>{t({defaultModelSelection:D({provider:n,model:r},e,z)})}}),(0,J.jsx)(C,{provider:V,models:z.find(e=>e.provider===V)?.models??[],model:H,prompt:``,onPromptChange:()=>{},modelOptions:de,allowPromptInjectedEffort:!1,triggerVariant:`outline`,triggerClassName:`min-w-0 max-w-none shrink-0 text-foreground/90 hover:text-foreground`,onModelOptionsChange:n=>{t({defaultModelSelection:D(E(V,H,n),e,z)})}})]})}),(0,J.jsx)(Q,{title:`Text generation model`,description:`Configure the model used for generated commit messages, PR titles, and similar Git text.`,resetAction:q?(0,J.jsx)($,{label:`text generation model`,onClick:()=>t({textGenerationModelSelection:h.textGenerationModelSelection})}):null,control:(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-1.5`,children:[(0,J.jsx)(be,{provider:G,model:K,lockedProvider:null,providers:z,modelOptionsByProvider:Ee,modelOptions:e.textGenerationModelSelection.options,triggerVariant:`outline`,triggerClassName:`min-w-0 max-w-none shrink-0 text-foreground/90 hover:text-foreground`,onProviderModelChange:(n,r)=>{t({textGenerationModelSelection:T({...e,textGenerationModelSelection:{provider:n,model:r}},z)})}}),(0,J.jsx)(C,{provider:G,models:z.find(e=>e.provider===G)?.models??[],model:K,prompt:``,onPromptChange:()=>{},modelOptions:we,allowPromptInjectedEffort:!1,triggerVariant:`outline`,triggerClassName:`min-w-0 max-w-none shrink-0 text-foreground/90 hover:text-foreground`,onModelOptionsChange:n=>{t({textGenerationModelSelection:T({...e,textGenerationModelSelection:E(G,K,n)},z)})}})]})})]}),(0,J.jsx)(Z,{title:`Providers`,headerAction:(0,J.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,J.jsx)(Je,{lastCheckedAt:Ne}),(0,J.jsxs)(se,{children:[(0,J.jsx)(W,{render:(0,J.jsx)(p,{size:j?`xs`:`icon-xs`,variant:`ghost`,className:y(`rounded-sm text-muted-foreground hover:text-foreground`,j?`px-2`:`size-5 p-0`),disabled:j,onClick:()=>void ee(),"aria-label":`Refresh provider status`,children:j?(0,J.jsx)(pe,{children:`Refreshing`}):(0,J.jsx)(P,{className:`size-3`})})}),(0,J.jsx)(ce,{side:`top`,children:`Refresh provider status`})]})]}),children:Me.map(n=>{let r=v[n.provider]??n.title;return(0,J.jsxs)(`div`,{className:`border-t border-border first:border-t-0`,children:[(0,J.jsx)(`div`,{className:`px-4 py-4 sm:px-5`,children:(0,J.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,J.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[(0,J.jsxs)(`div`,{className:`flex min-h-5 items-center gap-1.5`,children:[(0,J.jsx)(`span`,{className:y(`size-2 shrink-0 rounded-full`,n.statusStyle.dot)}),(0,J.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:r}),n.versionLabel?(0,J.jsx)(`code`,{className:`text-xs text-muted-foreground`,children:n.versionLabel}):null,(0,J.jsx)(`span`,{className:`inline-flex h-5 w-5 shrink-0 items-center justify-center`,children:n.isDirty?(0,J.jsx)($,{label:`${r} provider settings`,onClick:()=>{t({providers:{...e.providers,[n.provider]:h.providers[n.provider]}})}}):null})]}),(0,J.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[(0,J.jsx)(`span`,{children:n.summary.headline}),n.summary.detail?` - ${n.summary.detail}`:null]})]}),(0,J.jsxs)(`div`,{className:`flex w-full shrink-0 items-center gap-2 sm:w-auto sm:justify-end`,children:[(0,J.jsx)(p,{size:`sm`,variant:`ghost`,className:`h-7 px-2 text-xs text-muted-foreground hover:text-foreground`,onClick:()=>A(e=>({...e,[n.provider]:!e[n.provider]})),"aria-label":`Toggle ${r} details`,children:(0,J.jsx)(I,{className:y(`size-3.5 transition-transform`,O[n.provider]&&`rotate-180`)})}),(0,J.jsx)(Y,{checked:n.providerConfig.enabled,onCheckedChange:r=>{let i=!r&&G===n.provider;t({providers:{...e.providers,[n.provider]:{...e.providers[n.provider],enabled:!!r}},...i?{textGenerationModelSelection:h.textGenerationModelSelection}:{}})},"aria-label":`Enable ${r}`})]})]})}),(0,J.jsx)(Oe,{open:O[n.provider],onOpenChange:e=>A(t=>({...t,[n.provider]:e})),children:(0,J.jsx)(De,{children:(0,J.jsxs)(`div`,{className:`space-y-0`,children:[n.textFields.map(r=>(0,J.jsx)(`div`,{className:`border-t border-border/60 px-4 py-3 sm:px-5`,children:(0,J.jsxs)(`label`,{htmlFor:`provider-install-${n.provider}-${r.key}`,className:`block`,children:[(0,J.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:r.label}),(0,J.jsx)(ae,{id:`provider-install-${n.provider}-${r.key}`,className:`mt-1.5`,type:r.inputType??`text`,value:r.value,onChange:i=>t({providers:We(e.providers,n.provider,r.key,i.target.value)}),placeholder:r.placeholder,spellCheck:!1}),r.description?(0,J.jsx)(`span`,{className:`mt-1 block text-xs text-muted-foreground`,children:r.description}):null]})},`${n.provider}:${r.key}`)),n.homePathKey?(0,J.jsx)(`div`,{className:`border-t border-border/60 px-4 py-3 sm:px-5`,children:(0,J.jsxs)(`label`,{htmlFor:`provider-install-${n.homePathKey}`,className:`block`,children:[(0,J.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:`CODEX_HOME path`}),(0,J.jsx)(ae,{id:`provider-install-${n.homePathKey}`,className:`mt-1.5`,value:le,onChange:n=>t({providers:{...e.providers,codex:{...e.providers.codex,homePath:n.target.value}}}),placeholder:n.homePlaceholder,spellCheck:!1}),n.homeDescription?(0,J.jsx)(`span`,{className:`mt-1 block text-xs text-muted-foreground`,children:n.homeDescription}):null]})}):null,(0,J.jsxs)(`div`,{className:`border-t border-border/60 px-4 py-3 sm:px-5`,children:[(0,J.jsx)(`div`,{className:`text-xs font-medium text-foreground`,children:`Models`}),(0,J.jsxs)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:[n.models.length,` model`,n.models.length===1?``:`s`,` available.`]}),(0,J.jsx)(`div`,{ref:e=>{L.current[n.provider]=e},className:`mt-2 max-h-40 overflow-y-auto pb-1`,children:n.models.map(e=>{let t=e.capabilities,r=[];t?.supportsFastMode&&r.push(`Fast mode`),t?.supportsThinkingToggle&&r.push(`Thinking`),t?.reasoningEffortLevels&&t.reasoningEffortLevels.length>0&&r.push(`Reasoning`);let i=r.length>0||e.name!==e.slug;return(0,J.jsxs)(`div`,{className:`flex items-center gap-2 py-1`,children:[(0,J.jsx)(`span`,{className:`min-w-0 truncate text-xs text-foreground/90`,children:e.name}),i?(0,J.jsxs)(se,{children:[(0,J.jsx)(W,{render:(0,J.jsx)(`button`,{type:`button`,className:`shrink-0 text-muted-foreground/40 transition-colors hover:text-muted-foreground`,"aria-label":`Details for ${e.name}`}),children:(0,J.jsx)(k,{className:`size-3`})}),(0,J.jsx)(ce,{side:`top`,className:`max-w-56`,children:(0,J.jsxs)(`div`,{className:`space-y-1`,children:[(0,J.jsx)(`code`,{className:`block text-[11px] text-foreground`,children:e.slug}),r.length>0?(0,J.jsx)(`div`,{className:`flex flex-wrap gap-x-2 gap-y-0.5`,children:r.map(e=>(0,J.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:e},e))}):null]})})]}):null,e.isCustom?(0,J.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-1.5`,children:[(0,J.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:`custom`}),(0,J.jsx)(`button`,{type:`button`,className:`text-muted-foreground transition-colors hover:text-foreground`,"aria-label":`Remove ${e.slug}`,onClick:()=>je(n.provider,e.slug),children:(0,J.jsx)(M,{className:`size-3`})})]}):null]},`${n.provider}:${e.slug}`)})})]})]})})})]},n.provider)})}),(0,J.jsx)(Z,{title:`Advanced`,children:(0,J.jsx)(Q,{title:`Keybindings`,description:"Open the persisted `keybindings.json` file to edit advanced bindings directly.",status:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`span`,{className:`block break-all font-mono text-[11px] text-foreground`,children:R??`Resolving keybindings path...`}),x?(0,J.jsx)(`span`,{className:`mt-1 block text-destructive`,children:x}):(0,J.jsx)(`span`,{className:`mt-1 block`,children:`Opens in your preferred editor.`})]}),control:(0,J.jsx)(p,{size:`xs`,variant:`outline`,disabled:!R||g,onClick:Ae,children:g?`Opening...`:`Open file`})})}),(0,J.jsx)(Z,{title:`About`,children:u?(0,J.jsx)(Ze,{}):(0,J.jsx)(Q,{title:(0,J.jsx)(Xe,{}),description:`Current version of the application.`})}),(0,J.jsxs)(`footer`,{className:`pb-2 pt-4 text-center text-[11px] text-muted-foreground/60`,children:[(0,J.jsxs)(`p`,{children:[`© `,new Date().getFullYear(),` Shiori AI`]}),(0,J.jsx)(`p`,{className:`mt-1`,children:(0,J.jsx)(i,{to:`/settings/credits`,className:`underline decoration-muted-foreground/30 underline-offset-2 transition-colors hover:text-muted-foreground`,children:`Credits`})})]})]})}function at(){let e=O(e=>e.projects),t=O(e=>e.threads),n=re(),{unarchiveThread:r,deleteThread:i,confirmAndDeleteThread:a}=he(),o=(0,X.useMemo)(()=>[...new Map(e.map(e=>[e.id,e])).values()].map(e=>({project:e,threads:t.filter(t=>t.projectId===e.id&&t.archivedAt!==null).toSorted((e,t)=>{let n=e.archivedAt??e.createdAt;return(t.archivedAt??t.createdAt).localeCompare(n)||t.id.localeCompare(e.id)})})).filter(e=>e.threads.length>0),[e,t]),s=(0,X.useCallback)(async e=>{try{await r(e)}catch(e){U.add({type:`error`,title:`Failed to unarchive thread`,description:e instanceof Error?e.message:`An error occurred.`})}},[r]),c=(0,X.useCallback)(async e=>{try{await a(e)}catch(e){U.add({type:`error`,title:`Failed to delete thread`,description:e instanceof Error?e.message:`An error occurred.`})}},[a]),l=(0,X.useCallback)(async(e,t)=>{try{for(let e of t)await r(e.id)}catch(t){U.add({type:`error`,title:`Failed to unarchive archived threads for ${e}`,description:t instanceof Error?t.message:`An error occurred.`})}},[r]),u=(0,X.useCallback)(async(e,t)=>{let r=f();if(!r)return;let a=t.length;if(a!==0)try{if(n.confirmThreadDelete&&!await r.dialogs.confirm([`Delete all ${a} archived thread${a===1?``:`s`} in "${e}"?`,`This permanently clears conversation history for these threads.`].join(`
|
|
3
|
-
`)))return;let o=new Set(t.map(e=>e.id));for(let e of t)await i(e.id,{deletedThreadIds:o})}catch(t){U.add({type:`error`,title:`Failed to delete archived threads for ${e}`,description:t instanceof Error?t.message:`An error occurred.`})}},[n.confirmThreadDelete,i]),d=(0,X.useCallback)(async(e,t)=>{let n=f();if(!n)return;let r=await n.contextMenu.show([{id:`unarchive`,label:`Unarchive`},{id:`delete`,label:`Delete`,destructive:!0}],t);if(r===`unarchive`){await s(e);return}r===`delete`&&await c(e)},[c,s]);return(0,J.jsx)(Ye,{children:o.length===0?(0,J.jsx)(Z,{title:`Archived threads`,children:(0,J.jsxs)(Ee,{className:`min-h-88`,children:[(0,J.jsx)(G,{variant:`icon`,children:(0,J.jsx)(N,{})}),(0,J.jsxs)(K,{children:[(0,J.jsx)(we,{children:`No archived threads`}),(0,J.jsx)(Te,{children:`Archived threads will appear here.`})]})]})}):o.map(({project:e,threads:t})=>(0,J.jsx)(Z,{title:e.name,icon:(0,J.jsx)(Me,{cwd:e.cwd}),headerAction:(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,J.jsx)(p,{type:`button`,variant:`destructive-outline`,size:`xs`,className:`cursor-pointer`,"aria-label":`Delete all archived threads for ${e.name}`,onClick:()=>void u(e.name,t),children:`Delete All`}),(0,J.jsx)(p,{type:`button`,variant:`outline`,size:`xs`,className:`cursor-pointer`,"aria-label":`Unarchive all threads for ${e.name}`,onClick:()=>void l(e.name,t),children:`Unarchive All`})]}),children:t.map(e=>(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-t border-border px-4 py-3 first:border-t-0 sm:px-5`,onContextMenu:t=>{t.preventDefault(),d(e.id,{x:t.clientX,y:t.clientY})},children:[(0,J.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,J.jsx)(`h3`,{className:`truncate text-sm font-medium text-foreground`,children:e.title}),(0,J.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Archived `,de(e.archivedAt??e.createdAt),` · Created `,de(e.createdAt)]})]}),(0,J.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,J.jsxs)(p,{type:`button`,variant:`destructive-outline`,size:`sm`,className:`h-7 cursor-pointer gap-1.5 px-2.5`,"aria-label":`Delete archived thread ${e.title}`,onClick:()=>void c(e.id),children:[(0,J.jsx)(j,{className:`size-3.5`}),(0,J.jsx)(`span`,{children:`Delete`})]}),(0,J.jsxs)(p,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 cursor-pointer gap-1.5 px-2.5`,onClick:()=>void s(e.id),children:[(0,J.jsx)(N,{className:`size-3.5`}),(0,J.jsx)(`span`,{children:`Unarchive`})]})]})]},e.id))},e.id))})}export{Ye as a,Ne as c,rt as d,ke as f,it as i,Ie as l,Fe as n,Q as o,Y as p,Pe as r,Z as s,at as t,Le as u};
|
|
4
|
-
//# sourceMappingURL=SettingsPanels-DGYlfoWv.js.map
|