@cuongtran001/kanna 1.63.2 → 1.63.3
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/README.md +5 -9
- package/dist/client/assets/{BoardsPage-BJalB-bc.js → BoardsPage-AckCuswi.js} +1 -1
- package/dist/client/assets/BoardsRoutePage-DzKwKy3f.js +1 -0
- package/dist/client/assets/ChatPage-DsaH8CTz.js +93 -0
- package/dist/client/assets/{CronJobRow-CPbO_jwU.js → CronJobRow-Bx9gRqKW.js} +1 -1
- package/dist/client/assets/{CronJobsPage-Ck3SNgGi.js → CronJobsPage-v0-2X1oX.js} +1 -1
- package/dist/client/assets/{FilePreviewSheet-XEuUtDPn.js → FilePreviewSheet-B6SDxSD0.js} +2 -2
- package/dist/client/assets/{FlowSurface-BCbeMTJe.js → FlowSurface-CLC-ZFar.js} +1 -1
- package/dist/client/assets/{GenUIBlock-BJy_dfs-.js → GenUIBlock-CC79Ujro.js} +2 -2
- package/dist/client/assets/{KannaSocketProvider-D7Lzlt35.js → KannaSocketProvider-B2sHsWP5.js} +1 -1
- package/dist/client/assets/{LocalProjectsPage-9LJkQjhT.js → LocalProjectsPage-DYBkcEAm.js} +1 -1
- package/dist/client/assets/SettingsPage-CZqMkMRW.js +9 -0
- package/dist/client/assets/{StackBoardsRoutePage-t_EaFNG4.js → StackBoardsRoutePage-Clviz0hX.js} +1 -1
- package/dist/client/assets/{ToolCallMessage-RbF9XT2B.js → ToolCallMessage-BfNbWGmc.js} +1 -1
- package/dist/client/assets/{VChartSurface-CKuPelsn.js → VChartSurface-CUbxyBo3.js} +1 -1
- package/dist/client/assets/{WorkflowsPage-B6qUmQA3.js → WorkflowsPage-rengzb97.js} +1 -1
- package/dist/client/assets/{WorkflowsSection-DxO0S4An.js → WorkflowsSection-DuXdLsMO.js} +1 -1
- package/dist/client/assets/{chart-renderer-DjYZvNxh.js → chart-renderer-D7ukB2wg.js} +1 -1
- package/dist/client/assets/{chatSounds-FD2DQzF6.js → chatSounds-BLg2xPDZ.js} +1 -1
- package/dist/client/assets/chevron-left-RbFvmeyK.js +1 -0
- package/dist/client/assets/{clipboard.adapter-GN9nnYak.js → clipboard.adapter-CgdNwn-1.js} +1 -1
- package/dist/client/assets/{columnStyle-DjA7hA9k.js → columnStyle-CMCF0ds6.js} +1 -1
- package/dist/client/assets/{createScopedStore-BoLB9Rhc.js → createScopedStore-BrD5NHWx.js} +1 -1
- package/dist/client/assets/{dist-CimtOoGK.js → dist-DNSTHlSo.js} +1 -1
- package/dist/client/assets/editor-icons-DY4uKeEY.js +1 -0
- package/dist/client/assets/{ellipsis-Cd7sO0LO.js → ellipsis-OHg0x_x1.js} +1 -1
- package/dist/client/assets/{flow-kinds-CW2TU_83.js → flow-kinds-Ki2DP9nP.js} +1 -1
- package/dist/client/assets/{folder-C7sXCaHj.js → folder-CnWzWIG5.js} +1 -1
- package/dist/client/assets/{formatters-wSVyvDFZ.js → formatters-BGORekd-.js} +1 -1
- package/dist/client/assets/{genui-EzBIAYFE.js → genui-C9i6j0XZ.js} +1 -1
- package/dist/client/assets/{globe-xmRpmpma.js → globe-BjR1tyE4.js} +1 -1
- package/dist/client/assets/{host-DCaA9W-Z.js → host-D9tJwZXl.js} +1 -1
- package/dist/client/assets/{index-CDqjh7nt.js → index-CesRxZ0X.js} +7 -7
- package/dist/client/assets/index-CxDE9VOy.css +1 -0
- package/dist/client/assets/{info-D4MMvZFe.js → info-DNYekoE-.js} +1 -1
- package/dist/client/assets/{input-C4fvDiQ4.js → input-DgW9uRZN.js} +1 -1
- package/dist/client/assets/{lexicalToReact-sPUyOWk6.js → lexicalToReact-CZvp9Pgz.js} +3 -3
- package/dist/client/assets/{log-aTaDVF_e.js → log-DnEvbp3E.js} +1 -1
- package/dist/client/assets/{monitor-_CRKcV1h.js → monitor-qbWfUdBG.js} +1 -1
- package/dist/client/assets/{pencil-fNBeUUCf.js → pencil-C965rrpd.js} +1 -1
- package/dist/client/assets/{pendingActionsStore-COTh4Ztq.js → pendingActionsStore-CxhI19V9.js} +1 -1
- package/dist/client/assets/{play-BAmkJfn6.js → play-uofLR7yT.js} +1 -1
- package/dist/client/assets/{plus-c75CkNEO.js → plus-D4CI6rj1.js} +1 -1
- package/dist/client/assets/{popover-CHM4skzh.js → popover-Bc646hKn.js} +1 -1
- package/dist/client/assets/{pushClient-BJH_ITRB.js → pushClient-CxnHu9h4.js} +1 -1
- package/dist/client/assets/runDetached-DfQXHAaY.js +1 -0
- package/dist/client/assets/{segmented-control-DNOwRupT.js → segmented-control-CKGX29Kl.js} +1 -1
- package/dist/client/assets/{select-dLHiAls6.js → select-BjeajpVt.js} +1 -1
- package/dist/client/assets/{settings-header-button-CGKCzFyk.js → settings-header-button-BYvHR6Xl.js} +1 -1
- package/dist/client/assets/{sidebarPendingActions-Dyp80Lv_.js → sidebarPendingActions-xgMTnfRY.js} +1 -1
- package/dist/client/assets/{square-pen-B1IxmScM.js → square-pen-DmppQdTd.js} +1 -1
- package/dist/client/assets/{state-mark-BhTZfcYe.js → state-mark-C3kEL1hX.js} +1 -1
- package/dist/client/assets/{status-pill-CwhJhaMy.js → status-pill-Bo1Nb6HX.js} +1 -1
- package/dist/client/assets/{terminal-Bnj7qFGw.js → terminal-DfCF-J4p.js} +1 -1
- package/dist/client/assets/{timer.adapter-DHt2zwsL.js → timer.adapter-C2RhP4d6.js} +1 -1
- package/dist/client/assets/{tools-3gJcj3hK.js → tools-t5T_3UBg.js} +1 -1
- package/dist/client/assets/{triangle-alert-CWrc0CIO.js → triangle-alert-CYQhobyY.js} +1 -1
- package/dist/client/assets/useAppGlobalState-DUa3pkCF.js +1 -0
- package/dist/client/assets/useKannaState-FcieR5qb.js +5 -0
- package/dist/client/assets/useTheme-D9sKDPEm.js +1 -0
- package/dist/client/index.html +35 -35
- package/package.json +2 -2
- package/src/server/agent-coordinator-types.ts +0 -6
- package/src/server/agent-coordinator.ts +6 -45
- package/src/server/agent.compaction.test.ts +1 -13
- package/src/server/agent.oauth-account-info.test.ts +0 -3
- package/src/server/agent.oauth-release.test.ts +0 -2
- package/src/server/agent.oauth-rotation.test.ts +0 -9
- package/src/server/agent.oauth-token-share-cap.test.ts +0 -1
- package/src/server/agent.openrouter-model.test.ts +0 -2
- package/src/server/agent.openrouter-watchdog.test.ts +0 -3
- package/src/server/agent.sdk-workflow-register.test.ts +2 -64
- package/src/server/agent.test.ts +1 -319
- package/src/server/app-settings.test.ts +14 -17
- package/src/server/app-settings.ts +22 -37
- package/src/server/auto-continue/e2e.test.ts +0 -1
- package/src/server/background-task-output-registry.test.ts +1 -1
- package/src/server/background-task-output-registry.ts +1 -1
- package/src/server/claude-cancel-handler.test.ts +0 -58
- package/src/server/claude-cancel-handler.ts +1 -17
- package/src/server/claude-harness-stream.test.ts +134 -0
- package/src/server/{claude-pty/jsonl-path.test.ts → claude-projects-path.adapter.test.ts} +1 -19
- package/src/server/{claude-pty/jsonl-path.adapter.ts → claude-projects-path.adapter.ts} +0 -11
- package/src/server/claude-send-command.test.ts +0 -1
- package/src/server/claude-session-config-helpers.test.ts +1 -90
- package/src/server/claude-session-config-helpers.ts +1 -38
- package/src/server/claude-session-error-handler.test.ts +0 -1
- package/src/server/claude-session-lifecycle.test.ts +2 -36
- package/src/server/claude-session-lifecycle.ts +2 -8
- package/src/server/claude-session-runner.test.ts +8 -36
- package/src/server/claude-session-runner.ts +1 -26
- package/src/server/claude-session-spawner.test.ts +5 -64
- package/src/server/claude-session-spawner.ts +49 -115
- package/src/server/claude-session-start.test.ts +1 -14
- package/src/server/claude-session-start.ts +0 -8
- package/src/server/claude-session-state-queries.test.ts +1 -2
- package/src/server/claude-session-state.test.ts +0 -1
- package/src/server/claude-session-state.ts +0 -4
- package/src/server/claude-subagent-wiring.test.ts +2 -68
- package/src/server/claude-subagent-wiring.ts +3 -50
- package/src/server/claude-turn-starter-types.ts +0 -3
- package/src/server/claude-turn-starter.test.ts +0 -28
- package/src/server/claude-turn-starter.ts +0 -5
- package/src/server/event-store.test.ts +0 -2
- package/src/server/events.ts +1 -2
- package/src/server/harness-types.ts +1 -2
- package/src/server/import-subagent-drill.e2e.test.ts +1 -1
- package/src/server/imported-subagents-dir.test.ts +1 -1
- package/src/server/imported-subagents-dir.ts +1 -1
- package/src/server/kanna-mcp.test.ts +0 -75
- package/src/server/kanna-mcp.ts +1 -47
- package/src/server/server.test.ts +5 -7
- package/src/server/server.ts +2 -18
- package/src/server/subagent-orchestrator.test.ts +0 -1
- package/src/server/subagent-provider-run.test.ts +48 -10
- package/src/server/subagent-provider-run.ts +12 -3
- package/src/server/tool-callback.test.ts +1 -1
- package/src/server/ws-router-agent-ctrl.test.ts +0 -45
- package/src/server/ws-router-agent-ctrl.ts +1 -31
- package/src/server/ws-router-broadcast.ts +0 -27
- package/src/server/ws-router-defaults.test.ts +2 -3
- package/src/server/ws-router-defaults.ts +2 -3
- package/src/server/ws-router-envelope.ts +0 -15
- package/src/server/ws-router-observability.test.ts +1 -1
- package/src/server/ws-router-settings.test.ts +2 -2
- package/src/server/ws-router.test.ts +2 -2
- package/src/server/ws-router.ts +0 -8
- package/src/shared/app-settings-types.ts +9 -20
- package/src/shared/claude-api-error-classification.ts +1 -1
- package/src/shared/protocol.ts +1 -11
- package/dist/client/assets/BoardsRoutePage-BTTjJX-Y.js +0 -1
- package/dist/client/assets/ChatPage-DH8wtQyD.js +0 -93
- package/dist/client/assets/SettingsPage-CKrZ6dGQ.js +0 -9
- package/dist/client/assets/chevron-left-CJ0qv9kF.js +0 -1
- package/dist/client/assets/editor-icons-CONDQZof.js +0 -1
- package/dist/client/assets/index-C-UYaDk6.css +0 -1
- package/dist/client/assets/runDetached-DqQ3k2ji.js +0 -1
- package/dist/client/assets/useAppGlobalState-DKOGrO5l.js +0 -1
- package/dist/client/assets/useKannaState-D7R_-dM6.js +0 -5
- package/dist/client/assets/useTheme-B57LIKyx.js +0 -1
- package/src/server/agent.pty-rotation.test.ts +0 -322
- package/src/server/claude-pty/auth.test.ts +0 -38
- package/src/server/claude-pty/auth.ts +0 -17
- package/src/server/claude-pty/claude-session-registry.adapter.ts +0 -68
- package/src/server/claude-pty/claude-session-registry.test.ts +0 -149
- package/src/server/claude-pty/driver.test.ts +0 -1153
- package/src/server/claude-pty/driver.ts +0 -829
- package/src/server/claude-pty/env.test.ts +0 -79
- package/src/server/claude-pty/env.ts +0 -20
- package/src/server/claude-pty/jsonl-to-event.test.ts +0 -882
- package/src/server/claude-pty/jsonl-to-event.ts +0 -357
- package/src/server/claude-pty/parity-matrix.test.ts +0 -437
- package/src/server/claude-pty/pid-registry.adapter.ts +0 -164
- package/src/server/claude-pty/pid-registry.test.ts +0 -178
- package/src/server/claude-pty/preflight/binary-fingerprint.adapter.ts +0 -20
- package/src/server/claude-pty/preflight/binary-fingerprint.test.ts +0 -32
- package/src/server/claude-pty/pty-instance-registry.test.ts +0 -208
- package/src/server/claude-pty/pty-instance-registry.ts +0 -172
- package/src/server/claude-pty/pty-memory-sampler.adapter.test.ts +0 -103
- package/src/server/claude-pty/pty-memory-sampler.adapter.ts +0 -86
- package/src/server/claude-pty/pty-process.adapter.ts +0 -60
- package/src/server/claude-pty/pty-process.test.ts +0 -49
- package/src/server/claude-pty/resolve-binary.adapter.ts +0 -106
- package/src/server/claude-pty/resolve-binary.test.ts +0 -118
- package/src/server/claude-pty/runtime-dir.adapter.ts +0 -19
- package/src/server/claude-pty/sandbox/detect.adapter.ts +0 -17
- package/src/server/claude-pty/sandbox/detect.test.ts +0 -17
- package/src/server/claude-pty/sandbox/platform.test.ts +0 -35
- package/src/server/claude-pty/sandbox/platform.ts +0 -27
- package/src/server/claude-pty/sandbox/preflight-io.adapter.ts +0 -14
- package/src/server/claude-pty/sandbox/preflight.test.ts +0 -69
- package/src/server/claude-pty/sandbox/preflight.ts +0 -44
- package/src/server/claude-pty/sandbox/profile-linux.adapter.ts +0 -63
- package/src/server/claude-pty/sandbox/profile-linux.test.ts +0 -90
- package/src/server/claude-pty/sandbox/profile-macos.adapter.ts +0 -72
- package/src/server/claude-pty/sandbox/profile-macos.test.ts +0 -68
- package/src/server/claude-pty/sandbox/wrap.adapter.ts +0 -58
- package/src/server/claude-pty/sandbox/wrap.test.ts +0 -82
- package/src/server/claude-pty/settings-writer.adapter.ts +0 -23
- package/src/server/claude-pty/settings-writer.test.ts +0 -22
- package/src/server/claude-pty/smoke-test-io.adapter.ts +0 -28
- package/src/server/claude-pty/smoke-test.test.ts +0 -199
- package/src/server/claude-pty/smoke-test.ts +0 -182
- package/src/server/claude-pty/tui-control.test.ts +0 -300
- package/src/server/claude-pty/tui-control.ts +0 -174
- package/src/server/claude-pty/tui-source.adapter.test.ts +0 -374
- package/src/server/claude-pty/tui-source.adapter.ts +0 -294
- package/src/server/http-server.adapter.test.ts +0 -18
- package/src/server/http-server.adapter.ts +0 -39
- package/src/server/kanna-mcp-http.test.ts +0 -274
- package/src/server/kanna-mcp-http.ts +0 -194
- package/src/server/kanna-mcp-tools/ask-user-question.test.ts +0 -108
- package/src/server/kanna-mcp-tools/ask-user-question.ts +0 -55
- package/src/server/kanna-mcp-tools/exit-plan-mode.test.ts +0 -61
- package/src/server/kanna-mcp-tools/exit-plan-mode.ts +0 -49
- package/src/server/mcp-zod-compat.adapter.ts +0 -20
- package/src/shared/pty-instance.ts +0 -43
- /package/src/server/{claude-pty/output-ring.test.ts → output-ring.test.ts} +0 -0
- /package/src/server/{claude-pty/output-ring.ts → output-ring.ts} +0 -0
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./react-DiVRNtpo.js";import{c as n,l as r,u as i}from"./chunk-OB3PAWPO-mARpRU1A.js";import{t as a}from"./jsx-runtime-BdxMnOeJ.js";import{$ as o,At as s,Ct as c,Dt as l,Et as u,H as d,J as f,L as p,M as m,N as h,Ot as g,St as _,Tt as v,V as y,Vt as b,X as x,Z as S,_t as ee,at as C,b as w,bt as T,cn as E,dn as te,dt as D,et as ne,fn as re,ft as ie,gt as ae,it as O,jt as oe,kt as k,lt as A,n as se,nt as ce,o as le,ot as ue,pt as de,rt as j,sn as fe,st as pe,tt as me,un as he,ut as ge,vt as _e,wt as ve,xt as ye,yt as be,z as xe}from"./useAppGlobalState-DKOGrO5l.js";import{a as Se,c as Ce,d as we,f as Te,p as Ee,s as De}from"./log-aTaDVF_e.js";import{a as M,c as N,d as P,f as F,n as I,o as Oe,r as L,s as R,t as z}from"./pendingActionsStore-COTh4Ztq.js";import{c as ke,f as Ae,l as je,n as Me,p as Ne,r as Pe,u as Fe}from"./editor-icons-CONDQZof.js";import{Bt as Ie,Vt as Le,t as Re,zt as ze}from"./lexicalToReact-sPUyOWk6.js";import{n as Be,t as Ve}from"./clipboard.adapter-GN9nnYak.js";import{a as He,i as B,n as Ue,o as We,r as Ge,t as Ke}from"./select-dLHiAls6.js";import{a as qe,f as Je,h as Ye,i as Xe,l as Ze,m as Qe,n as $e,o as et,p as tt,t as nt}from"./pushClient-BJH_ITRB.js";import{t as rt}from"./info-D4MMvZFe.js";import{t as V}from"./monitor-_CRKcV1h.js";import{t as it}from"./pencil-fNBeUUCf.js";import{t as at}from"./plus-c75CkNEO.js";import{g as ot,i as st,n as ct,o as lt,r as ut,t as dt,u as ft}from"./timer.adapter-DHt2zwsL.js";import{a as pt,c as mt,o as ht,s as gt,t as _t}from"./segmented-control-DNOwRupT.js";import{t as H}from"./input-C4fvDiQ4.js";import{S as U,_ as vt,b as yt,d as bt,f as xt,g as St,h as Ct,m as wt,p as Tt,r as Et,v as Dt,x as Ot,y as kt}from"./useTheme-B57LIKyx.js";import{t as At}from"./runDetached-DqQ3k2ji.js";import{t as jt}from"./chatSounds-FD2DQzF6.js";import{i as Mt,r as Nt,t as Pt}from"./status-pill-CwhJhaMy.js";import{t as Ft}from"./settings-header-button-CGKCzFyk.js";var It={name:`book-text`,size:24,node:[[`path`,{d:`M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20`,key:`k3hazp`}],[`path`,{d:`M8 11h8`,key:`vwpz6n`}],[`path`,{d:`M8 7h6`,key:`1f0q6e`}]]};It.node;var Lt=F(It),Rt={name:`circle-arrow-up`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 12-4-4-4 4`,key:`177agl`}],[`path`,{d:`M12 16V8`,key:`1sbj14`}]],aliases:[`arrow-up-circle`]};Rt.node;var zt=F(Rt),Bt={name:`cloud-download`,size:24,node:[[`path`,{d:`M12 13v8l-4-4`,key:`1f5nwf`}],[`path`,{d:`m12 21 4-4`,key:`1lfcce`}],[`path`,{d:`M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284`,key:`ui1hmy`}]],aliases:[`download-cloud`]};Bt.node;var Vt=F(Bt),Ht={name:`command`,size:24,node:[[`path`,{d:`M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3`,key:`11bfej`}]]};Ht.node;var Ut=F(Ht),Wt={name:`cpu`,size:24,node:[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]};Wt.node;var Gt=F(Wt),Kt={name:`flask-conical`,size:24,node:[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]};Kt.node;var qt=F(Kt),Jt={name:`log-out`,size:24,node:[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]};Jt.node;var Yt=F(Jt),Xt={name:`message-square-quote`,size:24,node:[[`path`,{d:`M14 14a2 2 0 0 0 2-2V8h-2`,key:`1r06pg`}],[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M8 14a2 2 0 0 0 2-2V8H8`,key:`1jzu5j`}]]};Xt.node;var Zt=F(Xt),Qt={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};Qt.node;var $t=F(Qt),en={name:`plug`,size:24,node:[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]};en.node;var tn=F(en),nn={name:`power-off`,size:24,node:[[`path`,{d:`M18.36 6.64A9 9 0 0 1 20.77 15`,key:`dxknvb`}],[`path`,{d:`M6.16 6.16a9 9 0 1 0 12.68 12.68`,key:`1x7qb5`}],[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};nn.node;var rn=F(nn),an={name:`power`,size:24,node:[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]};an.node;var on=F(an),sn={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]};sn.node;var cn=F(sn),ln={name:`type`,size:24,node:[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]};ln.node;var un=F(ln),dn={enabled:!1,cloudflaredPath:`cloudflared`,mode:`always-ask`},W=e(t(),1),G=e(a(),1);function fn(e){let t=e.trim();if(t.startsWith(`https://`))try{let e=new URL(t);if(e.protocol!==`https:`)return!1;let n=e.hostname.toLowerCase();return!(n===`localhost`||!n.includes(`.`)||n.startsWith(`.`)||n.endsWith(`.`))}catch{return!1}if(t.startsWith(`mailto:`)){let e=t.slice(7),n=/^[^\s@]+@([^\s@]+)$/.exec(e);if(!n)return!1;let r=n[1].toLowerCase();return!(r===`localhost`||!r.includes(`.`)||r.startsWith(`.`)||r.endsWith(`.`))}return!1}var pn={maxFileSizeMb:100},mn=2048,hn=`gpt-5.4-mini`;function gn(e){return e===`previous-assistant-reply`||e===`full-transcript`}function _n(e){return e===`auto`||e===`manual`}var vn=[`app_launch`,`project_opened`,`project_created`,`project_removed`,`project_deleted`,`chat_created`,`chat_deleted`,`message_sent`,`update_checked`,`update_installed`,`update_failed`,`analytics_enabled`,`analytics_disabled`],yn=[`current_version`,`environment`,`latest_version`,`custom_port_enabled`,`no_open_enabled`,`password_enabled`,`strict_port_enabled`,`remote_enabled`,`host_enabled`,`share_quick_enabled`,`share_token_enabled`];function K(){return{name:``,provider:`claude`,model:A(`claude`).defaultModel,modelOptions:{...j},systemPrompt:``,contextScope:`previous-assistant-reply`,triggerMode:`auto`}}function bn(){return{draft:K(),error:null,pending:!1,confirmDelete:!1}}var q=Ce()(e=>({editing:{kind:`list`},form:bn(),timeoutDraft:``,loopError:null,setEditing:t=>e({editing:t}),resetForm:t=>e({form:{draft:t,error:null,pending:!1,confirmDelete:!1}}),patchForm:t=>e(e=>({form:{...e.form,...t}})),patchFormDraft:t=>e(e=>({form:{...e.form,draft:{...e.form.draft,...t}}})),setTimeoutDraft:t=>e({timeoutDraft:t}),setLoopError:t=>e({loopError:t})}));function xn(e){return`contextWindow`in e}function Sn(e){return`fastMode`in e}function Cn(e){let t=e.editing,n=(0,W.useMemo)(()=>t.kind===`edit`?e.subagents.find(e=>e.id===t.id)??null:null,[t,e.subagents]),r=t.kind,i=r!==`list`,a=e.subagents.length===0;return a&&!i?(0,G.jsx)(wn,{onStartCreate:e.onStartCreate}):(0,G.jsxs)(`div`,{className:`flex flex-col gap-6 md:flex-row md:items-start md:gap-8`,children:[a?null:(0,G.jsx)(En,{subagents:e.subagents,editing:e.editing,onSelect:e.onSelect,onStartCreate:e.onStartCreate}),i?(0,G.jsx)(jn,{mode:r,subject:r===`edit`?n:null,providerDefaults:e.providerDefaults,availableProviders:e.availableProviders,handlers:e.handlers,onCancelEditing:e.onCancelEditing},r===`edit`?n?.id??`edit`:`create`):(0,G.jsx)(Tn,{})]})}function wn(e){return(0,G.jsxs)(`div`,{className:`flex w-full flex-col items-center gap-4 rounded-lg border border-dashed border-border px-6 py-14 text-center`,"data-testid":`subagent-empty`,children:[(0,G.jsx)(`div`,{className:`flex size-10 items-center justify-center rounded-full bg-muted text-muted-foreground`,children:(0,G.jsx)(Ne,{className:`size-5`,"aria-hidden":!0})}),(0,G.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:`No subagents yet`}),(0,G.jsxs)(M,{variant:`default`,size:`sm`,onClick:e.onStartCreate,children:[(0,G.jsx)(at,{className:`mr-1.5 size-4`}),` Create subagent`]})]})}function Tn(){return(0,G.jsx)(`div`,{className:`hidden flex-1 items-center justify-center rounded-lg border border-dashed border-border px-6 py-12 text-center text-sm text-muted-foreground md:flex`,children:`Select a subagent to edit, or create a new one.`})}function En(e){let t=e.editing.kind===`edit`?e.editing.id:null;return(0,G.jsxs)(`aside`,{className:`flex w-full flex-col gap-2 md:w-64 md:flex-shrink-0`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,G.jsxs)(`span`,{className:`text-xs font-medium tracking-wide text-muted-foreground`,style:{fontVariantNumeric:`tabular-nums`},children:[e.subagents.length,` `,e.subagents.length===1?`agent`:`agents`]}),(0,G.jsxs)(M,{variant:`ghost`,size:`sm`,onClick:e.onStartCreate,"data-testid":`subagent-create`,children:[(0,G.jsx)(at,{className:`size-4`}),(0,G.jsx)(`span`,{className:`sr-only`,children:`Create subagent`})]})]}),(0,G.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:e.subagents.map(n=>{let r=n.description?.trim()||(n.contextScope===`previous-assistant-reply`?`Last reply`:`Full transcript`);return(0,G.jsx)(`li`,{children:(0,G.jsxs)(`button`,{type:`button`,"data-testid":`subagent-row:${n.id}`,onClick:()=>e.onSelect(n.id),className:N(`flex w-full flex-col items-start gap-0.5 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-muted`,t===n.id&&`bg-muted`),children:[(0,G.jsxs)(`span`,{className:`flex w-full items-center justify-between gap-2`,children:[(0,G.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,children:n.name}),(0,G.jsx)(Dn,{provider:n.provider})]}),(0,G.jsx)(`span`,{className:`w-full truncate text-xs text-muted-foreground`,children:r})]})},n.id)})})]})}function Dn({provider:e}){let t=A(e).label;return(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded border border-border bg-card px-1.5 py-0.5 text-xs font-medium tracking-wide text-muted-foreground`,children:[(0,G.jsx)(Ne,{className:`size-3`}),` `,t]})}var On=[{value:`claude`,label:`Claude`},{value:`codex`,label:`Codex`},{value:`openrouter`,label:`OpenRouter`}];function kn(e,t){return t.length===0?e:e.map(e=>e.id===`openrouter`?{...e,models:t.map(e=>({id:e.id,label:e.label}))}:e)}var J=[{value:`previous-assistant-reply`,label:`Last reply`},{value:`full-transcript`,label:`Full transcript`}],An=[{value:`auto`,label:`Auto`},{value:`manual`,label:`Manual`}];function jn(e){let t=(0,W.useMemo)(()=>e.mode===`edit`&&e.subject?Bn(e.subject):zn(`claude`,e.providerDefaults,e.availableProviders),[e.mode,e.subject,e.providerDefaults,e.availableProviders]),n=q(e=>e.resetForm),r=q(e=>e.form),i=q(e=>e.patchFormDraft),a=q(e=>e.patchForm);(0,W.useEffect)(()=>{n(t)},[]);let{draft:s,error:c,pending:l,confirmDelete:u}=r,d=c?.field===`name`?c.message:null,f=c?.field===`general`?c.message:null,p=Hn(s,t),m=s.name.trim().length>0&&(e.mode===`create`||p);function h(e){i(e),c?.field===`name`&&`name`in e&&a({error:null})}function g(t){if(t===s.provider)return;let n=zn(t,e.providerDefaults,e.availableProviders);i({provider:t,model:n.model,modelOptions:n.modelOptions})}function _(e){if(s.provider!==`claude`)return;let t=xn(s.modelOptions)?s.modelOptions:j;i({modelOptions:{...j,...t,reasoningEffort:e}})}function v(e){if(s.provider!==`claude`)return;let t=xn(s.modelOptions)?s.modelOptions:j;i({modelOptions:{...j,...t,contextWindow:e}})}function y(e){if(s.provider!==`codex`)return;let t=Sn(s.modelOptions)?s.modelOptions:O;i({modelOptions:{...O,...t,reasoningEffort:e}})}async function b(){if(m&&!l){a({pending:!0,error:null,confirmDelete:!1});try{let t=e.mode===`create`?await e.handlers.onCreate(s):await e.handlers.onUpdate(e.subject.id,s);t.ok||a({error:Wn(t.error)})}catch(e){a({error:{field:`general`,message:Te(e)}})}finally{a({pending:!1})}}}async function x(){if(e.mode===`edit`&&e.subject){if(!u){a({confirmDelete:!0});return}a({pending:!0,error:null});try{await e.handlers.onDelete(e.subject.id)}catch(e){a({error:{field:`general`,message:Te(e)}})}finally{a({pending:!1,confirmDelete:!1})}}}let S=s.provider===`claude`?{...j,...xn(s.modelOptions)?s.modelOptions:{}}:null,ee=s.provider===`codex`?{...O,...Sn(s.modelOptions)?s.modelOptions:{}}:null,C=e.availableProviders.find(e=>e.id===s.provider)??A(s.provider);return(0,G.jsxs)(`section`,{className:`flex w-full flex-1 flex-col gap-4`,children:[(0,G.jsxs)(`header`,{className:`flex flex-col gap-1`,children:[(0,G.jsx)(`h3`,{className:`text-base font-medium text-foreground`,children:e.mode===`create`?`New subagent`:s.name||`Subagent`}),(0,G.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Mention with `,(0,G.jsxs)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-xs`,children:[`@agent/`,s.name||`<name>`]}),` in chat.`]})]}),f?(0,G.jsx)(`div`,{className:`rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-sm text-destructive`,children:f}):null,(0,G.jsx)(Y,{label:`Name`,hint:d,hintTone:d?`destructive`:`muted`,children:(0,G.jsx)(H,{"data-testid":`subagent-form-name`,value:s.name,onChange:e=>h({name:Gn(e.target.value)}),maxLength:64,placeholder:`reviewer`,className:`font-mono`})}),(0,G.jsx)(Y,{label:`Description`,hint:`Optional. Shown next to the name.`,children:(0,G.jsx)(H,{"data-testid":`subagent-form-description`,value:s.description??``,onChange:e=>h({description:e.target.value}),placeholder:`Reviews diffs against the repo style`})}),(0,G.jsx)(Y,{label:`Provider`,children:(0,G.jsx)(_t,{value:s.provider,onValueChange:e=>{o(e)&&g(e)},options:On,size:`sm`})}),(0,G.jsx)(Y,{label:`Model`,children:(0,G.jsxs)(Ke,{value:s.model,onValueChange:e=>h({model:e}),children:[(0,G.jsx)(He,{"data-testid":`subagent-form-model`,className:`w-full md:w-72`,children:(0,G.jsx)(We,{placeholder:`Select a model`})}),(0,G.jsx)(Ue,{children:C.models.map(e=>(0,G.jsx)(B,{value:e.id,children:e.label},e.id))})]})}),S?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Y,{label:`Reasoning effort`,children:(0,G.jsx)(_t,{value:S.reasoningEffort,onValueChange:e=>{D(e)&&_(e)},options:me.map(e=>({value:e.id,label:e.label})),size:`sm`})}),(0,G.jsx)(Y,{label:`Context window`,children:(0,G.jsx)(_t,{value:S.contextWindow,onValueChange:e=>{ge(e)&&v(e)},options:ne.map(e=>({value:e.id,label:e.label})),size:`sm`})})]}):null,ee?(0,G.jsx)(Y,{label:`Reasoning effort`,children:(0,G.jsx)(_t,{value:ee.reasoningEffort,onValueChange:e=>{ie(e)&&y(e)},options:ce.map(e=>({value:e.id,label:e.label})),size:`sm`})}):null,(0,G.jsx)(Y,{label:`Context scope`,children:(0,G.jsx)(_t,{value:s.contextScope,onValueChange:e=>{gn(e)&&h({contextScope:e})},options:J,size:`sm`})}),(0,G.jsx)(Y,{label:`Trigger`,hint:`Auto: the main agent may delegate on its own. Manual: only runs when you @-mention it.`,children:(0,G.jsx)(_t,{value:s.triggerMode??`auto`,onValueChange:e=>{_n(e)&&h({triggerMode:e})},options:An,size:`sm`})}),(0,G.jsx)(Y,{label:`System prompt`,hint:`What this persona should focus on. Plain text.`,children:(0,G.jsx)(Je,{"data-testid":`subagent-form-system-prompt`,value:s.systemPrompt,onChange:e=>h({systemPrompt:e.target.value}),placeholder:`You are a careful code reviewer...`,rows:6,className:`min-h-32`})}),(0,G.jsx)(Y,{label:`Max turns`,hint:`Optional. Caps the agentic turns per run (like Claude Code's per-agent maxTurns). Empty = unbounded. Claude SDK runs stop gracefully at the limit; PTY/Codex runs are aborted.`,children:(0,G.jsx)(H,{"data-testid":`subagent-form-max-turns`,type:`number`,min:1,step:1,value:s.maxTurns?.toString()??``,onChange:e=>{let t=Number.parseInt(e.target.value,10);h({maxTurns:Number.isInteger(t)&&t>0?t:void 0})},placeholder:`unbounded`,className:`w-36`})}),s.provider===`claude`?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Y,{label:`Working directory`,hint:`Optional. Relative to the parent chat cwd. Restricts the subagent's filesystem access to this subtree.`,children:(0,G.jsx)(H,{"data-testid":`subagent-form-working-dir`,value:s.workingDir??``,onChange:e=>{let t=e.target.value;h({workingDir:t.length>0?t:void 0})},placeholder:`docs`})}),(0,G.jsx)(Y,{label:`Allowed paths`,hint:`Optional. Newline-separated, relative to the parent chat cwd. When set, file tools can only read/write inside these roots.`,children:(0,G.jsx)(Je,{"data-testid":`subagent-form-allowed-paths`,value:(s.allowedPaths??[]).join(`
|
|
2
|
-
`),onChange:e=>{let t=e.target.value.split(/\r?\n/).map(e=>e.trim()).filter(e=>e.length>0);h({allowedPaths:t.length>0?t:void 0})},placeholder:`docs
|
|
3
|
-
wiki`,rows:3})})]}):null,(0,G.jsxs)(`footer`,{className:`flex flex-wrap items-center justify-end gap-2 pt-2`,children:[(0,G.jsx)(M,{variant:`ghost`,size:`sm`,onClick:e.onCancelEditing,children:`Cancel`}),e.mode===`edit`?(0,G.jsx)(M,{variant:`destructive`,size:`sm`,"data-testid":`subagent-form-delete`,disabled:l,pending:l&&u,onClick:()=>{I(z(`subagent.delete`,e.subject?.id??``),x)},children:u?`Confirm delete`:`Delete`}):null,(0,G.jsx)(M,{variant:`default`,size:`sm`,"data-testid":`subagent-form-save`,disabled:!m||l,pending:l&&!u,onClick:()=>{I(z(`subagent.save`,e.subject?.id??`new`),b)},children:l?`Saving…`:`Save`})]})]})}function Y(e){return(0,G.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,G.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:e.label}),e.children,e.hint?(0,G.jsx)(`span`,{className:N(`text-xs`,e.hintTone===`destructive`?`text-destructive`:`text-muted-foreground`),children:e.hint}):null]})}var Mn=[],Nn={claude:{model:A(`claude`).defaultModel,modelOptions:{...j},planMode:!1},codex:{model:A(`codex`).defaultModel,modelOptions:{...O},planMode:!1},openrouter:{model:C,modelOptions:{},planMode:!1}};function Pn(e){let t=U(e=>e.settings?.subagents??Mn),n=U(e=>e.settings?.providerDefaults??Nn),r=U(wt),i=m(Mt(e=>e.models)),a=(0,W.useMemo)(()=>kn(de([...ue],r),i),[r,i]),o=q(e=>e.editing),s=q(e=>e.setEditing),c=(0,W.useMemo)(()=>({onCreate:async t=>{let n=await e.state.socket.command({type:`subagent.create`,input:t});return n.ok&&s({kind:`edit`,id:n.subagent.id}),n},onUpdate:async(t,n)=>await e.state.socket.command({type:`subagent.update`,id:t,patch:{...n,maxTurns:n.maxTurns??null}}),onDelete:async t=>{await e.state.socket.command({type:`subagent.delete`,id:t}),s({kind:`list`})}}),[e.state.socket,s]),l=(0,W.useCallback)(e=>{s({kind:`edit`,id:e})},[s]),u=(0,W.useCallback)(()=>{s({kind:`create`})},[s]),d=(0,W.useCallback)(()=>{s({kind:`list`})},[s]);return(0,G.jsxs)(`div`,{className:`flex flex-col gap-6 px-6 py-6`,children:[(0,G.jsx)(X,{subagents:t,handleWriteAppSettings:e.state.handleWriteAppSettings}),(0,G.jsx)(Cn,{subagents:t,providerDefaults:n,availableProviders:a,editing:o,onSelect:l,onStartCreate:u,onCancelEditing:d,handlers:c})]})}var Fn=`__none__`,In=30,Ln=86400,Rn=600;function X(e){let t=U(e=>e.settings?.subagentRuntime),n=t?Math.round(t.runTimeoutMs/1e3):Rn,r=t?.defaultLoopSubagentId??null,i=q(e=>e.timeoutDraft),a=q(e=>e.setTimeoutDraft),o=q(e=>e.loopError),s=q(e=>e.setLoopError);(0,W.useEffect)(()=>{a(String(n))},[n]);function c(){let t=Number(i);if(!Number.isInteger(t)||t<In||t>Ln){a(String(n)),s(`Timeout must be a whole number of seconds between ${In} and ${Ln}.`);return}s(null),t!==n&&e.handleWriteAppSettings({subagentRuntime:{runTimeoutMs:t*1e3}}).catch(e=>s(e instanceof Error?e.message:`Unable to save subagent runtime settings.`))}function l(t){s(null);let n=t===Fn?null:t;e.handleWriteAppSettings({subagentRuntime:{defaultLoopSubagentId:n}}).catch(e=>s(e instanceof Error?e.message:`Unable to save default loop subagent.`))}return(0,G.jsxs)(`section`,{className:`flex flex-col gap-4 rounded-lg border border-border/60 bg-card/40 p-4`,children:[(0,G.jsxs)(`header`,{className:`flex flex-col gap-1`,children:[(0,G.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:`Loop & runtime`}),(0,G.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Applies to background subagent runs and the autonomous `,(0,G.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono`,children:`/loop`}),`.`]})]}),o?(0,G.jsx)(`div`,{className:`rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive`,children:o}):null,(0,G.jsx)(Y,{label:`Stall timeout (seconds)`,hint:`A subagent run is aborted only after this long with no streamed activity — not a total wall-clock cap. A steadily-working run is never killed.`,children:(0,G.jsx)(H,{type:`number`,inputMode:`numeric`,min:In,max:Ln,value:i,onChange:e=>a(e.target.value),onBlur:c,onKeyDown:e=>{e.key===`Enter`&&(c(),e.currentTarget.blur())},className:`w-full md:w-48 tabular-nums`})}),(0,G.jsx)(Y,{label:`Default loop subagent`,hint:`The subagent setup_loop delegates each chunk to when no explicit id is given.`,children:(0,G.jsxs)(Ke,{value:r??Fn,onValueChange:l,children:[(0,G.jsx)(He,{className:`w-full md:w-72`,children:(0,G.jsx)(We,{placeholder:`None`})}),(0,G.jsxs)(Ue,{children:[(0,G.jsx)(B,{value:Fn,children:`None (require explicit id)`}),e.subagents.map(e=>(0,G.jsx)(B,{value:e.id,children:e.name},e.id))]})]})})]})}var Z=new Set([`EMPTY_NAME`,`INVALID_CHAR`,`RESERVED_NAME`,`DUPLICATE_NAME`,`TOO_LONG`]);function zn(e,t,n){if(e===`claude`){let r=t?.claude;return{name:``,provider:e,model:r?.model??n?.find(e=>e.id===`claude`)?.defaultModel??A(`claude`).defaultModel,modelOptions:{...r?.modelOptions??{...j}},systemPrompt:``,contextScope:`previous-assistant-reply`,triggerMode:`auto`}}if(e===`openrouter`)return{name:``,provider:e,model:t?.openrouter?.model??n?.find(e=>e.id===`openrouter`)?.defaultModel??A(`openrouter`).defaultModel,modelOptions:{},systemPrompt:``,contextScope:`previous-assistant-reply`,triggerMode:`auto`};let r=t?.codex;return{name:``,provider:e,model:r?.model??n?.find(e=>e.id===`codex`)?.defaultModel??A(`codex`).defaultModel,modelOptions:{...r?.modelOptions??{...O}},systemPrompt:``,contextScope:`previous-assistant-reply`,triggerMode:`auto`}}function Bn(e){return{name:e.name,description:e.description,provider:e.provider,model:e.model,modelOptions:e.modelOptions,systemPrompt:e.systemPrompt,contextScope:e.contextScope,triggerMode:e.triggerMode,workingDir:e.workingDir,allowedPaths:e.allowedPaths,maxTurns:e.maxTurns}}var Vn=(e,t)=>{if(e===t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0};function Hn(e,t){return e.name!==t.name||(e.description??``)!==(t.description??``)||e.provider!==t.provider||e.model!==t.model||e.systemPrompt!==t.systemPrompt||e.contextScope!==t.contextScope||(e.triggerMode??`auto`)!==(t.triggerMode??`auto`)||(e.workingDir??``)!==(t.workingDir??``)||!Vn(e.allowedPaths,t.allowedPaths)||(e.maxTurns??null)!==(t.maxTurns??null)||!Un(e.modelOptions,t.modelOptions)}function Un(e,t){if(!Ee(e)||!Ee(t))return!1;let n=new Set([...Object.keys(e),...Object.keys(t)]);for(let r of n)if(e[r]!==t[r])return!1;return!0}function Wn(e){return Z.has(e.code)?{field:`name`,message:e.message}:{field:`general`,message:e.message}}function Gn(e){return e.toLowerCase().replace(/[^a-z0-9_-]+/g,`-`).slice(0,64)}function Q({title:e,description:t,children:n,bordered:r=!0,alignStart:i=!1}){return(0,G.jsx)(`div`,{className:r?`border-t border-border`:void 0,children:(0,G.jsxs)(`div`,{className:N(`flex flex-col gap-4 py-5 md:flex-row md:justify-between md:gap-8`,i?`md:items-start`:`md:items-center`),children:[(0,G.jsxs)(`div`,{className:`min-w-0 max-w-xl`,children:[(0,G.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:e}),(0,G.jsx)(`div`,{className:`mt-1 text-13 text-muted-foreground`,children:t})]}),(0,G.jsx)(`div`,{className:`flex items-center justify-start md:shrink-0 md:justify-end`,children:n})]})})}function Kn({icon:e,message:t}){return(0,G.jsxs)(`div`,{className:`flex flex-col items-center justify-center rounded-md border border-dashed px-6 py-10 text-center`,children:[(0,G.jsx)(e,{className:`mb-3 h-8 w-8 text-muted-foreground`,"aria-hidden":!0}),(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t})]})}function qn({children:e}){return(0,G.jsx)(`ul`,{className:`flex flex-col divide-y rounded-md border`,children:e})}function Jn({label:e,onEdit:t,onDelete:n,deletePending:r=!1}){return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(M,{variant:`ghost`,size:`sm`,onClick:t,"aria-label":`Edit ${e}`,children:(0,G.jsx)(it,{className:`h-4 w-4`})}),(0,G.jsx)(M,{variant:`ghost`,size:`sm`,onClick:n,pending:r,"aria-label":`Delete ${e}`,children:(0,G.jsx)(fe,{className:`h-4 w-4`})})]})}var Yn=new Set;function Xn(e){return{name:e?.name??``,transport:e?.transport??`stdio`,command:e?.transport===`stdio`?e.command:``,argsText:e?.transport===`stdio`?e.args.join(`
|
|
4
|
-
`):``,envText:e?.transport===`stdio`?Object.entries(e.env).map(([e,t])=>`${e}=${t}`).join(`
|
|
5
|
-
`):``,cwd:e?.transport===`stdio`?e.cwd??``:``,url:e!==null&&e.transport!==`stdio`?e.url:``,headersText:e!==null&&e.transport!==`stdio`?Object.entries(e.headers).map(([e,t])=>`${e}: ${t}`).join(`
|
|
6
|
-
`):``,error:null,submitting:!1,oauthEnabled:e!==null&&e.transport!==`stdio`?e.oauth?.enabled??!1:!1,authFlowUrl:null,callbackInput:``,oauthError:null,authenticating:!1,completing:!1}}var Zn=Ce()(e=>({editing:{kind:`list`},testingServerIds:Yn,editorForm:Xn(null),setEditing:t=>e({editing:t}),setServerTesting:(t,n)=>e(e=>{let r=new Set(e.testingServerIds);return n?r.add(t):r.delete(t),{testingServerIds:r.size===0?Yn:r}}),resetEditorForm:t=>e({editorForm:Xn(t)}),patchEditorForm:t=>e(e=>({editorForm:{...e.editorForm,...t}}))}));function Qn(e,t){return(0,W.useMemo)(()=>({onCreate:async n=>{await t.handleWriteAppSettings(e({create:n}))},onUpdate:async(n,r)=>{await t.handleWriteAppSettings(e({update:{id:n,patch:r}}))},onDelete:async n=>{await t.handleWriteAppSettings(e({delete:{id:n}}))}}),[e,t])}async function $n(e){e.patch({submitting:!0,error:null});try{await e.save(),e.onDone()}catch(t){e.patch({error:t instanceof Error?t.message:e.fallbackMessage})}finally{e.patch({submitting:!1})}}function er(e){return e.submitting?`Saving…`:e.isEdit?`Save changes`:e.addLabel}function tr({server:e,handlers:t,onEdit:n,dom:r=we}){let i=Zn(t=>t.testingServerIds.has(e.id)),a=Zn(e=>e.setServerTesting),o=(0,W.useCallback)(async()=>{a(e.id,!0);try{await t.onTest(e.id)}finally{a(e.id,!1)}},[t,e.id,a]),s=z(`mcpServers.delete`,e.id),c=L(s),l=z(`mcpServers.setEnabled`,e.id),u=L(l),d=z(`settings.testMcpServer`,e.id),f=(0,W.useCallback)(()=>{r.confirmDialog(`Delete MCP server "${e.name}"?`)&&I(s,()=>t.onDelete(e.id))},[s,r,t,e.id,e.name]),p=(0,W.useCallback)(n=>{let r=n.target.checked;I(l,()=>t.onSetEnabled(e.id,r))},[t,e.id,l]),m=(0,W.useCallback)(()=>{I(d,o)},[o,d]);return(0,G.jsxs)(`li`,{className:`flex items-center gap-3 px-4 py-3`,"aria-busy":c||void 0,children:[(0,G.jsxs)(`div`,{className:`flex flex-col`,children:[(0,G.jsx)(`span`,{className:`font-medium`,children:e.name}),(0,G.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[(0,G.jsx)(nr,{transport:e.transport}),(0,G.jsx)(`span`,{className:`ml-2`,children:e.transport===`stdio`?e.command:e.url})]})]}),(0,G.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,G.jsx)(rr,{result:e.lastTest,pending:i}),e.transport!==`stdio`&&(0,G.jsx)(ir,{oauth:e.oauth}),(0,G.jsxs)(`label`,{className:`inline-flex cursor-pointer items-center gap-1 text-xs text-muted-foreground`,children:[u?(0,G.jsx)(R,{}):null,(0,G.jsx)(`input`,{type:`checkbox`,checked:e.enabled,disabled:u,"aria-busy":u||void 0,onChange:p,"aria-label":`Enabled`}),(0,G.jsx)(`span`,{children:`On`})]}),(0,G.jsx)(M,{variant:`ghost`,size:`sm`,onClick:m,disabled:i,"aria-busy":i||void 0,title:`Test connection`,children:(0,G.jsx)(Le,{className:N(`h-4 w-4`,i&&`animate-spin`)})}),(0,G.jsx)(Jn,{label:e.name,onEdit:n,onDelete:f,deletePending:c})]})]})}function nr({transport:e}){return(0,G.jsx)(`span`,{className:`rounded bg-muted px-1.5 py-0.5 text-xs`,children:e})}function rr({result:e,pending:t}){if(t||e.status===`pending`)return(0,G.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Testing…`});switch(e.status){case`ok`:return(0,G.jsxs)(`span`,{className:`text-xs text-green-600`,children:[`OK · `,e.toolCount,` tools`]});case`error`:return(0,G.jsx)(tt,{label:e.message,children:(0,G.jsx)(`span`,{className:`text-xs text-red-600`,children:`Failed`})});default:return(0,G.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Untested`})}}function ir({oauth:e}){if(!e?.enabled)return null;switch(e.status){case`authenticated`:return(0,G.jsx)(`span`,{className:`text-xs text-green-600`,children:`OAuth ✓`});case`error`:return(0,G.jsx)(tt,{label:e.errorMessage,children:(0,G.jsx)(`span`,{className:`text-xs text-red-600`,children:`OAuth error`})});default:return(0,G.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`OAuth: unauth`})}}var ar=new Set([`stdio`,`http`,`sse`,`ws`]);function or(e){return ar.has(e)}var sr=`new`,cr=e=>({customMcpServers:e});function lr(e){return e.editing.kind===`list`?e.servers.length===0?(0,G.jsxs)(`div`,{className:`flex flex-col items-center justify-center px-6 py-16 text-center`,children:[(0,G.jsx)(tn,{className:`mb-4 h-10 w-10 text-muted-foreground`,"aria-hidden":!0}),(0,G.jsx)(`h2`,{className:`text-lg font-medium`,children:`No custom MCP servers`}),(0,G.jsx)(`p`,{className:`mt-2 max-w-md text-sm text-muted-foreground`,children:`Install MCP servers to extend the model's tool surface. Supports stdio, http, sse, and ws transports.`}),(0,G.jsxs)(M,{className:`mt-6`,onClick:e.onStartCreate,children:[(0,G.jsx)(at,{className:`mr-1 h-4 w-4`}),`Add server`]})]}):(0,G.jsxs)(`div`,{className:`flex flex-col gap-3 px-6 py-6`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,G.jsx)(`h2`,{className:`text-base font-medium`,children:`Custom MCP servers`}),(0,G.jsxs)(M,{size:`sm`,onClick:e.onStartCreate,children:[(0,G.jsx)(at,{className:`mr-1 h-4 w-4`}),`Add server`]})]}),(0,G.jsx)(qn,{children:e.servers.map(t=>(0,G.jsx)(tr,{server:t,handlers:e.handlers,onEdit:()=>e.onSelect(t.id)},t.id))})]}):(0,G.jsx)(ur,{initial:e.editing.kind===`edit`?e.servers.find(t=>e.editing.kind===`edit`&&t.id===e.editing.id)??null:null,existingNames:e.servers.map(e=>({id:e.id,name:e.name})),onCancel:e.onCancelEditing,handlers:e.handlers})}function ur({initial:e,existingNames:t,onCancel:n,handlers:r,clipboard:i=Ve}){let a=Zn(e=>e.editorForm),o=Zn(e=>e.resetEditorForm),s=Zn(e=>e.patchEditorForm),c=(0,W.useCallback)(e=>{or(e)&&s({transport:e})},[s]),{name:l,transport:u,command:d,argsText:f,envText:p,cwd:m,url:h,headersText:g,error:_,submitting:v,oauthEnabled:y,authFlowUrl:b,callbackInput:x,oauthError:S,authenticating:ee,completing:C}=a,w=(0,W.useRef)(e);(0,W.useEffect)(()=>{o(w.current)},[o]);let T=e!==null&&e.transport!==`stdio`?e.oauth:void 0,E=e?.id??sr,te=z(`mcpServers.toggleOAuth`,E),D=L(te),ne=z(`mcpServers.copyAuthUrl`,E),re=L(ne),ie=(0,W.useCallback)(async t=>{s(t?{oauthEnabled:!0}:{oauthEnabled:!1,authFlowUrl:null,callbackInput:``,oauthError:null}),e&&await r.onUpdate(e.id,{oauth:{...T??{status:`unauthenticated`},enabled:t}})},[e,T,r,s]),ae=(0,W.useCallback)(async()=>{if(e){s({authenticating:!0,oauthError:null});try{let t=await r.onStartMcpOAuth(e.id);t.ok&&t.authorizationUrl?s({authFlowUrl:t.authorizationUrl}):t.ok&&t.alreadyAuthenticated?s({authFlowUrl:null}):s({oauthError:t.error??`Failed to start OAuth flow`})}finally{s({authenticating:!1})}}},[e,r,s]),O=(0,W.useCallback)(async()=>{if(e){s({completing:!0,oauthError:null});try{let t=await r.onCompleteMcpOAuth(e.id,x);t.ok?s({authFlowUrl:null,callbackInput:``}):s({oauthError:t.error??`Failed to complete OAuth flow`})}finally{s({completing:!1})}}},[e,x,r,s]),oe=(0,W.useCallback)(e=>{let t=e.target.checked;I(te,()=>ie(t))},[ie,te]),k=(0,W.useCallback)(()=>{I(z(`settings.startMcpOAuth`,E),ae)},[E,ae]),A=(0,W.useCallback)(()=>{I(z(`settings.completeMcpOAuth`,E),O)},[O,E]),se=(0,W.useCallback)(()=>{b&&I(ne,()=>i.writeText(b))},[b,i,ne]),ce=(0,W.useMemo)(()=>l.length===0?null:/^[a-zA-Z][a-zA-Z0-9_-]{0,31}$/.test(l)?l===`kanna`?`'kanna' is reserved.`:t.find(t=>t.name===l&&t.id!==e?.id)?`Name already taken.`:null:`Name must start with a letter and contain only letters, digits, '_' or '-' (max 32 chars).`,[l,t,e?.id]),le=(0,W.useCallback)(async()=>{ce||await $n({patch:s,save:async()=>{let t=f.split(`
|
|
7
|
-
`).map(e=>e.trim()).filter(e=>e.length>0),n={};for(let e of p.split(`
|
|
8
|
-
`)){let t=e.indexOf(`=`);t>0&&(n[e.slice(0,t).trim()]=e.slice(t+1))}let i={};for(let e of g.split(`
|
|
9
|
-
`)){let t=e.indexOf(`:`);t>0&&(i[e.slice(0,t).trim()]=e.slice(t+1).trim())}if(e){let a=u===`stdio`?{name:l,transport:u,command:d,args:t,env:n,cwd:m||void 0}:{name:l,transport:u,url:h,headers:i};await r.onUpdate(e.id,a)}else{let e=u===`stdio`?{name:l,transport:`stdio`,command:d,args:t,env:n,cwd:m||void 0}:{name:l,transport:u,url:h,headers:i};await r.onCreate(e)}},onDone:n,fallbackMessage:`Failed to save MCP server`})},[f,d,m,p,r,g,e,l,ce,n,u,h,s]),ue=(0,W.useCallback)(()=>{I(z(`mcpServers.save`,E),le)},[E,le]),de=er({submitting:v,isEdit:e!==null,addLabel:`Add server`});return(0,G.jsxs)(`div`,{className:`flex flex-col gap-4 px-6 py-6 max-w-2xl`,children:[(0,G.jsx)(`h2`,{className:`text-base font-medium`,children:e?`Edit MCP server`:`Add MCP server`}),(0,G.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,G.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:`Name`}),(0,G.jsx)(H,{value:l,onChange:e=>s({name:e.target.value}),placeholder:`fs`}),ce&&(0,G.jsx)(`p`,{className:`text-xs text-red-600`,children:ce})]}),(0,G.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,G.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:`Transport`}),(0,G.jsxs)(Ke,{value:u,onValueChange:c,children:[(0,G.jsx)(He,{children:(0,G.jsx)(We,{})}),(0,G.jsxs)(Ue,{children:[(0,G.jsx)(B,{value:`stdio`,children:`stdio (spawn local command)`}),(0,G.jsx)(B,{value:`http`,children:`http (Streamable HTTP)`}),(0,G.jsx)(B,{value:`sse`,children:`sse (Server-Sent Events)`}),(0,G.jsx)(B,{value:`ws`,children:`ws (WebSocket)`})]})]})]}),u===`stdio`?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,G.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:`Command`}),(0,G.jsx)(H,{value:d,onChange:e=>s({command:e.target.value}),placeholder:`/usr/local/bin/mcp-filesystem`})]}),(0,G.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,G.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:`Args (one per line)`}),(0,G.jsx)(Je,{value:f,onChange:e=>s({argsText:e.target.value}),rows:3,className:`font-mono text-sm`})]}),(0,G.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,G.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:`Env (KEY=value, one per line)`}),(0,G.jsx)(Je,{value:p,onChange:e=>s({envText:e.target.value}),rows:3,className:`font-mono text-sm`})]}),(0,G.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,G.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:`cwd (optional)`}),(0,G.jsx)(H,{value:m,onChange:e=>s({cwd:e.target.value}),placeholder:`/optional/working/dir`})]})]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,G.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:`URL`}),(0,G.jsx)(H,{value:h,onChange:e=>s({url:e.target.value}),placeholder:u===`ws`?`wss://example.com/mcp`:`https://example.com/mcp`})]}),u===`ws`?(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Headers are not supported on the ws transport.`}):(0,G.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,G.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:`Headers (Key: value, one per line)`}),(0,G.jsx)(Je,{value:g,onChange:e=>s({headersText:e.target.value}),rows:3,className:`font-mono text-sm`,disabled:y}),y&&(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Authorization header is managed by OAuth when enabled.`})]}),(u===`http`||u===`sse`)&&(0,G.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-md border p-3`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(Ae,{className:`h-4 w-4 text-muted-foreground`,"aria-hidden":!0}),(0,G.jsx)(`span`,{className:`text-xs font-medium`,children:`OAuth 2.1`}),(0,G.jsxs)(`label`,{className:`ml-auto flex cursor-pointer items-center gap-1 text-xs text-muted-foreground`,children:[D?(0,G.jsx)(R,{}):null,(0,G.jsx)(`input`,{type:`checkbox`,checked:y,disabled:D,"aria-busy":D||void 0,onChange:oe,"aria-label":`Enable OAuth`}),(0,G.jsx)(`span`,{children:`Enable`})]})]}),y&&!e&&(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Save the server first, then authenticate.`}),y&&e&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(ir,{oauth:T}),T?.status===`authenticated`&&(0,G.jsx)(M,{variant:`ghost`,size:`sm`,onClick:k,pending:ee,children:`Re-authenticate`})]}),(T?.status!==`authenticated`||b)&&(b?(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,G.jsxs)(`a`,{href:b,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-1 text-xs text-blue-600 underline`,children:[`Open authorization URL`,(0,G.jsx)(Ye,{className:`h-3 w-3`})]}),(0,G.jsx)(tt,{label:`Copy URL`,children:(0,G.jsx)(`button`,{type:`button`,onClick:se,disabled:re,"aria-busy":re||void 0,className:`ml-1 text-muted-foreground hover:text-foreground`,"aria-label":`Copy authorization URL`,children:re?(0,G.jsx)(R,{className:`size-3`}):(0,G.jsx)(Be,{className:`h-3 w-3`})})})]}),(0,G.jsxs)(`div`,{className:`grid gap-1`,children:[(0,G.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`After authorizing, paste the callback URL here:`}),(0,G.jsx)(H,{value:x,onChange:e=>s({callbackInput:e.target.value}),placeholder:`http://localhost:…/callback?code=…`,className:`font-mono text-xs`})]}),(0,G.jsx)(M,{variant:`outline`,size:`sm`,className:`w-fit`,onClick:A,pending:C,disabled:x.length===0,children:C?`Completing…`:`Complete`})]}):(0,G.jsx)(M,{variant:`outline`,size:`sm`,className:`w-fit`,onClick:k,pending:ee,children:ee?`Starting…`:`Authenticate`})),S&&(0,G.jsx)(`p`,{className:`text-xs text-red-600`,children:S})]})]})]}),_&&(0,G.jsx)(`p`,{className:`text-xs text-red-600`,children:_}),(0,G.jsxs)(`div`,{className:`flex justify-end gap-2 pt-2`,children:[(0,G.jsx)(M,{variant:`ghost`,onClick:n,disabled:v,children:`Cancel`}),(0,G.jsx)(M,{onClick:ue,pending:v,disabled:!!ce||l.length===0,children:de})]})]})}function dr(e){let t=U(Tt),n=Zn(e=>e.editing),r=Zn(e=>e.setEditing),i=Qn(cr,e.state),a=(0,W.useMemo)(()=>({...i,onDelete:async e=>{await i.onDelete(e),r({kind:`list`})},onSetEnabled:async(t,n)=>{await e.state.handleWriteAppSettings({customMcpServers:{setEnabled:{id:t,enabled:n}}})},onTest:async t=>{await e.state.handleTestMcpServer(t)},onStartMcpOAuth:async t=>e.state.handleStartMcpOAuth(t),onCompleteMcpOAuth:async(t,n)=>e.state.handleCompleteMcpOAuth(t,n)}),[i,e.state,r]);return(0,G.jsx)(lr,{servers:t,editing:n,onSelect:e=>r({kind:`edit`,id:e}),onStartCreate:()=>r({kind:`create`}),onCancelEditing:()=>r({kind:`list`}),handlers:a})}var fr={id:``,label:``,modelProvider:`claude`,supportedEfforts:[],offersOneMillionContext:!1};function pr(e){return{...e,submitting:!1,error:null}}var mr=Ce()(e=>({editing:{kind:`list`},editorForm:pr(fr),setEditing:t=>e({editing:t}),resetEditorForm:t=>e({editorForm:pr(t)}),patchEditorForm:t=>e(e=>({editorForm:{...e.editorForm,...t}})),toggleSupportedEffort:t=>e(e=>{let n=e.editorForm.supportedEfforts,r=n.includes(t)?n.filter(e=>e!==t):[...n,t];return{editorForm:{...e.editorForm,supportedEfforts:r}}}),toggleOneMillionContext:()=>e(e=>({editorForm:{...e.editorForm,offersOneMillionContext:!e.editorForm.offersOneMillionContext}}))})),hr=e=>({customModels:e}),gr=new Set([`claude`,`codex`]);function _r(e){return gr.has(e)}var vr={claude:`Claude`,codex:`Codex`};function yr({models:e,handlers:t,dom:n=we}){let r=mr(e=>e.editing),i=mr(e=>e.setEditing),a=mr(e=>e.resetEditorForm);function o(t){if(t.kind===`create`)a({id:``,label:``,modelProvider:t.provider,supportedEfforts:[],offersOneMillionContext:!1});else if(t.kind===`edit`){let n=e.find(e=>e.id===t.id)??null;n&&a({id:n.id,label:n.label,modelProvider:n.provider,supportedEfforts:n.supportedEfforts??[],offersOneMillionContext:pe(n.provider,n.id,n.contextWindowOptions).some(e=>e.id===`1m`)})}i(t)}if(r.kind!==`list`){let n=r.kind===`edit`?e.find(e=>e.id===r.id)??null:null;return(0,G.jsx)(xr,{initial:n,existing:e.map(e=>({id:e.id,provider:e.provider})),handlers:t,onDone:()=>i({kind:`list`})})}return(0,G.jsx)(`div`,{className:`flex flex-col gap-6 px-6 py-6`,children:[`claude`,`codex`].map(r=>{let i=e.filter(e=>e.provider===r);return(0,G.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,G.jsxs)(`h2`,{className:`text-base font-medium`,children:[vr[r],` models`]}),(0,G.jsxs)(M,{size:`sm`,onClick:()=>o({kind:`create`,provider:r}),children:[(0,G.jsx)(at,{className:`mr-1 h-4 w-4`}),`Add model`]})]}),i.length===0?(0,G.jsx)(Kn,{icon:Gt,message:`No ${vr[r]} models configured.`}):(0,G.jsx)(qn,{children:i.map(e=>(0,G.jsx)(br,{model:e,onEdit:()=>o({kind:`edit`,id:e.id}),onDelete:t.onDelete,dom:n},e.id))})]},r)})})}function br({model:e,onEdit:t,onDelete:n,dom:r}){let i=z(`models.delete`,e.provider,e.id),a=L(i),o=(0,W.useCallback)(()=>{r.confirmDialog(`Delete model "${e.label}"?`)&&I(i,()=>n(e.id))},[i,r,e.id,e.label,n]);return(0,G.jsxs)(`li`,{className:`flex items-center gap-3 px-4 py-3`,"aria-busy":a||void 0,children:[(0,G.jsxs)(`div`,{className:`flex flex-col`,children:[(0,G.jsx)(`span`,{className:`font-medium`,children:e.label}),(0,G.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:e.id})]}),(0,G.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(e.supportedEfforts?.length??0)>0&&(0,G.jsx)(`span`,{className:`rounded bg-muted px-1.5 py-0.5 text-xs`,children:`effort`}),e.supportedEfforts?.includes(`max`)&&(0,G.jsx)(`span`,{className:`rounded bg-muted px-1.5 py-0.5 text-xs`,children:`max`}),(0,G.jsx)(Jn,{label:e.label,onEdit:t,onDelete:o,deletePending:a})]})]})}function xr({initial:e,existing:t,handlers:n,onDone:r}){let i=mr(e=>e.editorForm),a=mr(e=>e.patchEditorForm),o=mr(e=>e.toggleSupportedEffort),s=mr(e=>e.toggleOneMillionContext),c=(0,W.useCallback)(e=>{_r(e)&&a({modelProvider:e})},[a]),{id:l,label:u,modelProvider:d,supportedEfforts:f,offersOneMillionContext:p,submitting:m,error:h}=i,g=p?ne:ne.filter(e=>e.id===`200k`),_=e!==null,v=(0,W.useMemo)(()=>!_&&t.some(e=>e.id===l.trim()&&e.provider===d),[t,l,_,d]),y=l.trim().length>0&&u.trim().length>0&&!v&&!m,b=()=>$n({patch:a,save:async()=>{_&&e?await n.onUpdate(e.id,{label:u.trim(),supportedEfforts:f.length>0?f:null,...d===`claude`?{contextWindowOptions:g}:{}}):await n.onCreate({id:l.trim(),label:u.trim(),provider:d,...f.length>0?{supportedEfforts:f}:{},...d===`claude`?{contextWindowOptions:g}:{}})},onDone:r,fallbackMessage:`Failed to save model`}),x=er({submitting:m,isEdit:_,addLabel:`Add model`});return(0,G.jsxs)(`div`,{className:`flex flex-col gap-4 px-6 py-6`,children:[(0,G.jsx)(`h2`,{className:`text-base font-medium`,children:_?`Edit model`:`Add model`}),(0,G.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,G.jsx)(`span`,{className:`text-sm font-medium`,children:`Provider`}),(0,G.jsxs)(Ke,{value:d,onValueChange:c,disabled:_,children:[(0,G.jsx)(He,{className:`min-w-[180px]`,children:(0,G.jsx)(We,{})}),(0,G.jsxs)(Ue,{children:[(0,G.jsx)(B,{value:`claude`,children:`Claude`}),(0,G.jsx)(B,{value:`codex`,children:`Codex`})]})]})]}),(0,G.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,G.jsx)(`span`,{className:`text-sm font-medium`,children:`Model ID`}),(0,G.jsx)(H,{value:l,onChange:e=>a({id:e.target.value}),placeholder:`claude-opus-4-9`,disabled:_,className:`font-mono`}),v&&(0,G.jsx)(`span`,{className:`text-xs text-red-600`,children:`A model with this id already exists.`})]}),(0,G.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,G.jsx)(`span`,{className:`text-sm font-medium`,children:`Label`}),(0,G.jsx)(H,{value:u,onChange:e=>a({label:e.target.value}),placeholder:`Opus 4.9`})]}),d===`claude`&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsx)(`span`,{className:`text-sm font-medium`,children:`Supported effort levels`}),me.map(e=>(0,G.jsxs)(`label`,{className:`inline-flex cursor-pointer items-center gap-2 text-sm`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:f.includes(e.id),onChange:()=>o(e.id)}),(0,G.jsx)(`span`,{children:e.label})]},e.id))]}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,G.jsx)(`span`,{className:`text-sm font-medium`,children:`Context window`}),(0,G.jsxs)(`label`,{className:`inline-flex cursor-pointer items-center gap-2 text-sm`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:p,onChange:s}),(0,G.jsx)(`span`,{children:`Offer the 1M context window`})]}),(0,G.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Off means every turn on this model runs on the 200k window.`})]})]}),h&&(0,G.jsx)(`span`,{className:`text-xs text-red-600`,children:h}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(M,{onClick:()=>{I(z(`models.save`,e?.id??`new`),b)},pending:m,disabled:!y,children:x}),(0,G.jsx)(M,{variant:`ghost`,onClick:r,disabled:m,children:`Cancel`})]})]})}function Sr(e){let t=U(wt),n=Qn(hr,e.state);return(0,G.jsx)(yr,{models:t,handlers:n})}function Cr(e,t){return{shortcut:e,expansion:t,submitting:!1,error:null}}var wr=Ce()(e=>({editing:{kind:`list`},editorForm:Cr(``,``),setEditing:t=>e({editing:t}),resetEditorForm:(t,n)=>e({editorForm:Cr(t,n)}),patchEditorForm:t=>e(e=>({editorForm:{...e.editorForm,...t}}))})),Tr=e=>({textSnippets:e}),Er=/^\S{1,32}$/;function Dr({snippets:e,handlers:t,dom:n=we}){let r=wr(e=>e.editing),i=wr(e=>e.setEditing),a=wr(e=>e.resetEditorForm);function o(t){if(t.kind===`create`)a(``,``);else if(t.kind===`edit`){let n=e.find(e=>e.id===t.id)??null;n&&a(n.shortcut,n.expansion)}i(t)}if(r.kind!==`list`){let n=r.kind===`edit`?e.find(e=>e.id===r.id)??null:null;return(0,G.jsx)(kr,{initial:n,existing:e.map(e=>({id:e.id,shortcut:e.shortcut})),handlers:t,onDone:()=>i({kind:`list`})})}return(0,G.jsxs)(`div`,{className:`flex flex-col gap-4 px-6 py-6`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,G.jsx)(`h2`,{className:`text-base font-medium`,children:`Text snippets`}),(0,G.jsx)(`p`,{className:`max-w-[65ch] text-sm text-muted-foreground`,children:`Type a shortcut in the chat composer and press Tab to expand it into the full text. Handy for prompts you send often.`})]}),(0,G.jsxs)(M,{size:`sm`,onClick:()=>o({kind:`create`}),children:[(0,G.jsx)(at,{className:`mr-1 h-4 w-4`}),`Add snippet`]})]}),e.length===0?(0,G.jsx)(Kn,{icon:un,message:`No snippets yet. Add one to expand a shortcut with Tab.`}):(0,G.jsx)(qn,{children:e.map(e=>(0,G.jsx)(Or,{snippet:e,onEdit:()=>o({kind:`edit`,id:e.id}),onDelete:t.onDelete,dom:n},e.id))})]})}function Or({snippet:e,onEdit:t,onDelete:n,dom:r}){let i=z(`textSnippets.delete`,e.id),a=L(i),o=(0,W.useCallback)(()=>{r.confirmDialog(`Delete snippet "${e.shortcut}"?`)&&I(i,()=>n(e.id))},[i,r,n,e.id,e.shortcut]);return(0,G.jsxs)(`li`,{className:`flex items-center gap-3 px-4 py-3`,"aria-busy":a||void 0,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,G.jsx)(`span`,{className:`font-mono text-sm`,children:e.shortcut}),(0,G.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:e.expansion})]}),(0,G.jsx)(`div`,{className:`ml-auto flex items-center gap-2`,children:(0,G.jsx)(Jn,{label:e.shortcut,onEdit:t,onDelete:o,deletePending:a})})]})}function kr({initial:e,existing:t,handlers:n,onDone:r}){let i=wr(e=>e.editorForm),a=wr(e=>e.patchEditorForm),{shortcut:o,expansion:s,submitting:c,error:l}=i,u=e!==null,d=o.trim(),f=Er.test(d),p=(0,W.useMemo)(()=>t.some(t=>t.shortcut===d&&t.id!==e?.id),[t,d,e?.id]),m=f&&!p&&s.length>0&&!c,h=()=>$n({patch:a,save:async()=>{u&&e?await n.onUpdate(e.id,{shortcut:d,expansion:s}):await n.onCreate({shortcut:d,expansion:s})},onDone:r,fallbackMessage:`Failed to save snippet`}),g=er({submitting:c,isEdit:u,addLabel:`Add snippet`});return(0,G.jsxs)(`div`,{className:`flex flex-col gap-4 px-6 py-6`,children:[(0,G.jsx)(`h2`,{className:`text-base font-medium`,children:u?`Edit snippet`:`Add snippet`}),(0,G.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,G.jsx)(`span`,{className:`text-sm font-medium`,children:`Shortcut`}),(0,G.jsx)(H,{value:o,onChange:e=>a({shortcut:e.target.value}),placeholder:`pgm`,className:`font-mono`,autoFocus:!0}),o.length>0&&!f&&(0,G.jsx)(`span`,{className:`text-xs text-destructive`,children:`Shortcut must be 1-32 characters with no spaces.`}),p&&(0,G.jsx)(`span`,{className:`text-xs text-destructive`,children:`A snippet with this shortcut already exists.`})]}),(0,G.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,G.jsx)(`span`,{className:`text-sm font-medium`,children:`Expands to`}),(0,G.jsx)(Je,{value:s,onChange:e=>a({expansion:e.target.value}),placeholder:`pull request green then merge`,rows:4})]}),l&&(0,G.jsx)(`span`,{className:`text-xs text-destructive`,children:l}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(M,{onClick:()=>{I(z(`textSnippets.save`,e?.id??`new`),h)},pending:c,disabled:!m,children:g}),(0,G.jsx)(M,{variant:`ghost`,onClick:r,disabled:c,children:`Cancel`})]})]})}function Ar(e){let t=U(Ot),n=Qn(Tr,e.state);return(0,G.jsx)(Dr,{snippets:t,handlers:n})}function jr(e){if(!e)return`—`;let t=e.trim();if(!t)return`—`;let n=t.slice(-4);return`${t.startsWith(`sk-ant-`)?`sk-ant-`:``}…${n}`}var $=Ce()(e=>({addLabel:``,addToken:``,addBaseUrl:``,addSubmitting:!1,tokenRowStates:{},baseUrlDrafts:{},setAddLabel:t=>e({addLabel:t}),setAddToken:t=>e({addToken:t}),setAddBaseUrl:t=>e({addBaseUrl:t}),setAddSubmitting:t=>e({addSubmitting:t}),resetAddForm:()=>e({addLabel:``,addToken:``,addBaseUrl:``}),setTokenRowTesting:(t,n)=>e(e=>({tokenRowStates:{...e.tokenRowStates,[t]:{...e.tokenRowStates[t]??{testResult:null,testing:!1},testing:n}}})),setTokenRowTestResult:(t,n)=>e(e=>({tokenRowStates:{...e.tokenRowStates,[t]:{...e.tokenRowStates[t]??{testResult:null,testing:!1},testResult:n}}})),clearTokenRowState:t=>e(e=>{let{[t]:n,...r}=e.tokenRowStates;return{tokenRowStates:r}}),setBaseUrlDraft:(t,n)=>e(e=>({baseUrlDrafts:{...e.baseUrlDrafts,[t]:n}})),clearBaseUrlDraft:t=>e(e=>{let{[t]:n,...r}=e.baseUrlDrafts;return{baseUrlDrafts:r}})}));function Mr(e){if(e<=0)return`reset now`;let t=Math.ceil(e/1e3),n=Math.floor(t/60),r=t%60;return n<60?`reset in ${n}m ${r.toString().padStart(2,`0`)}s`:`reset in ${Math.floor(n/60)}h ${(n%60).toString().padStart(2,`00`)}m`}function Nr({entry:e,now:t}){if(e.status===`active`)return(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,G.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/50`,"aria-hidden":`true`}),`Active`]});if(e.status===`limited`){let n=e.limitedUntil===null?null:Mr(e.limitedUntil-t);return(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs text-amber-600 dark:text-amber-400`,children:[(0,G.jsx)(`span`,{className:`size-1.5 rounded-full bg-amber-500`,"aria-hidden":`true`}),`Limited`,n!==null&&(0,G.jsxs)(G.Fragment,{children:[` `,`(`,(0,G.jsx)(`span`,{className:`tabular-nums`,children:n}),`)`]})]})}if(e.status===`disabled`)return(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs text-muted-foreground/60`,children:[(0,G.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/30`,"aria-hidden":`true`}),`Disabled`]});let n=e.lastErrorMessage??`Unknown error`;return(0,G.jsx)(gt,{children:(0,G.jsxs)(pt,{children:[(0,G.jsx)(mt,{asChild:!0,children:(0,G.jsxs)(`span`,{className:`inline-flex cursor-default items-center gap-1.5 text-xs text-destructive`,children:[(0,G.jsx)(`span`,{className:`size-1.5 rounded-full bg-destructive`,"aria-hidden":`true`}),`Error`,(0,G.jsx)(`span`,{className:`sr-only`,children:n})]})}),(0,G.jsx)(ht,{"aria-hidden":`true`,children:n})]})})}function Pr({entry:e,now:t,isCurrent:n,concurrencyDefault:r,onRemove:i,onToggleDisabled:a,onTest:o,onChangeMaxConcurrent:s,onChangeBaseUrl:l,ports:u}){let d=u?.timer??dt,f=$(e=>e.tokenRowStates),p=$(e=>e.setTokenRowTesting),m=$(e=>e.setTokenRowTestResult),h=$(e=>e.baseUrlDrafts),g=$(e=>e.setBaseUrlDraft),_=f[e.id],v=_?.testResult??null,y=_?.testing??!1,b=h[e.id]??e.baseUrl??``,x=b.trim().length>0&&k(b)===null,S=z(`oauthPool.remove`,e.id),ee=z(`oauthPool.toggle`,e.id),C=z(`oauthPool.concurrency`,e.id),w=z(`oauthPool.baseUrl`,e.id),T=z(`oauthPool.test`,e.id),E=L(S),te=L(ee),D=L(C),ne=L(w),re=()=>I(w,()=>l(e.id,b)),ie=e=>{e.key===`Enter`&&e.currentTarget.blur()},ae=async()=>{p(e.id,!0),m(e.id,null);try{let t=await o(e.token,e.baseUrl),n=t.ok?`OK`:t.error??`Error`;m(e.id,n),d.setTimeout(()=>m(e.id,null),3e3)}catch{m(e.id,`Error`),d.setTimeout(()=>m(e.id,null),3e3)}finally{p(e.id,!1)}},O=e.status===`disabled`,oe=O?on:rn,A=e.maxConcurrent??r;return(0,G.jsxs)(`div`,{className:`border-t border-border py-3`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,G.jsx)(`span`,{className:`text-sm font-medium ${O?`text-muted-foreground/60`:`text-foreground`}`,children:e.label}),(0,G.jsx)(`code`,{className:`text-xs font-mono text-muted-foreground`,children:jr(e.token)}),n&&(0,G.jsx)(`span`,{className:`inline-flex shrink-0 items-center whitespace-nowrap rounded-full border border-primary/40 bg-primary/10 px-1.5 py-0.5 text-xs font-medium tracking-wide text-primary`,children:`In use`})]}),(0,G.jsx)(`div`,{className:`mt-0.5`,children:(0,G.jsx)(Nr,{entry:e,now:t})})]}),(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,G.jsx)(tt,{label:`Maximum concurrent chats sharing this OAuth token. Higher = risks Anthropic rate limits.`,children:(0,G.jsxs)(`label`,{className:`inline-flex items-center gap-1 text-xs text-muted-foreground`,children:[(0,G.jsx)(`span`,{children:`Concurrent`}),D?(0,G.jsx)(R,{className:`size-3`}):null,(0,G.jsx)(H,{type:`number`,value:A,readOnly:D,"aria-busy":D||void 0,onChange:t=>I(C,()=>s(e.id,c(Number(t.target.value)))),min:1,"aria-label":`Max concurrent chats`,className:`h-7 w-14 text-xs`,disabled:O})]})}),v!==null&&(0,G.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:v}),(0,G.jsxs)(`button`,{type:`button`,"aria-label":`Test`,onClick:()=>I(T,ae),disabled:y||O,"aria-busy":y||void 0,className:`inline-flex items-center gap-1 rounded px-2 py-1 text-xs text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50`,children:[y?(0,G.jsx)(R,{className:`size-3`}):(0,G.jsx)(qt,{className:`size-3`,"aria-hidden":`true`}),`Test`]}),(0,G.jsx)(gt,{children:(0,G.jsxs)(pt,{children:[(0,G.jsx)(mt,{asChild:!0,children:(0,G.jsxs)(`button`,{type:`button`,"aria-label":O?`Enable`:`Disable`,onClick:()=>I(ee,a),disabled:te,"aria-busy":te||void 0,className:`rounded p-1 text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-default`,children:[te?(0,G.jsx)(R,{}):(0,G.jsx)(oe,{"aria-hidden":`true`,className:`size-3.5`}),(0,G.jsx)(`span`,{className:`sr-only`,children:O?`Enable`:`Disable`})]})}),(0,G.jsx)(ht,{children:O?`Enable`:`Disable`})]})}),(0,G.jsxs)(`button`,{type:`button`,"aria-label":`Remove`,onClick:()=>I(S,i),disabled:E,"aria-busy":E||void 0,className:`rounded p-1 text-muted-foreground transition-colors hover:text-destructive focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-default`,children:[E?(0,G.jsx)(R,{}):(0,G.jsx)(fe,{className:`size-3.5`,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`sr-only`,children:`Remove`})]})]})]}),(0,G.jsx)(tt,{label:`Anthropic API endpoint this token authenticates against. Leave empty for the default api.anthropic.com; set it to route this credential through a proxy.`,children:(0,G.jsxs)(`label`,{className:`mt-2 flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,G.jsx)(`span`,{className:`shrink-0`,children:`Base URL`}),ne?(0,G.jsx)(R,{className:`size-3`}):null,(0,G.jsx)(H,{value:b,readOnly:ne,"aria-busy":ne||void 0,onChange:t=>g(e.id,t.target.value),onBlur:re,onKeyDown:ie,placeholder:`(default)`,maxLength:512,"aria-label":`Anthropic base URL for ${e.label}`,className:`h-7 flex-1 text-xs font-mono`,disabled:O})]})}),x&&(0,G.jsx)(`div`,{className:`mt-1 text-xs text-destructive`,children:`Must start with http:// or https://`})]})}function Fr({tokens:e,onWrite:t}){let n=$(e=>e.addLabel),r=$(e=>e.addToken),i=$(e=>e.addBaseUrl),a=$(e=>e.addSubmitting),o=$(e=>e.setAddLabel),s=$(e=>e.setAddToken),c=$(e=>e.setAddBaseUrl),l=$(e=>e.setAddSubmitting),u=$(e=>e.resetAddForm),d=k(i),f=i.trim().length>0&&d===null,p=n.trim().length>0&&r.trim().length>0&&!f&&!a,m=async()=>{if(p){l(!0);try{let i={id:crypto.randomUUID(),label:n.trim(),token:r.trim(),status:`active`,limitedUntil:null,lastUsedAt:null,lastErrorAt:null,lastErrorMessage:null,addedAt:Date.now(),...d===null?{}:{baseUrl:d}};await t({tokens:[...e,i]}),u()}finally{l(!1)}}};return(0,G.jsxs)(`div`,{className:`border-t border-border pt-4`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-end sm:gap-3`,children:[(0,G.jsx)(`div`,{className:`flex-1`,children:(0,G.jsx)(H,{value:n,onChange:e=>o(e.target.value),placeholder:`e.g. personal`,maxLength:64,className:`text-sm`,"aria-label":`Token label`})}),(0,G.jsx)(`div`,{className:`flex-[2]`,children:(0,G.jsx)(H,{value:r,onChange:e=>s(e.target.value),type:`password`,placeholder:`sk-ant-...`,maxLength:1024,className:`text-sm font-mono`,"aria-label":`OAuth token`})}),(0,G.jsxs)(`button`,{type:`button`,onClick:()=>I(`oauthPool.add`,m),disabled:!p,"aria-busy":a||void 0,className:`inline-flex shrink-0 items-center gap-1.5 rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50`,children:[a?(0,G.jsx)(R,{}):null,`Add token`]})]}),(0,G.jsxs)(`div`,{className:`mt-2`,children:[(0,G.jsx)(H,{value:i,onChange:e=>c(e.target.value),placeholder:`Base URL — leave empty for api.anthropic.com`,maxLength:512,className:`text-sm font-mono`,"aria-label":`Anthropic base URL`}),f&&(0,G.jsx)(`div`,{className:`mt-1 text-xs text-destructive`,children:`Must start with http:// or https://`})]})]})}function Ir({tokens:e,concurrencyDefault:t,onWrite:n,onTest:r,now:i,ports:a}){let o=i??Date.now(),s=$(e=>e.clearBaseUrlDraft),l=e.reduce((e,t)=>t.lastUsedAt!==null&&(e===null||t.lastUsedAt>(e.lastUsedAt??0))?t:e,null)?.id??null,u=t=>n({tokens:e.filter(e=>e.id!==t)}),d=t=>n({tokens:e.map(e=>e.id===t?{...e,status:e.status===`disabled`?`active`:`disabled`}:e)}),f=(t,r)=>n({tokens:e.map(e=>e.id===t?{...e,maxConcurrent:r}:e)}),p=async(t,r)=>{let i=e.find(e=>e.id===t);if(!i)return;let a=k(r);a===null&&r.trim().length>0||(s(t),a!==(i.baseUrl??null)&&await n({tokens:e.map(e=>{if(e.id!==t)return e;let{baseUrl:n,...r}=e;return a===null?r:{...e,baseUrl:a}})}))},m=L(`oauthPool.concurrencyDefault`),h=e=>{I(`oauthPool.concurrencyDefault`,()=>n({concurrencyDefault:c(e)}))};return(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3 pb-3`,children:[(0,G.jsx)(tt,{label:`Default concurrent-chat cap applied to any OAuth token whose row does not override it. Sharing across N chats burns Anthropic quota and risks 429s.`,children:(0,G.jsxs)(`label`,{className:`flex flex-col gap-0.5 text-sm`,children:[(0,G.jsx)(`span`,{className:`font-medium text-foreground`,children:`Default concurrency per token`}),(0,G.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`Cap for tokens without an explicit per-row override. Minimum `,1,`, no upper limit.`]})]})}),m?(0,G.jsx)(R,{className:`ml-auto text-muted-foreground`}):null,(0,G.jsx)(H,{type:`number`,value:t,readOnly:m,"aria-busy":m||void 0,onChange:e=>h(Number(e.target.value)),min:1,"aria-label":`Default concurrency per token`,className:`h-8 w-16 text-sm`})]}),e.map(e=>(0,G.jsx)(Pr,{entry:e,now:o,isCurrent:e.id===l,concurrencyDefault:t,onRemove:()=>u(e.id),onToggleDisabled:()=>d(e.id),onTest:r,onChangeMaxConcurrent:f,onChangeBaseUrl:p,ports:a},e.id)),(0,G.jsx)(Fr,{tokens:e,onWrite:n})]})}function Lr(e,t){e.key===`Enter`&&(t(),e.currentTarget.blur())}function Rr(e){let t={};for(let n of _)t[n]=S(e[n]??``);return{...T,...t}}function zr(e){return z(`settings.writeKeybindings`,e)}function Br({action:e,currentValue:t,bordered:n,onDraftChange:r,onCommit:i,onRestoreDefault:a}){let o=zr(e),s=L(o),c=f(T[e]),l=t!==c,u=()=>{I(o,i)};return(0,G.jsx)(Q,{title:d[e],description:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{children:`Comma-separated shortcuts.`}),l?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{children:` `}),(0,G.jsxs)(`button`,{type:`button`,disabled:s,"aria-busy":s||void 0,onClick:()=>{I(o,()=>a(e))},className:`inline rounded text-foreground hover:text-foreground/80 disabled:opacity-60`,children:[`Restore: `,c]})]}):null]}),bordered:n,children:(0,G.jsxs)(`div`,{className:`flex min-w-0 max-w-[420px] flex-1 items-center gap-2`,children:[(0,G.jsx)(H,{type:`text`,value:t,"aria-busy":s||void 0,onChange:t=>r(e,t.target.value),onBlur:u,onKeyDown:e=>Lr(e,u),className:`font-mono`}),s?(0,G.jsx)(R,{}):null]})})}function Vr({state:e}){let t=w(e=>e.keybindingDrafts),n=w(e=>e.setKeybindingDrafts),r=w(e=>e.setKeybindingDraft),i=w(e=>e.keybindingsError),a=w(e=>e.setKeybindingsError),o=(0,W.useMemo)(()=>x(e.keybindings),[e.keybindings]);(0,W.useEffect)(()=>{n(Object.fromEntries(_.map(e=>[e,f(o.bindings[e])])))},[o,n]);async function s(t){try{a(null),await e.socket.command({type:`settings.writeKeybindings`,bindings:Rr(t)})}catch(e){a(e instanceof Error?e.message:`Unable to save keybindings.`)}}async function c(){await s(t)}async function l(e){let r={...t,[e]:f(T[e])};n(r),await s(r)}return(0,G.jsxs)(`div`,{className:`border-b border-border`,children:[i?(0,G.jsx)(`div`,{className:`mb-4 rounded-lg border border-destructive/20 bg-destructive/5 px-4 py-3 text-sm text-destructive`,children:i}):null,o.warning?(0,G.jsx)(`div`,{className:`mb-4 rounded-lg border border-border bg-card/30 px-4 py-3 text-sm text-muted-foreground`,children:o.warning}):null,_.map((e,n)=>(0,G.jsx)(Br,{action:e,currentValue:t[e]??``,bordered:n!==0,onDraftChange:r,onCommit:c,onRestoreDefault:l},e))]})}var Hr=`always`,Ur=`funk`,Wr=[{value:`blow`,label:`Blow`},{value:`bottle`,label:`Bottle`},{value:`frog`,label:`Frog`},{value:`funk`,label:`Funk`},{value:`glass`,label:`Glass`},{value:`ping`,label:`Ping`},{value:`pop`,label:`Pop`},{value:`purr`,label:`Purr`},{value:`tink`,label:`Tink`}];function Gr(e){switch(e){case`never`:case`unfocused`:case`always`:return e;default:return Hr}}function Kr(e){switch(e){case`blow`:case`bottle`:case`frog`:case`funk`:case`glass`:case`ping`:case`pop`:case`purr`:case`tink`:return e;default:return Ur}}var qr=Ce()(e=>({chatSoundPreference:Hr,chatSoundId:Ur,setChatSoundPreference:t=>e({chatSoundPreference:Gr(t)}),setChatSoundId:t=>e({chatSoundId:Kr(t)})})),Jr=`inline-flex items-center justify-center rounded-lg border border-border bg-background px-3 py-1.5 text-sm font-medium text-foreground transition-colors hover:bg-muted`,Yr=`inline-flex items-center justify-center rounded-lg bg-foreground px-3 py-1.5 text-sm font-medium text-background transition-colors hover:bg-foreground/90`,Xr=`rounded bg-muted px-1 py-0.5 font-mono text-12 text-foreground`,Zr=`text-xs font-medium tracking-wide text-muted-foreground`,Qr=`gap-1.5 disabled:cursor-default disabled:opacity-60`,$r=`push.enable`,ei=`push.test`,ti=`push.disable`,ni=`push.contactSubject`;async function ri(e){try{await e(),Ze.getState().setCommandError(null)}catch(e){Ze.getState().setCommandError(Te(e))}}function ii(e,t){I(e,()=>ri(t))}function ai({pendingKey:e,onRun:t,className:n,label:r,children:i}){let a=L(e);return(0,G.jsxs)(`button`,{type:`button`,onClick:()=>ii(e,t),disabled:a,"aria-busy":a||void 0,"aria-label":r,className:N(n,Qr),children:[a?(0,G.jsx)(R,{}):null,i]})}function oi({localPath:e,muted:t,onMuteToggle:n}){let r=z(`push.setProjectMute`,e),i=L(r);return(0,G.jsxs)(`label`,{"aria-busy":i||void 0,className:`flex cursor-pointer items-center gap-3 rounded-md px-2 py-1.5 transition-colors hover:bg-muted/50`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:!t,disabled:i,onChange:t=>ii(r,()=>n(e,!t.target.checked)),className:`h-4 w-4 shrink-0 rounded border-border accent-foreground`}),(0,G.jsx)(Qe,{inline:!0,className:`min-w-0 flex-1 font-mono text-12 text-foreground`,tooltip:e,children:e}),i?(0,G.jsx)(R,{className:`text-muted-foreground`}):null]})}function si(e){let{permissionState:t}=e,n=L(ni);if(t===`unsupported`)return(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Push notifications are not supported in this browser.`});if(t===`insecure-context`)return(0,G.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Push requires HTTPS. Run `,(0,G.jsx)(`code`,{className:Xr,children:`kanna --share`}),` or open Kanna over a tunnel, then enable on this device.`]});if(t===`denied`)return(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`You blocked notifications for this site. Re-enable them in your browser settings, then reload.`});if(!(t===`granted`&&e.config.devices.some(t=>t.id===e.currentDeviceId)))return(0,G.jsx)(ai,{pendingKey:$r,onRun:e.onEnable,className:Yr,children:`Enable on this device`});let r=new Set(e.config.preferences.mutedProjectPaths),i=e.contactSubjectDraft.trim(),a=fn(i),o=i!==e.contactSubject,s=()=>{a&&o&&ii(ni,()=>e.onContactSubjectSave(i))};return(0,G.jsxs)(`div`,{className:`flex w-full min-w-0 flex-col gap-5 md:w-[440px]`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-2 rounded-full border border-border bg-card/40 px-3 py-1 text-xs font-medium text-foreground`,children:[(0,G.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-emerald-500`,"aria-hidden":!0}),`Enabled on this device`]}),(0,G.jsx)(ai,{pendingKey:ei,onRun:e.onTest,className:Jr,children:`Send test`}),(0,G.jsx)(ai,{pendingKey:ti,onRun:e.onDisable,className:Jr,children:`Disable`})]}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsxs)(`div`,{className:N(Zr,`flex items-center gap-1.5`),children:[`Contact for delivery`,n?(0,G.jsx)(R,{}):null]}),(0,G.jsx)(H,{type:`text`,inputMode:`email`,spellCheck:!1,autoCapitalize:`none`,value:e.contactSubjectDraft,readOnly:n,"aria-busy":n||void 0,onChange:t=>e.onContactSubjectDraftChange(t.target.value),onBlur:s,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),s())},placeholder:`mailto:you@example.com`,"aria-label":`Push contact subject`,"aria-invalid":i!==``&&!a,className:N(`font-mono`,i!==``&&!a&&`border-destructive`)}),i!==``&&!a?(0,G.jsxs)(`p`,{className:`text-xs text-destructive`,children:[`Must be a `,(0,G.jsx)(`code`,{className:Xr,children:`mailto:`}),` address or`,` `,(0,G.jsx)(`code`,{className:Xr,children:`https:`}),` URL with a routable domain (not localhost).`]}):(0,G.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Push services require a contact `,(0,G.jsx)(`code`,{className:Xr,children:`mailto:`}),` or`,` `,(0,G.jsx)(`code`,{className:Xr,children:`https:`}),` URL to sign notifications. Set your own so delivery isn’t rejected.`]})]}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsx)(`div`,{className:Zr,children:`Devices`}),(0,G.jsx)(`ul`,{className:`flex flex-col gap-1.5`,children:e.config.devices.map(t=>(0,G.jsxs)(`li`,{className:`flex items-start justify-between gap-3 rounded-lg border border-border bg-card/40 px-3 py-2`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,G.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,children:t.label}),(0,G.jsx)(`span`,{className:`line-clamp-2 break-all text-xs leading-snug text-muted-foreground`,children:t.userAgent})]}),!t.isCurrentDevice&&(0,G.jsx)(ai,{pendingKey:z(`push.unsubscribe`,t.id),onRun:()=>e.onRemoveDevice(t.id),label:`Remove ${t.label}`,className:`inline-flex shrink-0 items-center rounded-md border border-border bg-background px-2 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:`Remove`})]},t.id))})]}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsx)(`div`,{className:Zr,children:`Per-project`}),(0,G.jsx)(`ul`,{className:`flex flex-col`,children:e.projects.map(t=>(0,G.jsx)(`li`,{children:(0,G.jsx)(oi,{localPath:t.localPath,muted:r.has(t.localPath),onMuteToggle:e.onMuteToggle})},t.localPath))})]}),(0,G.jsxs)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:[`Phone setup: this page must be reachable over HTTPS. Run`,` `,(0,G.jsx)(`code`,{className:Xr,children:`kanna --share`}),` or open Kanna over your tunnel on the phone, then enable on that device.`]})]})}var ci={outdated:`border-warning/40 text-warning-text bg-warning/10`,partial:`border-warning/40 text-warning-text bg-warning/10`,unknown:`border-border text-muted-foreground bg-muted/40`},li=z(`packages.checkUpdates`);function ui(e){return z(`packages.update`,e)}async function di(e,t){try{await e.command(t),Ze.getState().setCommandError(null)}catch(e){throw Ze.getState().setCommandError(Te(e)),e}}var fi=[],pi=[],mi=[],hi=[];function gi(e){return typeof e==`object`&&!!e&&`packages`in e&&`errors`in e}var _i={up_to_date:`Up to date`,outdated:`Outdated`,partial:`Partial`,unknown:`Unknown`};function vi({pkg:e,packageEntry:t,applying:n,onUpdate:r}){let i=L(ui(e.id)),a=n||i,o=t?.update.availability,s=e.versionLabel??e.version??e.revision?.slice(0,7)??null,c=o&&o!==`up_to_date`?ci[o]:null;return(0,G.jsxs)(`div`,{className:`flex min-w-0 items-start justify-between gap-3 rounded-lg border border-border bg-card/30 p-3`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`div`,{className:`truncate text-sm font-medium text-foreground`,children:e.name}),s?(0,G.jsx)(`div`,{className:`font-mono tabular-nums text-xs text-muted-foreground/70`,children:s}):null]}),(0,G.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-end gap-2`,children:[c?(0,G.jsx)(`span`,{className:N(`rounded-full border px-2 py-0.5 text-xs font-medium`,c),children:_i[o]}):null,o===`outdated`||o===`partial`?(0,G.jsxs)(M,{type:`button`,size:`sm`,variant:`secondary`,disabled:a,"aria-busy":a||void 0,onClick:r,className:`h-6 rounded-full px-2 text-xs`,children:[a?(0,G.jsx)(P,{className:`mr-1 h-3 w-3 animate-spin`}):null,`Update`]}):null,e.sourceUrl?(0,G.jsx)(`a`,{href:e.sourceUrl,target:`_blank`,rel:`noreferrer`,"aria-label":`View ${e.name} source`,className:`touch-manipulation inline-flex h-8 w-8 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:(0,G.jsx)(Ye,{className:`h-4 w-4`})}):null]})]})}function yi({source:e,packages:t,updateEntries:n,applying:r,isChecking:i,onCheckUpdates:a,onUpdate:o}){return(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,G.jsx)(`div`,{className:`text-xs font-medium tracking-wide text-muted-foreground`,children:e}),(0,G.jsxs)(M,{size:`sm`,variant:`ghost`,className:`h-6 rounded-full px-2 text-xs`,disabled:i,"aria-busy":i||void 0,onClick:a,children:[i?(0,G.jsx)(P,{className:`mr-1 h-3 w-3 animate-spin`}):(0,G.jsx)(Le,{className:`mr-1 h-3 w-3`}),`Refresh`]})]}),(0,G.jsx)(`div`,{className:`grid gap-2 md:grid-cols-2`,children:t.map(e=>{let t=n.find(t=>t.id===e.id)??null;return(0,G.jsx)(vi,{pkg:e,packageEntry:t,applying:r.includes(e.id),onUpdate:()=>o(e.id)},e.id)})})]})}function bi({label:e,kind:t,packages:n,errors:r,updateEntries:i,applying:a,isChecking:o,onCheckUpdates:s,onUpdate:c}){let l=r.find(e=>e.kind===t),u=n.filter(e=>e.kind===t),d=new Map;for(let e of u){let t=e.source||`Unknown`,n=d.get(t);n?n.push(e):d.set(t,[e])}let f=t===`claude-plugin`?`Claude Code CLI`:`Codex CLI`,p;return p=l?(0,G.jsxs)(`div`,{className:`rounded-lg border border-border bg-card/30 p-3 text-sm text-muted-foreground`,children:[f,` not found — install it to manage `,e,` plugins.`]}):u.length===0?(0,G.jsxs)(`div`,{className:`rounded-lg border border-border bg-card/30 p-3 text-sm text-muted-foreground`,children:[`No `,e,` plugins installed.`]}):(0,G.jsx)(`div`,{className:`flex flex-col gap-4`,children:[...d.entries()].map(([e,t])=>(0,G.jsx)(yi,{source:e,packages:t,updateEntries:i,applying:a,isChecking:o,onCheckUpdates:s,onUpdate:c},e))}),(0,G.jsxs)(`section`,{className:`flex flex-col gap-3`,children:[(0,G.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:e}),p]})}function xi({state:e}){let{socket:t,connectionStatus:n}=e,r=w(e=>e.pluginInventory),i=w(e=>e.pluginInventoryLoading),a=w(e=>e.pluginInventoryError),o=w(e=>e.setPluginInventory),s=w(e=>e.setPluginInventoryLoading),c=w(e=>e.setPluginInventoryError),l=w(e=>e.packageUpdateSnapshot),u=(0,W.useCallback)(async()=>{if(n!==`connected`){o(null),c(null),s(!1);return}try{s(!0),c(null);let e=await t.command({type:`packages.listInstalled`});if(!gi(e))throw Error(`packages.listInstalled: unexpected response`);o(e)}catch(e){c(e instanceof Error?e.message:`Unable to load plugins.`)}finally{s(!1)}},[n,t,o,s,c]);(0,W.useEffect)(()=>{At(`packages.listInstalled`,u())},[u]);let d=(0,W.useCallback)(()=>{I(li,()=>di(t,{type:`packages.checkUpdates`}))},[t]),f=(0,W.useCallback)(e=>{I(ui(e),()=>di(t,{type:`packages.update`,id:e}))},[t]),p=L(li),m=l?.status===`checking`||p,h=l?.applying??hi,g=l?.packages.filter(e=>e.kind===`claude-plugin`||e.kind===`codex-plugin`)??mi,_=r?.packages??fi,v=r?.errors??pi;return a?(0,G.jsx)(`div`,{className:`rounded-lg border border-destructive/20 bg-destructive/5 px-4 py-3 text-sm text-destructive`,children:a}):i&&!r?(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,G.jsx)(P,{className:`h-3.5 w-3.5 animate-spin`}),`Loading…`]}):(0,G.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,G.jsx)(bi,{label:`Claude Code`,kind:`claude-plugin`,packages:_,errors:v,updateEntries:g,applying:h,isChecking:m,onCheckUpdates:d,onUpdate:f}),(0,G.jsx)(bi,{label:`Codex`,kind:`codex-plugin`,packages:_,errors:v,updateEntries:g,applying:h,isChecking:m,onCheckUpdates:d,onUpdate:f})]})}function Si(e){return e===`openai`?hn:e===`openrouter`?C:``}function Ci(e,t){return{...e,provider:t,model:Si(t),baseUrl:t===`custom`?e.baseUrl:``}}function wi(e,t){if(!e.pinnedRef)return null;let n=t.latestVersion;return!n||n===e.pinnedRef?null:n}var Ti={up_to_date:`Up to date`,outdated:`Outdated`,partial:`Partial`,unknown:`Unknown`};function Ei(e){if(!e)return null;let t=wi(e,e.update);if(t)return`Re-pin to ${t}`;if(e.pinnedRef)return null;let n=e.update.availability;return n===`outdated`||n===`partial`?`Update`:null}function Di({skill:e,packageEntry:t,uninstalling:n,applying:r,onUninstall:i,onUpdate:a}){let o=e.source?`https://skills.sh/${e.source}/${e.name}`:null,s=t?.update.availability,c=t?.versionLabel??t?.revision?.slice(0,7)??t?.updatedAt??null,l=s&&s!==`up_to_date`?ci[s]:null,u=t?.pinnedRef??null,d=Ei(t);return(0,G.jsxs)(`div`,{className:`flex min-w-0 items-start justify-between gap-3 rounded-lg border border-border bg-card/30 p-3`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`div`,{className:`truncate text-sm font-medium text-foreground`,children:e.name}),(0,G.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:e.source||`Unknown source`}),c?(0,G.jsx)(`div`,{className:`font-mono tabular-nums text-xs text-muted-foreground/70`,children:c}):null,u?(0,G.jsxs)(`div`,{className:`truncate font-mono tabular-nums text-xs text-muted-foreground/70`,children:[`Pinned `,u]}):null]}),(0,G.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-end gap-2`,children:[l?(0,G.jsx)(`span`,{className:N(`rounded-full border px-2 py-0.5 text-xs font-medium`,l),children:Ti[s]}):null,d?(0,G.jsxs)(M,{type:`button`,size:`sm`,variant:`secondary`,disabled:r,onClick:a,className:`h-6 rounded-full px-2 text-xs`,children:[r?(0,G.jsx)(P,{className:`mr-1 h-3 w-3 animate-spin`}):null,d]}):null,o?(0,G.jsx)(`a`,{href:o,target:`_blank`,rel:`noreferrer`,"aria-label":`View ${e.name} on skills.sh`,className:`touch-manipulation inline-flex h-8 w-8 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:(0,G.jsx)(Ye,{className:`h-4 w-4`})}):null,(0,G.jsx)(`button`,{type:`button`,"aria-label":`Uninstall ${e.name}`,disabled:n,onClick:i,className:`touch-manipulation inline-flex h-8 w-8 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive disabled:pointer-events-none disabled:opacity-50`,children:n?(0,G.jsx)(P,{className:`h-4 w-4 animate-spin`}):(0,G.jsx)(fe,{className:`h-4 w-4`})})]})]})}function Oi(e){return!e||e<=0?`0 installs`:e>=1e6?`${(e/1e6).toFixed(1).replace(/\.0$/,``)}M installs`:e>=1e3?`${(e/1e3).toFixed(1).replace(/\.0$/,``)}K installs`:`${e} install${e===1?``:`s`}`}var ki=z(`packages.checkUpdates`),Ai=z(`packages.updateAll`,`skill`);function ji(e){return`skill:${e}`}function Mi({skill:e,packageEntry:t,uninstalling:n,applying:r,onUninstall:i,onUpdate:a}){let o=ji(e.name),s=L(z(`packages.update`,o)),c=L(z(`skills.uninstall`,e.name));return(0,G.jsx)(Di,{skill:e,packageEntry:t,uninstalling:n||c,applying:r||s,onUninstall:()=>i(e),onUpdate:()=>a(o)})}function Ni({message:e}){return(0,G.jsx)(`pre`,{className:`max-w-full overflow-x-auto whitespace-pre-wrap rounded-lg border border-destructive/20 bg-destructive/5 px-4 py-3 text-xs text-destructive`,children:e})}function Pi({skill:e,installing:t,installed:n,message:r,onInstall:i}){let a;return a=n?`Installed`:t?`Installing`:`Get`,(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-3 rounded-lg border border-border bg-card/30 p-3`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`div`,{className:`truncate text-sm font-medium text-foreground`,children:e.name}),(0,G.jsxs)(`div`,{className:`truncate text-xs text-muted-foreground`,children:[e.source,` · `,Oi(e.installs)]}),n&&r?(0,G.jsx)(`div`,{className:`mt-1 truncate text-xs text-emerald-500`,children:r}):null]}),(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,G.jsx)(`a`,{href:`https://skills.sh/${e.id}`,target:`_blank`,rel:`noreferrer`,"aria-label":`View ${e.name} on skills.sh`,className:`touch-manipulation inline-flex h-8 w-8 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:(0,G.jsx)(Ye,{className:`h-4 w-4`})}),(0,G.jsxs)(M,{type:`button`,size:`sm`,variant:n?`secondary`:`default`,disabled:t||n,onClick:i,className:`h-6 rounded-full px-2 text-xs`,children:[t?(0,G.jsx)(P,{className:`mr-1.5 h-3.5 w-3.5 animate-spin`}):null,a]})]})]})}function Fi({state:e,ports:t}){let n=t?.timer??dt,r=e.socket,i=e.connectionStatus,a=w(e=>e.skillQuery),o=w(e=>e.setSkillQuery),s=w(e=>e.skillResults),c=w(e=>e.setSkillResults),l=w(e=>e.skillSearchLoading),u=w(e=>e.setSkillSearchLoading),d=w(e=>e.skillSearchError),f=w(e=>e.setSkillSearchError),p=w(e=>e.installedSkills),m=w(e=>e.setInstalledSkills),h=w(e=>e.installedSkillIds),g=w(e=>e.setInstalledSkillIds),_=w(e=>e.addInstalledSkillId),v=w(e=>e.removeInstalledSkillId),y=w(e=>e.installedLoading),b=w(e=>e.setInstalledLoading),x=w(e=>e.installedError),S=w(e=>e.setInstalledError),ee=w(e=>e.skillOperationError),C=w(e=>e.setSkillOperationError),T=w(e=>e.installingSkillId),E=w(e=>e.setInstallingSkillId),te=w(e=>e.uninstallingSkillId),D=w(e=>e.setUninstallingSkillId),ne=w(e=>e.installMessages),re=w(e=>e.setInstallMessage),ie=w(e=>e.clearInstallMessage),ae=w(e=>e.clearInstallMessagesForSkill),O=w(e=>e.packageUpdateSnapshot),oe=O?.status===`checking`,k=O?.packages.filter(e=>e.kind===`skill`&&!e.pinnedRef).filter(e=>e.update.availability===`outdated`||e.update.availability===`partial`).map(e=>e.id)??[],A=k.length,se=O?.lastCheckedAt?new Date(O.lastCheckedAt).toLocaleTimeString():null,ce=L(ki),le=L(Ai),ue=oe||ce;async function de(e){try{C(null),await r.command(e)}catch(e){throw C(Te(e)),e}}function j(){I(ki,()=>de({type:`packages.checkUpdates`}))}function fe(e){I(z(`packages.update`,e),()=>de({type:`packages.update`,id:e}))}function pe(){k.length!==0&&I(Ai,()=>de({type:`packages.updateAll`,ids:k}))}function me(e){I(z(`skills.install`,e.id),()=>_e(e))}function he(e){I(z(`skills.uninstall`,e.name),()=>ve(e))}let ge=(0,W.useCallback)(async()=>{if(i!==`connected`){m([]),g(new Set),S(null),b(!1);return}try{b(!0),S(null);let e=await r.command({type:`skills.listInstalled`});m(e.skills),g(new Set(e.skills.map(e=>e.name)))}catch(e){m([]),g(new Set),S(e instanceof Error?e.message:`Unable to read installed skills.`)}finally{b(!1)}},[i,r,m,g,S,b]);(0,W.useEffect)(()=>{At(`skills.listInstalled`,ge())},[i,ge,r]),(0,W.useEffect)(()=>{let e=a.trim();if(e.length<2){c([]),f(null),u(!1);return}if(i!==`connected`){c([]),u(!1),f(`Backend connection required.`);return}let t=!1;u(!0),f(null);let o=n.setTimeout(()=>{r.command({type:`skills.search`,query:e,limit:100}).then(e=>{t||c(e.skills)}).catch(e=>{t||(c([]),f(e instanceof Error?e.message:`Unable to search skills.`))}).finally(()=>{t||u(!1)})},250);return()=>{t=!0,n.clearTimeout(o)}},[i,a,r,c,f,u,n]);async function _e(e){if(i!==`connected`){C(`Backend connection required.`);return}try{E(e.id),C(null),ie(e.id),await r.command({type:`skills.install`,source:e.source,skillId:e.skillId}),_(e.skillId),re(e.id,`Installed globally`),At(`skills.listInstalled`,ge())}catch(e){C(e instanceof Error?e.message:`Install failed.`)}finally{E(null)}}async function ve(e){if(i!==`connected`){C(`Backend connection required.`);return}try{D(e.name),C(null),await r.command({type:`skills.uninstall`,skillId:e.name}),m(p.filter(t=>t.name!==e.name)),v(e.name),ae(e.name),At(`skills.listInstalled`,ge())}catch(e){C(e instanceof Error?e.message:`Uninstall failed.`)}finally{D(null)}}let ye;return ye=p.length>0?(0,G.jsx)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:p.map(e=>(0,G.jsx)(Mi,{skill:e,packageEntry:O?.packages.find(t=>t.kind===`skill`&&t.name===e.name)??null,uninstalling:te===e.name,applying:O?.applying.includes(ji(e.name))??!1,onUninstall:he,onUpdate:fe},`${e.source}/${e.name}`))}):y?null:(0,G.jsx)(`div`,{className:`rounded-lg border border-border bg-card/30 p-3 text-sm text-muted-foreground`,children:`No global skills installed.`}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[ee?(0,G.jsx)(Ni,{message:ee}):null,(0,G.jsxs)(`section`,{className:`flex flex-col gap-3`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,G.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:`Installed`}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[se?(0,G.jsxs)(`span`,{className:`tabular-nums text-xs text-muted-foreground`,children:[`Checked `,se]}):null,A>0?(0,G.jsxs)(M,{size:`sm`,variant:`secondary`,className:`h-6 rounded-full px-2 text-xs`,pending:le,onClick:pe,children:[`Update all (`,A,`)`]}):null,(0,G.jsxs)(M,{size:`sm`,variant:`ghost`,className:`h-6 rounded-full px-2 text-xs`,disabled:ue,"aria-busy":ue||void 0,onClick:j,children:[ue?(0,G.jsx)(P,{className:`mr-1 h-3 w-3 animate-spin`}):null,`Check`]}),y?(0,G.jsx)(P,{className:`h-3.5 w-3.5 animate-spin text-muted-foreground`}):null]})]}),x?(0,G.jsx)(`div`,{className:`text-xs text-destructive`,children:x}):null,ye]}),(0,G.jsxs)(`section`,{className:`flex flex-col gap-3`,children:[(0,G.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:`Discover`}),(0,G.jsxs)(`div`,{className:`flex h-10 items-center gap-2 rounded-lg border border-border bg-card/30 px-3`,children:[(0,G.jsx)(Ie,{className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,G.jsx)(`input`,{type:`text`,role:`searchbox`,value:a,onChange:e=>o(e.target.value),placeholder:`Search skills`,className:`min-w-0 flex-1 bg-transparent text-sm text-foreground outline-none placeholder:text-muted-foreground`}),a?(0,G.jsx)(`button`,{type:`button`,"aria-label":`Clear skills search`,onClick:()=>o(``),className:`touch-manipulation inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:(0,G.jsx)(ot,{className:`h-3.5 w-3.5`})}):null,l?(0,G.jsx)(P,{className:`h-4 w-4 shrink-0 animate-spin text-muted-foreground`}):null]}),d?(0,G.jsx)(`div`,{className:`text-xs text-destructive`,children:d}):null,(0,G.jsx)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:s.map(e=>(0,G.jsx)(Pi,{skill:e,installing:T===e.id,installed:h.has(e.skillId),message:ne[e.id],onInstall:()=>{me(e)}},e.id))}),!l&&!d&&a.trim().length>=2&&s.length===0?(0,G.jsx)(`div`,{className:`rounded-lg border border-border bg-card/30 p-3 text-sm text-muted-foreground`,children:`No skills found.`}):null]})]})}function Ii(e){return e.map(e=>({...e,disabled:!0}))}function Li({pendingKey:e,value:t,onValueChange:n,options:r,size:i}){let a=L(e);return(0,G.jsxs)(`div`,{className:`inline-flex items-center gap-2`,"aria-busy":a||void 0,children:[a?(0,G.jsx)(R,{className:`text-muted-foreground`}):null,(0,G.jsx)(_t,{value:t,onValueChange:t=>I(e,()=>n(t)),options:a?Ii(r):r,size:i})]})}function Ri(e){return{async onReload(t){if(!(await e(`/api/plugins/${t}/reload`,{})).ok)throw Error(`Failed to reload plugin ${t}`)}}}function zi({plugins:e,handlers:t}){return e.length===0?(0,G.jsx)(Kn,{icon:te,message:`No plugins installed yet.`}):(0,G.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,G.jsx)(`h2`,{className:`text-sm font-medium text-foreground`,children:`Plugins`}),(0,G.jsx)(qn,{children:e.map(e=>(0,G.jsx)(Bi,{plugin:e,onReload:t.onReload},e.id))})]})}function Bi({plugin:e,onReload:t}){let n=z(`plugins.reload`,e.id),r=L(n),i=(0,W.useCallback)(()=>{I(n,async()=>{try{await t(e.id),Ze.getState().setCommandError(null)}catch(e){throw Ze.getState().setCommandError(Te(e)),e}})},[t,e.id,n]);return(0,G.jsxs)(`li`,{className:`flex items-center justify-between gap-3 px-4 py-3`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,G.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,children:e.id}),(0,G.jsx)(Pt,{tone:e.enabled?`active`:`muted`,label:e.enabled?`Enabled`:`Disabled`})]}),(0,G.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:e.sourceDir})]}),(0,G.jsx)(M,{variant:`ghost`,size:`sm`,"data-testid":`plugin-reload:${e.id}`,pending:r,onClick:i,children:`Reload`})]})}async function Vi(e,t){return{ok:(await ze.postJsonBody(e,t)).ok}}var Hi=Ri(Vi);function Ui(){let e=U(vt);return(0,G.jsx)(zi,{plugins:e,handlers:Hi})}var Wi=[{id:`general`,label:`General`,icon:Fe,subtitle:`Manage appearance, editor behavior, and embedded terminal defaults.`},{id:`skills`,label:`Skills`,icon:Lt,subtitle:`Manage globally installed agent skills from the active skill lock file.`},{id:`plugins`,label:`Plugins`,icon:tn,subtitle:`View and update globally installed Claude Code and Codex plugins.`},{id:`kanna-plugins`,label:`Kanna plugins`,icon:te,subtitle:`Install local Kanna plugins that contribute UI surfaces and daemon behavior.`},{id:`providers`,label:`Providers`,icon:Zt,subtitle:`Manage the default chat provider and saved model defaults for Claude Code and Codex.`},{id:`models`,label:`Models`,icon:Gt,subtitle:`Add, edit, and remove Claude and Codex models available in the model picker.`},{id:`subagents`,label:`Subagents`,icon:Ne,subtitle:`Define reusable agent personas. Mention them in chat with @agent/<name>.`},{id:`mcp-servers`,label:`MCP servers`,icon:tn,subtitle:`Install custom MCP servers (stdio, http, sse, ws) and connect-test them.`},{id:`snippets`,label:`Text snippets`,icon:un,subtitle:`Define shortcuts that expand to full text in the chat composer with Tab.`},{id:`instructions`,label:`Instructions`,icon:Zt,subtitle:`Global instructions appended to every Claude and Codex turn (main + subagents).`},{id:`keybindings`,label:`Keybindings`,icon:Ut,subtitle:`Edit global app shortcuts stored in the active keybindings file.`},{id:`changelog`,label:`Changelog`,icon:Lt,subtitle:`Release notes pulled from the public GitHub releases feed.`}];function Gi(e){return e?Wi.find(t=>t.id===e)?.id??null:null}function Ki(e){return e?Wi:Wi.filter(e=>e.id!==`kanna-plugins`)}var qi=[{value:`light`,label:`Light`,icon:cn},{value:`dark`,label:`Dark`,icon:$t},{value:`system`,label:`System`,icon:V}],Ji=[{value:`sm`,label:`Small`},{value:`md`,label:`Default`},{value:`lg`,label:`Large`},{value:`xl`,label:`Extra Large`},{value:`xxl`,label:`XX-Large`}],Yi=[{value:`never`,label:`Never`},{value:`unfocused`,label:`When Unfocused`},{value:`always`,label:`Always`}],Xi=[{value:`disabled`,label:`Off`},{value:`enabled`,label:`On`}],Zi=[{value:`disabled`,label:`Off`},{value:`enabled`,label:`On`}],Qi=[{value:`always-ask`,label:`Always ask`},{value:`auto-expose`,label:`Auto-expose`}],$i=[{value:`openai`,label:`OpenAI`},{value:`openrouter`,label:`OpenRouter`},{value:`custom`,label:`Custom`}],ea=3e5,ta=null;function na(e){return`Edit global app shortcuts stored in ${e}.`}function ra(e,t){return e!==t}function ia(){return ta?Date.now()>=ta.expiresAt?(ta=null,null):ta.releases:null}function aa(e){ta={releases:e,expiresAt:Date.now()+ea}}async function oa(e,t){let n=t?.force?null:ia();if(n)return n;let r=await e();return aa(r),r}function sa(e,t){let n=e=>e.trim().replace(/^v/i,``).split(`-`)[0].split(`.`).map(e=>Number.parseInt(e,10)).filter(e=>Number.isFinite(e)),r=n(e),i=n(t),a=Math.max(r.length,i.length);for(let e=0;e<a;e+=1){let t=r[e]??0,n=i[e]??0;if(t!==n)return t<n?-1:1}return 0}function ca(e){if(!e)return`Unpublished`;let t=new Date(e);return Number.isNaN(t.getTime())?`Unknown date`:new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`,year:`numeric`}).format(t)}var la=`__redeploy__`,ua=`settings.writeLlmProvider`,da=`appSettings.setCloudflareTunnel`,fa=z(da,`cloudflaredPath`);function pa({status:e,releases:t,error:n,onRetry:r,updateSnapshot:i,currentVersion:a,onInstallUpdate:o,onCheckForUpdates:s,onForceReload:c}){let l=L(`update.check`),u=w(e=>e.changelogPendingAction),d=w(e=>e.setChangelogPendingAction),f=i?.latestVersion??t[0]?.tag_name??`Unknown`,p=i?.currentVersion??a,m=i?.status===`checking`||l,h=i?.status===`updating`||i?.status===`restart_pending`,g=h||u!==null,_=i?.updateAvailable===!0,v=f.replace(/^v/i,``),y=p.replace(/^v/i,``),b=(0,W.useCallback)(async e=>{d(e);try{await o(e)}finally{d(null)}},[o,d]),x=(0,W.useCallback)(async()=>{d(la);try{await c()}finally{d(null)}},[c,d]),S=u===la||h;return(0,G.jsxs)(`div`,{className:`space-y-4`,children:[e===`loading`||e===`idle`?(0,G.jsx)(`div`,{className:`flex min-h-[180px] items-center justify-center rounded-2xl border border-border bg-card/40 px-6 py-8 text-sm text-muted-foreground`,children:(0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,G.jsx)(P,{className:`h-4 w-4 animate-spin`}),(0,G.jsx)(`span`,{children:`Loading release notes…`})]})}):null,e===`error`?(0,G.jsx)(`div`,{className:`rounded-lg border border-destructive/20 bg-destructive/5 px-6 py-5`,children:(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:`Could not load changelog`}),(0,G.jsx)(`div`,{className:`mt-1 text-sm text-muted-foreground`,children:n??`Unable to load changelog.`})]}),(0,G.jsx)(`button`,{type:`button`,onClick:r,className:`rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground transition-colors hover:bg-muted`,children:`Retry`})]})}):null,e===`success`&&t.length===0?(0,G.jsxs)(`div`,{className:`rounded-lg border border-border bg-card/30 px-6 py-8`,children:[(0,G.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:`No releases yet`}),(0,G.jsx)(`div`,{className:`mt-2 text-sm text-muted-foreground`,children:`GitHub did not return any published releases for this repository.`})]}):null,e===`success`?(0,G.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,G.jsx)(Ft,{variant:`outline`,onClick:()=>I(`update.redeploy`,x),disabled:g,children:S?(0,G.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(P,{className:`h-3.5 w-3.5 animate-spin`}),`Re-deploying…`]}):`Re-deploy`}),(0,G.jsx)(Ft,{variant:`outline`,onClick:()=>I(`update.check`,s),disabled:m||g,children:m?(0,G.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(P,{className:`h-3.5 w-3.5 animate-spin`}),`Checking…`]}):`Check for updates`})]}):null,e===`success`&&t.length>0?t.map(e=>{let t=e.tag_name.replace(/^v/i,``),n=t===v,r=t===y;return(0,G.jsxs)(`article`,{className:N(`rounded-xl border bg-card/30 pl-6 pr-4 py-4`,n?`border-border bg-muted`:`border-border`),children:[(0,G.jsxs)(`div`,{className:`flex flex-row items-center min-w-0 flex-1 gap-3 `,children:[(0,G.jsxs)(`div`,{className:`flex flex-row items-center min-w-0 flex-1 gap-2 `,children:[(0,G.jsx)(`div`,{className:`text-lg font-semibold tracking-[-0.2px] text-foreground`,children:e.name?.trim()||e.tag_name}),(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2 text-sm text-muted-foreground`,children:[(0,G.jsx)(`span`,{children:ca(e.published_at)}),e.prerelease?(0,G.jsx)(`span`,{className:`rounded-full border border-border px-2.5 py-1 tracking-wide`,children:`Prerelease`}):null]})]}),(0,G.jsxs)(`div`,{className:`flex flex-row items-center justify-end min-w-0 flex-1 gap-2 `,children:[(0,G.jsx)(`a`,{href:e.html_url,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`View release on GitHub`,className:N(Oe({variant:`ghost`,size:`icon-sm`}),`h-11 w-11 md:h-8 md:w-8 shrink-0 rounded-md hover:!bg-transparent hover:border-border/0`),children:(0,G.jsx)(ma,{className:`h-4 w-4`})}),r?(0,G.jsx)(`span`,{className:N(`bg-transparent border border-border text-secondary-foreground`,`h-9 rounded-full px-3 text-sm`,`h-auto gap-1.5 px-3 py-1.5`),children:`Current`}):null,n&&_||!n&&!r?(()=>{let r=u===e.tag_name||h&&u===null,i;i=n?`Update`:sa(t,y)<0?`Rollback`:`Install`;let a;return a=n?`Updating…`:sa(t,y)<0?`Rolling back…`:`Installing…`,(0,G.jsx)(Ft,{variant:`default`,className:``,onClick:()=>I(z(`update.install`,e.tag_name),()=>b(e.tag_name)),disabled:g,children:(0,G.jsxs)(`div`,{className:`flex flex-row items-center justify-center gap-2`,children:[r?(0,G.jsx)(P,{className:`size-4 animate-spin`}):(0,G.jsx)(Vt,{className:`size-4`}),r?a:i]})})})():null]})]}),e.body?.trim()?(0,G.jsx)(`div`,{className:`prose prose-sm mt-5 max-w-none text-foreground dark:prose-invert`,children:Re(e.body)}):(0,G.jsx)(`div`,{className:`mt-5 text-sm text-muted-foreground`,children:`No release notes were provided.`})]},e.id)}):null]})}function ma({className:e}){return(0,G.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,className:e,children:(0,G.jsx)(`path`,{d:`M12 .5C5.649.5.5 5.649.5 12A11.5 11.5 0 0 0 8.36 22.04c.575.106.785-.25.785-.556 0-.274-.01-1-.015-1.962-3.181.691-3.853-1.532-3.853-1.532-.52-1.322-1.27-1.674-1.27-1.674-1.038-.71.08-.695.08-.695 1.148.08 1.752 1.178 1.752 1.178 1.02 1.748 2.676 1.243 3.328.95.103-.738.399-1.243.725-1.53-2.54-.289-5.211-1.27-5.211-5.65 0-1.248.446-2.27 1.177-3.07-.118-.288-.51-1.45.112-3.024 0 0 .96-.307 3.145 1.173A10.91 10.91 0 0 1 12 6.03c.973.004 1.954.132 2.87.387 2.182-1.48 3.14-1.173 3.14-1.173.625 1.573.233 2.736.115 3.024.734.8 1.175 1.822 1.175 3.07 0 4.39-2.676 5.358-5.224 5.642.41.353.776 1.05.776 2.117 0 1.528-.014 2.761-.014 3.136 0 .309.207.668.79.555A11.502 11.502 0 0 0 23.5 12C23.5 5.649 18.351.5 12 .5Z`})})}function ha({checked:e,onChange:t}){return(0,G.jsxs)(`label`,{className:`inline-flex items-center gap-2`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:e,onChange:e=>t(e.target.checked)}),`Enabled`]})}function ga({state:e}){let t=U(e=>e.settings?.globalPromptAppend??``),n=w(e=>e.globalInstructionsDraft),r=w(e=>e.setGlobalInstructionsDraft),i=w(e=>e.globalInstructionsPersistedAtMount),a=w(e=>e.globalInstructionsSaving),o=w(e=>e.setGlobalInstructionsSaving),s=w(e=>e.globalInstructionsError),c=w(e=>e.setGlobalInstructionsError);(0,W.useEffect)(()=>{t!==i&&w.setState({globalInstructionsPersistedAtMount:t,globalInstructionsDraft:t})},[t,i]);let l=n.replace(/\s+$/u,``),u=l.length>ye,d=l!==t,f=a||u||!d,p=(0,W.useCallback)(async()=>{if(!f){c(null),o(!0);try{await e.handleWriteAppSettings({globalPromptAppend:l})}catch(e){c(e instanceof Error?e.message:String(e))}finally{o(!1)}}},[f,e,l,c,o]),m;return m=a?`Saving…`:d?`Save`:`Saved`,(0,G.jsx)(`div`,{className:`border-b border-border`,children:(0,G.jsx)(Q,{title:`Global Instructions`,description:`Appended to every Claude and Codex turn — including subagent turns — as “Workspace instructions”. Kanna does not read CLAUDE.md or AGENTS.md from disk; paste your global instructions here. For rules that apply to one project only, use “Edit instructions” in that project's sidebar menu. Leave blank to disable.`,bordered:!1,alignStart:!0,children:(0,G.jsxs)(`div`,{className:`flex w-full flex-col gap-2 md:w-[420px]`,children:[(0,G.jsx)(`textarea`,{value:n,onChange:e=>r(e.target.value),placeholder:`e.g. Always write tests before implementation. Prefer Tailwind classes over inline styles.`,rows:8,"aria-label":`Global instructions`,className:N(`min-h-[160px] w-full resize-y rounded-md border bg-background px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50`,u?`border-destructive`:`border-input`),disabled:a}),(0,G.jsxs)(`div`,{className:`flex items-center justify-between text-xs`,children:[(0,G.jsxs)(`span`,{className:u?`text-destructive`:`text-muted-foreground`,children:[l.length,` / `,ye,` characters`,u?` — over limit`:``]}),(0,G.jsx)(M,{type:`button`,size:`sm`,onClick:()=>I(`settings.globalInstructions`,p),disabled:f,pending:a,children:m})]}),s?(0,G.jsx)(`div`,{className:`text-xs text-destructive`,children:s}):null]})})})}function _a({ports:e}={}){let t=e?.dom??we,a=n(),{sectionId:c}=i(),d=r(),{theme:f,setTheme:m}=Et(),_=w(e=>e.changelogStatus),S=w(e=>e.setChangelogStatus),C=w(e=>e.signingOut),T=w(e=>e.setSigningOut),te=w(e=>e.authEnabled),D=w(e=>e.setAuthEnabled),ne=w(e=>e.releases),ie=w(e=>e.setReleases),O=w(e=>e.changelogError),k=w(e=>e.setChangelogError),A=Gi(c)??`general`,ce=U(e=>e.hydrationStatus===`loading`&&e.settings===null),j=d.connectionStatus===`connecting`||!d.localProjectsReady||ce,fe=L(ua),pe=L(se),me=fe||pe,ge=L(fa),ye=L(`keybindings.openEditor`),Ce=L(`settings.chatSoundPreference`),Te=L(`settings.chatSoundId`),Ee=d.localProjects?.machine.displayName??`Unavailable`,F=d.localProjects?.projects.length??0,Oe=Se.split(`/`)[1]??`unknown`,Ae=U(yt),Ne=U(Dt),Fe=U(St),Ie=U(Ct),Le=xe(e=>e.setScrollbackLines),Re=xe(e=>e.setMinColumnWidth),ze=xe(e=>e.setEditorPreset),Be=xe(e=>e.setEditorCommandTemplate),Ve=U(xt),Je=U(bt),Ye=qr(e=>e.setChatSoundPreference),Ze=qr(e=>e.setChatSoundId),Qe=d.keybindings,V=U(e=>e.settings),it=d.llmProvider,at=h(e=>e.autoResumeOnRateLimit),ot=h(e=>e.setAutoResumeOnRateLimit),dt=h(e=>e.typographyOverride),pt=h(e=>e.clearTypographyOverride),mt=U(e=>e.settings?.typography.scale),ht=oe(dt,mt),gt=y(e=>e.defaultProvider),vt=y(e=>e.providerDefaults),Tt=y(e=>e.setDefaultProvider),Ot=y(e=>e.setProviderDefaultModel),Mt=y(e=>e.setProviderDefaultModelOptions),Pt=y(e=>e.setProviderDefaultPlanMode),It=U(wt),Lt=U(kt),Rt=(0,W.useMemo)(()=>de([...ue],It),[It]),Bt=(0,W.useMemo)(()=>x(Qe),[Qe]).filePathDisplay||De(),Vt=w(e=>e.pushPermissionState),Ht=w(e=>e.setPushPermissionState),Ut=w(e=>e.pushDeviceId),Wt=w(e=>e.setPushDeviceId),Gt=(0,W.useCallback)(async()=>{if(!d.pushConfig)return;let e=await qe({vapidPublicKey:d.pushConfig.vapidPublicKey,sendToServer:async e=>{let t=await d.socket.command({type:`push.subscribe`,subscription:e.subscription,label:e.label,userAgent:e.userAgent});return Xe(t.id),{id:t.id}}});Wt(e)},[d.pushConfig,d.socket,Wt]),Kt=(0,W.useCallback)(async()=>{Ut&&(await et({pushDeviceId:Ut,sendToServer:async e=>{await d.socket.command({type:`push.unsubscribe`,pushDeviceId:e})}}),nt(),Wt(null))},[Ut,d.socket,Wt]),qt=w(e=>e.scrollbackDraft),Jt=w(e=>e.setScrollbackDraft),Xt=w(e=>e.minColumnWidthDraft),Zt=w(e=>e.tabMinWidthDraft),Qt=w(e=>e.setMinColumnWidthDraft),$t=w(e=>e.setTabMinWidthDraft),en=V?.panes.tabMinWidth??60,tn=V?.uploads.maxFileSizeMb??pn.maxFileSizeMb,nn=w(e=>e.uploadMaxFileSizeDraft),rn=w(e=>e.setUploadMaxFileSizeDraft),an=V?.claudeDriver.preference??ae.preference,on=Math.round((V?.claudeDriver.lifecycle.idleTimeoutMs??be.idleTimeoutMs)/6e4),sn=V?.claudeDriver.lifecycle.maxConcurrent??be.maxConcurrent,cn=w(e=>e.claudeIdleMinutesDraft),ln=w(e=>e.setClaudeIdleMinutesDraft),un=w(e=>e.claudeMaxConcurrentDraft),fn=w(e=>e.setClaudeMaxConcurrentDraft),hn=w(e=>e.editorCommandDraft),gn=w(e=>e.setEditorCommandDraft),_n=w(e=>e.appSettingsError),K=w(e=>e.setAppSettingsError),bn=w(e=>e.analyticsDialogOpen),q=w(e=>e.setAnalyticsDialogOpen),xn=w(e=>e.tunnelError),Sn=w(e=>e.setTunnelError),Cn=w(e=>e.cloudflaredPathDraft),wn=w(e=>e.setCloudflaredPathDraft),Tn=w(e=>e.pushContactSubjectDraft),En=w(e=>e.setPushContactSubjectDraft),Dn=V?.shareDefaultTtlHours??24,On=w(e=>e.shareDefaultTtlDraft),kn=w(e=>e.setShareDefaultTtlDraft),J=w(e=>e.llmProviderDraft),An=w(e=>e.setLlmProviderDraft),jn=w(e=>e.llmProviderError),Y=w(e=>e.setLlmProviderError),Mn=w(e=>e.llmValidationStatus),Nn=w(e=>e.setLlmValidationStatus),Fn=w(e=>e.llmValidationError),In=w(e=>e.setLlmValidationError),Ln=w(e=>e.llmValidationDialogOpen),Rn=w(e=>e.setLlmValidationDialogOpen),X=d.updateSnapshot,Z=d.handleWriteAppSettings,zn=d.handleWriteCloudflareTunnel,Bn=d.handleWriteClaudeAuth,Vn=d.handleTestOAuthToken,Hn=d.handleReadLlmProvider,Un=d.handleWriteLlmProvider,Wn=d.handleValidateLlmProvider,Gn;Gn=X?.status===`checking`?`Checking for updates…`:X?.status===`updating`?`Installing update…`:X?.status===`restart_pending`?`Restarting Kanna…`:X?.status===`available`?`Update available${X.latestVersion?`: ${X.latestVersion}`:``}`:X?.status===`up_to_date`?`Up to date`:X?.status===`error`?`Update check failed`:`Not checked yet`,(0,W.useEffect)(()=>{Jt(String(Ae))},[Ae,Jt]),(0,W.useEffect)(()=>{Qt(String(Ne))},[Ne,Qt]),(0,W.useEffect)(()=>{$t(String(en))},[en,$t]),(0,W.useEffect)(()=>{rn(String(tn))},[tn,rn]),(0,W.useEffect)(()=>{ln(String(on))},[on,ln]),(0,W.useEffect)(()=>{fn(String(sn))},[sn,fn]),(0,W.useEffect)(()=>t.addWindowListener(`focus`,()=>Ht($e().state)),[t,Ht]),(0,W.useEffect)(()=>{gn(Ie)},[Ie,gn]),(0,W.useEffect)(()=>{it&&An({provider:it.provider,apiKey:it.apiKey,model:it.model,baseUrl:it.baseUrl})},[it,An]),(0,W.useEffect)(()=>{Nn(`idle`),In(null)},[J.provider,J.apiKey,J.model,J.baseUrl,Nn,In]),(0,W.useEffect)(()=>{c&&(Gi(c)||a(`/settings/general`,{replace:!0}))},[a,c]),(0,W.useEffect)(()=>{V&&wn(V.cloudflareTunnel.cloudflaredPath)},[V,wn]),(0,W.useEffect)(()=>{V&&En(V.push.contactSubject)},[V,En]),(0,W.useEffect)(()=>{let e=!1;return le().then(t=>{e||D(t.enabled===!0)}).catch(()=>{e||D(!1)}),()=>{e=!0}},[D]),(0,W.useEffect)(()=>{A!==`providers`||j||I(se,Hn)},[Hn,j,A]);let Kn=(0,W.useCallback)(()=>d.socket.command({type:`settings.getChangelog`}),[d.socket]);(0,W.useEffect)(()=>{if(A!==`changelog`||j)return;let e=!1;return S(`loading`),k(null),oa(Kn).then(t=>{e||(ie(t),S(`success`))}).catch(t=>{e||(k(t instanceof Error?t.message:`Unable to load changelog.`),S(`error`))}),()=>{e=!0}},[j,A,S,k,ie,Kn]);function qn(){let e=Number(qt);if(!Number.isFinite(e)){Jt(String(Ae));return}Le(e),Z({terminal:{scrollbackLines:e}}).catch(e=>{K(e instanceof Error?e.message:`Unable to save terminal settings.`)})}function Jn(){let e=Number(Xt);if(!Number.isFinite(e)){Qt(String(Ne));return}Re(e),Z({terminal:{minColumnWidth:e}}).catch(e=>{K(e instanceof Error?e.message:`Unable to save terminal settings.`)})}function Yn(){let e=Number(Zt);if(!Number.isFinite(e)){$t(String(en));return}Z({panes:{tabMinWidth:je(e)}}).catch(e=>{K(e instanceof Error?e.message:`Unable to save pane settings.`)})}function Xn(){let e=Number(nn);if(!Number.isFinite(e)||e<1||e>2048){rn(String(tn)),K(`Max file size must be between 1 and ${mn} MB.`);return}if(Math.round(e)===tn){rn(String(tn));return}Z({uploads:{maxFileSizeMb:Math.round(e)}}).catch(e=>{K(e instanceof Error?e.message:`Unable to save upload settings.`)})}function Zn(e){e!==an&&Z({claudeDriver:{preference:e}}).catch(e=>{K(e instanceof Error?e.message:`Unable to save Claude driver preference.`)})}function Qn(){let e=Number(cn),t=Math.round(_e/6e4),n=Math.round(ee/6e4);if(!Number.isFinite(e)||e<t||e>n){ln(String(on)),K(`Idle timeout must be between ${t} and ${n} minutes.`);return}if(Math.round(e)===on){ln(String(on));return}Z({claudeDriver:{lifecycle:{idleTimeoutMs:Math.round(e)*6e4}}}).catch(e=>{K(e instanceof Error?e.message:`Unable to save Claude lifecycle settings.`)})}function $n(){let e=Number(un);if(!Number.isFinite(e)||e<1||e>16){fn(String(sn)),K(`Max concurrent sessions must be between 1 and 16.`);return}if(Math.round(e)===sn){fn(String(sn));return}Z({claudeDriver:{lifecycle:{maxConcurrent:Math.round(e)}}}).catch(e=>{K(e instanceof Error?e.message:`Unable to save Claude lifecycle settings.`)})}function er(){let e=Number(On);if(!Number.isInteger(e)||e<1){kn(String(Dn)),K(`Default share link expiry must be a whole number of hours >= 1.`);return}if(e===Dn){kn(String(Dn));return}Z({shareDefaultTtlHours:e}).catch(e=>{K(e instanceof Error?e.message:`Unable to save share settings.`)})}function tr(e,t){e.key===`Enter`&&(t(),e.currentTarget.blur())}function nr(){Be(hn),Z({editor:{commandTemplate:hn}}).catch(e=>{K(e instanceof Error?e.message:`Unable to save editor settings.`)})}function rr(e){m(e),Z({theme:e}).catch(e=>{K(e instanceof Error?e.message:`Unable to save theme settings.`)})}function ir(e){Z({typography:{scale:e}}).catch(e=>{K(e instanceof Error?e.message:`Unable to save typography settings.`)})}function ar(e){ze(e);let t=e===`custom`?Ie:p(e);Z({editor:{preset:e,commandTemplate:t}}).catch(e=>{K(e instanceof Error?e.message:`Unable to save editor settings.`)})}function or(e){ra(Ve,e)&&(Ye(e),I(`settings.chatSoundPreference`,()=>Z({chatSoundPreference:e}).catch(e=>{K(e instanceof Error?e.message:`Unable to save chat sound settings.`)})),At(`chat sound preview`,jt(Je,1)))}function sr(e){ra(Je,e)&&(Ze(e),I(`settings.chatSoundId`,()=>Z({chatSoundId:e}).catch(e=>{K(e instanceof Error?e.message:`Unable to save chat sound settings.`)})),At(`chat sound preview`,jt(e,1)))}async function cr(e){try{K(null),await Z({analyticsEnabled:e===`enabled`})}catch(e){K(e instanceof Error?e.message:`Unable to save analytics settings.`)}}async function lr(e){try{K(null),await Z({telemetry:{enabled:e===`enabled`}})}catch(e){K(e instanceof Error?e.message:`Unable to save telemetry settings.`)}}async function ur(e){try{Sn(null),await zn(e)}catch(e){Sn(e instanceof Error?e.message:`Unable to save Cloudflare Tunnel settings.`)}}function fr(e){Tt(e),Z({defaultProvider:e}).catch(e=>{K(e instanceof Error?e.message:`Unable to save provider settings.`)})}function pr(e,t){Ot(e,t),Z({providerDefaults:{[e]:{model:t}}}).catch(e=>{K(e instanceof Error?e.message:`Unable to save provider settings.`)})}function mr(e,t){Mt(e,t),Z({providerDefaults:{[e]:{modelOptions:t}}}).catch(e=>{K(e instanceof Error?e.message:`Unable to save provider settings.`)})}function hr(e,t){Pt(e,t),Z({providerDefaults:{[e]:{planMode:t}}}).catch(e=>{K(e instanceof Error?e.message:`Unable to save provider settings.`)})}async function gr(e=J){try{Y(null),await Un(e);let t=await Wn(e);Nn(t.ok?`valid`:`invalid`),In(t.error)}catch(e){let t=e instanceof Error?{name:e.name,message:e.message}:Nt(e);Nn(`invalid`),In(t),Y(e instanceof Error?e.message:`Unable to save quick response provider settings.`)}}function _r(e){let t=Ci(J,e);An(t),vr(t)}function vr(e=J){I(ua,()=>gr(e))}function yr(){ta=null,S(`loading`),k(null),oa(Kn,{force:!0}).then(e=>{ie(e),S(`success`)}).catch(e=>{k(e instanceof Error?e.message:`Unable to load changelog.`),S(`error`)})}let br=hn.replaceAll(`{path}`,`/Users/jake/Projects/kanna/src/client/app/App.tsx`).replaceAll(`{line}`,`12`).replaceAll(`{column}`,`1`),xr=vn,Cr=V?.analyticsEnabled===!1?`disabled`:`enabled`,wr=V?.telemetry?.enabled===!1?`disabled`:`enabled`,Tr=V?.cloudflareTunnel??dn,Er=Tr.enabled?`enabled`:`disabled`,Dr=Wi.find(e=>e.id===A)??Wi[0],Or=(0,W.useMemo)(()=>Ki(Lt),[Lt]),kr=A===`keybindings`?na(Bt):Dr.subtitle,jr=!j,$=Fn?JSON.stringify(Fn,null,2):``,Mr;Mr=me?`inline-flex items-center gap-1.5 text-muted-foreground`:Mn===`valid`?`text-success-text`:Mn===`invalid`?`text-destructive`:`hidden`;let Nr;Nr=me?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(R,{}),fe?`Saving…`:`Loading…`]}):Mn===`valid`?`Credentials valid & saved`:Mn===`invalid`?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{children:`Credentials invalid.`}),Fn?(0,G.jsxs)(G.Fragment,{children:[` `,(0,G.jsx)(`button`,{type:`button`,onClick:()=>Rn(!0),className:`underline underline-offset-2`,children:`See error`})]}):null]}):null;let Pr=(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`span`,{children:[`Use an OpenAI-compatible API for title and commit message generation before Claude and Codex. Stored in `,it?.filePathDisplay??`the active llm-provider.json file`,`.`]}),(0,G.jsx)(`span`,{className:N(`mt-2 block text-sm font-medium`,Mr),children:Nr})]});async function Fr(){if(!C){T(!0);try{await d.handleSignOut()}finally{T(!1)}}}return(0,G.jsxs)(`div`,{className:`relative flex h-full flex-1 min-w-0 bg-background`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-1`,children:[(0,G.jsx)(`aside`,{className:`hidden w-[200px] shrink-0 md:block ${jr?`pb-[89px]`:``}`,children:(0,G.jsxs)(`div`,{className:`flex flex-col gap-1 px-4 py-6`,children:[(0,G.jsx)(`div`,{className:`px-3 pb-5 text-22 font-extrabold tracking-[-0.5px] text-foreground`,children:`Settings`}),Or.map(e=>{let t=e.id===`changelog`&&X?.updateAvailable===!0;return(0,G.jsxs)(`button`,{type:`button`,onClick:()=>{a(`/settings/${e.id}`)},className:`relative cursor-pointer rounded-lg px-3 py-2 text-sm ${e.id===A?`font-medium text-foreground`:`text-muted-foreground hover:bg-muted/50 hover:text-foreground`}`,children:[e.id===A?(0,G.jsx)(re.span,{layoutId:`settings-nav-indicator`,className:`absolute inset-0 rounded-lg bg-muted`,transition:{type:`spring`,...b.indicator}}):null,(0,G.jsxs)(`div`,{className:`relative flex items-center gap-2.5`,children:[(0,G.jsx)(e.icon,{className:`h-4 w-4 shrink-0`}),(0,G.jsx)(`span`,{className:`min-w-0 truncate`,children:e.label}),t?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(zt,{className:`ml-auto size-3.5 shrink-0 text-warning-text`,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`sr-only`,children:`Update available`})]}):null]})]},e.label)}),te?(0,G.jsx)(`button`,{type:`button`,onClick:()=>I(`auth.signOut`,Fr),disabled:C,className:`cursor-pointer rounded-lg px-3 py-2 text-sm text-muted-foreground hover:bg-muted/50 hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,children:(0,G.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[C?(0,G.jsx)(R,{className:`h-4 w-4`}):(0,G.jsx)(Yt,{className:`h-4 w-4 shrink-0`}),(0,G.jsx)(`span`,{children:C?`Signing out...`:`Sign out`})]})}):null]})}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1 overflow-y-auto`,children:[(0,G.jsx)(`div`,{className:`sticky top-0 z-20 border-b border-border bg-background px-2 py-2 md:hidden`,children:(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(tt,{label:`Open sidebar`,children:(0,G.jsx)(`button`,{type:`button`,onClick:d.openSidebar,className:`flex size-11 shrink-0 items-center justify-center rounded-md text-sm text-muted-foreground transition-colors hover:bg-muted/50 hover:text-foreground`,"aria-label":`Open sidebar`,children:(0,G.jsx)(E,{className:`h-4 w-4 shrink-0`})})}),(0,G.jsxs)(Ke,{value:A,onValueChange:e=>{a(`/settings/${e}`)},children:[(0,G.jsx)(He,{className:`h-11 min-w-0 flex-1`,"aria-label":`Settings section`,children:(0,G.jsx)(We,{})}),(0,G.jsx)(Ue,{children:(0,G.jsx)(Ge,{children:Or.map(e=>(0,G.jsx)(B,{value:e.id,children:e.label},e.id))})})]}),te?(0,G.jsxs)(`button`,{type:`button`,onClick:()=>I(`auth.signOut`,Fr),disabled:C,className:`flex min-h-11 shrink-0 items-center gap-2 rounded-md border border-border bg-background px-3 py-2 text-sm text-muted-foreground transition-colors hover:bg-muted/50 hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,children:[C?(0,G.jsx)(R,{className:`h-4 w-4`}):(0,G.jsx)(Yt,{className:`h-4 w-4 shrink-0`}),(0,G.jsx)(`span`,{className:`sr-only`,children:C?`Signing out...`:`Sign out`})]}):null]})}),(0,G.jsxs)(`div`,{className:`w-full px-4 pb-32 pt-8 md:px-6 md:pt-16`,children:[j?(0,G.jsx)(`div`,{className:`flex min-h-[240px] items-center justify-center rounded-2xl border border-border bg-card/40 px-4 py-6 text-sm text-muted-foreground`,children:(0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,G.jsx)(P,{className:`h-4 w-4 animate-spin`}),(0,G.jsx)(`span`,{children:`Loading machine settings…`})]})}):(0,G.jsxs)(`div`,{className:`mx-auto max-w-4xl kanna-settings-section-in`,children:[(0,G.jsxs)(`div`,{className:`pb-6`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-4 min-h-[34px]`,children:[(0,G.jsx)(`div`,{className:`text-lg font-semibold tracking-[-0.2px] text-foreground`,children:Dr.label}),A===`general`?(0,G.jsx)(Ft,{variant:`outline`,onClick:()=>{a(`/settings/changelog`)},children:`Check for updates`}):null,A===`keybindings`?(0,G.jsxs)(Ft,{onClick:()=>I(`keybindings.openEditor`,()=>d.handleOpenExternalPath(`open_editor`,Bt)),disabled:ye,"aria-busy":ye||void 0,icon:ye?(0,G.jsx)(R,{className:`h-4 w-4`}):(0,G.jsx)(he,{className:`h-4 w-4`}),children:[`Open in `,d.editorLabel]}):null]}),(0,G.jsx)(`div`,{className:`mt-1 text-sm text-muted-foreground`,children:kr})]}),A===`general`&&(0,G.jsxs)(G.Fragment,{children:[_n?(0,G.jsx)(`div`,{className:`mb-4 rounded-lg border border-destructive/20 bg-destructive/5 px-4 py-3 text-sm text-destructive`,children:_n}):null,(0,G.jsxs)(`div`,{className:`border-b border-border`,children:[(0,G.jsx)(Q,{title:`Application Update`,description:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`span`,{children:[Gn,`.`]}),X?.lastCheckedAt?(0,G.jsxs)(`span`,{children:[` Last checked `,new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`}).format(X.lastCheckedAt),`.`]}):null,X?.error?(0,G.jsxs)(`span`,{children:[` `,X.error]}):null]}),bordered:!1,children:(0,G.jsxs)(`div`,{className:`text-right text-sm text-foreground`,children:[(0,G.jsxs)(`div`,{children:[`Current: `,X?.currentVersion??Oe]}),(0,G.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[`Latest: `,X?.latestVersion??`Unknown`]})]})}),(0,G.jsx)(Q,{title:`Theme`,description:`Choose between light, dark, or system appearance`,children:(0,G.jsx)(_t,{value:f,onValueChange:rr,options:qi,size:`sm`})}),(0,G.jsx)(Q,{title:`Typography Scale`,description:dt?`This device uses its own text size instead of the account default.`:`Choose how large text and UI elements appear across the app.`,children:(0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,G.jsxs)(Ke,{value:ht,onValueChange:e=>{s(e)&&ir(e)},children:[(0,G.jsx)(He,{className:`min-w-[180px]`,children:(0,G.jsx)(We,{})}),(0,G.jsx)(Ue,{children:(0,G.jsx)(Ge,{children:Ji.map(e=>(0,G.jsx)(B,{value:e.value,children:e.label},e.value))})})]}),dt?(0,G.jsx)(M,{type:`button`,variant:`link`,size:`sm`,onClick:pt,children:`Use account default`}):null]})}),(0,G.jsx)(Q,{title:`Chat Sounds`,description:`Play a pop when a chat starts waiting on you or the unread chat count increases`,children:(0,G.jsxs)(Ke,{disabled:Ce,value:Ve,onValueChange:e=>{v(e)&&or(e)},children:[(0,G.jsx)(He,{className:`min-w-[180px]`,children:(0,G.jsx)(We,{})}),(0,G.jsx)(Ue,{children:(0,G.jsx)(Ge,{children:Yi.map(e=>(0,G.jsx)(B,{value:e.value,children:e.label},e.value))})})]})}),(0,G.jsx)(Q,{title:`Chat Sound`,description:`The bundled sound used for chat notification playback and previews`,children:(0,G.jsxs)(Ke,{disabled:Te,value:Je,onValueChange:e=>{ve(e)&&sr(e)},children:[(0,G.jsx)(He,{className:`min-w-[180px]`,children:(0,G.jsx)(We,{})}),(0,G.jsx)(Ue,{children:(0,G.jsx)(Ge,{children:Wr.map(e=>(0,G.jsx)(B,{value:e.value,children:e.label},e.value))})})]})}),(0,G.jsx)(Q,{title:`Default Editor`,description:`Used when opening transcript links or files from the git diff menu`,alignStart:!0,children:(0,G.jsxs)(Ke,{value:Fe,onValueChange:e=>{l(e)&&ar(e)},children:[(0,G.jsx)(He,{className:`min-w-[180px]`,children:(0,G.jsx)(We,{})}),(0,G.jsx)(Ue,{children:(0,G.jsx)(Ge,{children:Me.map(e=>(0,G.jsx)(B,{value:e.value,children:(0,G.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(Pe,{preset:e.value,className:`h-4 w-4 shrink-0`}),(0,G.jsx)(`span`,{children:e.label})]})},e.value))})})]})}),Fe===`custom`?(0,G.jsx)(`div`,{className:`border-t border-border`,children:(0,G.jsxs)(`div`,{className:`flex justify-between gap-8 py-5 pl-6`,children:[(0,G.jsxs)(`div`,{className:`min-w-0 max-w-xl`,children:[(0,G.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:`Command Template`}),(0,G.jsxs)(`div`,{className:`mt-1 text-13 text-muted-foreground`,children:[`Include `,`{path}`,` and optionally `,`{line}`,` and `,`{column}`,` in your command.`]})]}),(0,G.jsxs)(`div`,{className:`flex min-w-0 max-w-[420px] flex-1 flex-col items-stretch gap-2`,children:[(0,G.jsx)(H,{type:`text`,value:hn,onChange:e=>gn(e.target.value),onBlur:nr,onKeyDown:e=>Lr(e,nr),className:`font-mono`}),(0,G.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[`Preview: `,(0,G.jsx)(`span`,{className:`font-mono`,children:br})]})]})]})}):null,(0,G.jsx)(Q,{title:`Terminal Scrollback`,description:`Lines retained for embedded terminal history`,children:(0,G.jsxs)(`div`,{className:`flex w-full min-w-0 flex-col items-stretch gap-2 md:w-auto md:items-end`,children:[(0,G.jsx)(H,{type:`number`,min:500,max:5e3,step:100,value:qt,onChange:e=>Jt(e.target.value),onBlur:qn,onKeyDown:e=>tr(e,qn),className:`hide-number-steppers w-full text-left font-mono md:w-28 md:text-right`}),(0,G.jsxs)(`div`,{className:`text-left text-xs text-muted-foreground md:text-right`,children:[500,`-`,5e3,` lines`,Ae===1e3?` (default)`:``]})]})}),(0,G.jsx)(Q,{title:`Terminal Min Column Width`,description:`Minimum width for each terminal pane`,children:(0,G.jsxs)(`div`,{className:`flex w-full min-w-0 flex-col items-stretch gap-2 md:w-auto md:items-end`,children:[(0,G.jsx)(H,{type:`number`,min:250,max:900,step:10,value:Xt,onChange:e=>Qt(e.target.value),onBlur:Jn,onKeyDown:e=>tr(e,Jn),className:`hide-number-steppers w-full text-left font-mono md:w-28 md:text-right`}),(0,G.jsxs)(`div`,{className:`text-left text-xs text-muted-foreground md:text-right`,children:[250,`-`,900,` px`,Ne===450?` (default)`:``]})]})}),(0,G.jsx)(Q,{title:`Tab Minimum Width`,description:`How narrow a pane tab may get before the strip scrolls instead of shrinking`,children:(0,G.jsxs)(`div`,{className:`flex w-full min-w-0 flex-col items-stretch gap-2 md:w-auto md:items-end`,children:[(0,G.jsx)(H,{type:`number`,min:60,max:200,step:10,value:Zt,onChange:e=>$t(e.target.value),onBlur:Yn,onKeyDown:e=>tr(e,Yn),className:`hide-number-steppers w-full text-left font-mono md:w-28 md:text-right`}),(0,G.jsxs)(`div`,{className:`text-left text-xs text-muted-foreground md:text-right`,children:[60,`-`,200,` px`,en===60?` (default)`:``]})]})}),(0,G.jsx)(Q,{title:`Max upload file size`,description:`Largest single file the chat upload endpoint accepts.`,children:(0,G.jsxs)(`div`,{className:`flex w-full min-w-0 flex-col items-stretch gap-1.5 md:w-auto md:items-end`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 md:justify-end`,children:[(0,G.jsx)(H,{type:`number`,min:1,max:2048,step:1,value:nn,onChange:e=>rn(e.target.value),onBlur:Xn,onKeyDown:e=>tr(e,Xn),className:`hide-number-steppers w-full text-left font-mono tabular-nums md:w-24 md:text-right`,"aria-label":`Max upload file size in megabytes`}),(0,G.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`MB`})]}),(0,G.jsxs)(`div`,{className:`text-left text-xs text-muted-foreground tabular-nums md:text-right`,children:[1,`–`,2048,` MB · default `,pn.maxFileSizeMb]})]})}),(0,G.jsx)(Q,{title:`Auto-resume on rate limit`,description:`When you hit a rate limit, automatically schedule "continue" at the reset time instead of asking. You can still cancel each one from the chat.`,children:(0,G.jsx)(ha,{checked:at,onChange:ot})}),d.pushConfig?(0,G.jsx)(Q,{title:`Push notifications`,description:`Get notified when a chat is waiting for you, finishes, or fails. Works on iPhone (after Add to Home Screen), Android, and desktop browsers.`,bordered:!1,alignStart:!0,children:(0,G.jsx)(si,{permissionState:Vt,config:d.pushConfig,projects:d.localProjects?.projects??[],currentDeviceId:Ut,contactSubject:V?.push.contactSubject??``,contactSubjectDraft:Tn,onContactSubjectDraftChange:En,onContactSubjectSave:async e=>{await d.socket.command({type:`settings.writeAppSettingsPatch`,patch:{push:{contactSubject:e}}})},onEnable:Gt,onDisable:Kt,onTest:async()=>{await d.socket.command({type:`push.test`})},onMuteToggle:async(e,t)=>{await d.socket.command({type:`push.setProjectMute`,localPath:e,muted:t})},onRemoveDevice:async e=>{await d.socket.command({type:`push.unsubscribe`,pushDeviceId:e})}})}):null,(0,G.jsx)(Q,{title:`Anonymous Analytics`,description:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{children:`Help improve Kanna with anonymous product analytics. Kanna sends tracked event names plus a small set of event properties like current version, environment, update version info, and launch flags. No message content, prompts, file paths, or provider credentials are sent.`}),(0,G.jsxs)(`span`,{className:`mt-1 block`,children:[`Stored in `,V?.filePathDisplay??`~/.kanna/data/settings.json`,`.`,` `,(0,G.jsx)(`button`,{type:`button`,onClick:()=>q(!0),className:`underline underline-offset-2 text-foreground hover:text-foreground/80`,children:`View tracked events`})]}),V?.warning?(0,G.jsx)(`span`,{className:`mt-1 block`,children:V.warning}):null]}),children:(0,G.jsx)(Li,{pendingKey:`settings.analytics`,value:Cr,onValueChange:cr,options:Xi,size:`sm`})}),(0,G.jsx)(Q,{title:`Telemetry Tracing`,description:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{children:`Export OpenTelemetry traces and metrics (turn timings, subagent runs, process memory) to Kanna's observability collector so each install can be monitored. This machine reports under its computer name. Turning it off stops the export immediately.`}),(0,G.jsxs)(`span`,{className:`mt-1 block`,children:[`Collector: `,V?.telemetry?.endpoint??`not configured`,`. Stored in `,V?.filePathDisplay??`~/.kanna/data/settings.json`,`.`]})]}),children:(0,G.jsx)(Li,{pendingKey:`settings.telemetry`,value:wr,onValueChange:lr,options:Xi,size:`sm`})})]}),(0,G.jsxs)(`div`,{className:`border-b border-border`,children:[xn?(0,G.jsx)(`div`,{className:`mb-4 rounded-lg border border-destructive/20 bg-destructive/5 px-4 py-3 text-sm text-destructive`,children:xn}):null,(0,G.jsx)(Q,{title:`Cloudflare Tunnel`,description:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`span`,{children:[`When enabled, Claude can call the `,(0,G.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-xs`,children:`expose_port`}),` tool to expose a local port via Cloudflare Tunnel. The mode below controls whether each call requires your approval or is exposed automatically. Requires`,` `,(0,G.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-xs`,children:`cloudflared`}),` `,`to be installed.`]}),(0,G.jsxs)(`span`,{className:`mt-1 block`,children:[`Stored in `,V?.filePathDisplay??`~/.kanna/data/settings.json`,`.`]})]}),bordered:!1,children:(0,G.jsx)(Li,{pendingKey:z(da,`enabled`),value:Er,onValueChange:e=>ur({enabled:e===`enabled`}),options:Zi,size:`sm`})}),Tr.enabled&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Q,{title:`Tool mode`,description:`Always ask: each expose_port call shows an accept card. Auto-expose: expose_port calls spawn cloudflared immediately without prompting.`,children:(0,G.jsx)(Li,{pendingKey:z(da,`mode`),value:Tr.mode,onValueChange:e=>ur({mode:e}),options:Qi,size:`sm`})}),(0,G.jsx)(Q,{title:`cloudflared path`,description:`Path to the cloudflared binary. Defaults to the one found on $PATH.`,children:(0,G.jsx)(H,{value:Cn,onChange:e=>wn(e.target.value),onBlur:()=>I(fa,()=>ur({cloudflaredPath:Cn})),readOnly:ge,"aria-busy":ge||void 0,placeholder:`cloudflared`,className:`w-full font-mono md:w-64`})})]})]}),(0,G.jsx)(`div`,{className:`border-b border-border`,children:(0,G.jsx)(Q,{title:`Public share links`,description:`Default expiry for read-only chat share links. Owners can revoke any link manually at any time.`,bordered:!1,children:(0,G.jsxs)(`div`,{className:`flex w-full min-w-0 flex-col items-stretch gap-2 md:w-auto md:items-end`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 md:justify-end`,children:[(0,G.jsx)(H,{type:`number`,min:1,step:1,value:On,onChange:e=>kn(e.target.value),onBlur:er,onKeyDown:e=>tr(e,er),className:`hide-number-steppers w-full text-left font-mono tabular-nums md:w-24 md:text-right`,"aria-label":`Default share link expiry in hours`}),(0,G.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`hours`})]}),(0,G.jsx)(`div`,{className:`text-left text-xs text-muted-foreground tabular-nums md:text-right`,children:`Minimum 1 hour · default 24`})]})})})]}),A===`providers`&&(0,G.jsxs)(`div`,{className:`border-b border-border`,children:[(0,G.jsx)(Q,{title:`Claude OAuth tokens`,description:`Manage multiple Claude OAuth tokens. Kanna switches automatically when one hits its rate limit.`,bordered:!1,alignStart:!0,children:(0,G.jsx)(`div`,{className:`w-full md:w-[420px]`,children:(0,G.jsx)(Ir,{tokens:V?.claudeAuth.tokens??[],concurrencyDefault:V?.claudeAuth.concurrencyDefault??1,onWrite:Bn,onTest:Vn})})}),(0,G.jsx)(Q,{title:`Claude driver`,description:"SDK uses the @anthropic-ai/claude-agent-sdk programmatic API (billed at API rates). PTY launches the `claude` CLI under a pseudo-terminal — preserves Pro/Max subscription billing. Requires an OAuth-pool token configured in Kanna settings and ANTHROPIC_API_KEY to be unset. macOS/Linux only.",children:(0,G.jsx)(_t,{value:an,onValueChange:e=>{u(e)&&Zn(e)},options:[{value:`sdk`,label:`SDK (API)`},{value:`pty`,label:`PTY (subscription)`}]})}),(0,G.jsx)(Q,{title:`PTY idle timeout`,description:`Stop a Claude PTY session after this many minutes without user activity. Lower values free subscription quota faster; higher values keep cold-start latency low.`,children:(0,G.jsxs)(`div`,{className:`flex w-full min-w-0 flex-col items-stretch gap-2 md:w-auto md:items-end`,children:[(0,G.jsx)(H,{type:`number`,min:1,max:60,step:1,value:cn,onChange:e=>ln(e.target.value),onBlur:Qn,onKeyDown:e=>tr(e,Qn),className:`hide-number-steppers w-full text-left font-mono md:w-28 md:text-right`}),(0,G.jsxs)(`div`,{className:`text-left text-xs text-muted-foreground md:text-right`,children:[1,`–`,60,` min · default `,Math.round(be.idleTimeoutMs/6e4)]})]})}),(0,G.jsx)(Q,{title:`PTY max concurrent sessions`,description:`Hard cap on resident Claude PTY processes. Excess sessions are evicted LRU; their next activation cold-starts.`,children:(0,G.jsxs)(`div`,{className:`flex w-full min-w-0 flex-col items-stretch gap-2 md:w-auto md:items-end`,children:[(0,G.jsx)(H,{type:`number`,min:1,max:16,step:1,value:un,onChange:e=>fn(e.target.value),onBlur:$n,onKeyDown:e=>tr(e,$n),className:`hide-number-steppers w-full text-left font-mono md:w-28 md:text-right`}),(0,G.jsxs)(`div`,{className:`text-left text-xs text-muted-foreground md:text-right`,children:[1,`–`,16,` · default `,ae.lifecycle.maxConcurrent]})]})}),(0,G.jsx)(Q,{title:`Default Provider`,description:`The default harness used for new chats before a provider is locked by an existing session.`,children:(0,G.jsxs)(Ke,{value:gt,onValueChange:e=>{(e===`last_used`||o(e))&&fr(e)},children:[(0,G.jsx)(He,{className:`min-w-[180px]`,children:(0,G.jsx)(We,{})}),(0,G.jsx)(Ue,{children:(0,G.jsxs)(Ge,{children:[(0,G.jsx)(B,{value:`last_used`,children:`Last Used`}),ue.map(e=>(0,G.jsx)(B,{value:e.id,children:e.label},e.id))]})})]})}),(0,G.jsx)(Q,{title:`Claude Code Defaults`,description:`Saved defaults when using Claude Code.`,alignStart:!0,children:(0,G.jsx)(`div`,{className:`max-w-[420px]`,children:(0,G.jsx)(ke,{availableProviders:Rt,selectedProvider:`claude`,showProviderPicker:!1,model:vt.claude.model,modelOptions:vt.claude.modelOptions,onModelChange:(e,t)=>{pr(`claude`,t)},onModelOptionChange:e=>{e.type===`claudeReasoningEffort`?mr(`claude`,{reasoningEffort:e.effort}):e.type===`contextWindow`&&mr(`claude`,{contextWindow:e.contextWindow})},planMode:vt.claude.planMode,onPlanModeChange:e=>hr(`claude`,e),includePlanMode:!0,className:`justify-start flex-wrap`})})}),(0,G.jsx)(Q,{title:`Codex Defaults`,description:`Saved defaults when using Codex.`,alignStart:!0,children:(0,G.jsx)(`div`,{className:`max-w-[420px]`,children:(0,G.jsx)(ke,{availableProviders:Rt,selectedProvider:`codex`,showProviderPicker:!1,model:vt.codex.model,modelOptions:vt.codex.modelOptions,onModelChange:(e,t)=>{pr(`codex`,t)},onModelOptionChange:e=>{e.type===`codexReasoningEffort`?mr(`codex`,{reasoningEffort:e.effort}):e.type===`fastMode`&&mr(`codex`,{fastMode:e.fastMode})},planMode:vt.codex.planMode,onPlanModeChange:e=>hr(`codex`,e),includePlanMode:!0,className:`justify-start flex-wrap`})})}),(0,G.jsx)(Q,{title:`Quick Response SDK`,description:Pr,alignStart:!0,children:(0,G.jsxs)(`div`,{className:`flex w-full max-w-[420px] flex-col gap-3`,children:[jn?(0,G.jsx)(`div`,{className:`rounded-lg border border-destructive/20 bg-destructive/5 px-4 py-3 text-sm text-destructive`,children:jn}):null,it?.warning?(0,G.jsx)(`div`,{className:`rounded-lg border border-border bg-card/30 px-4 py-3 text-sm text-muted-foreground`,children:it.warning}):null,(0,G.jsxs)(Ke,{value:J.provider,disabled:me,onValueChange:e=>{g(e)&&_r(e)},children:[(0,G.jsx)(He,{className:`w-full`,children:(0,G.jsx)(We,{})}),(0,G.jsx)(Ue,{children:(0,G.jsx)(Ge,{children:$i.map(e=>(0,G.jsx)(B,{value:e.value,children:e.label},e.value))})})]}),J.provider===`custom`?(0,G.jsx)(H,{value:J.baseUrl,onChange:e=>An({...J,baseUrl:e.target.value}),onBlur:()=>vr(),onKeyDown:e=>Lr(e,vr),readOnly:me,placeholder:`https://your-provider.example/v1`}):null,(0,G.jsx)(H,{type:`password`,value:J.apiKey,onChange:e=>An({...J,apiKey:e.target.value}),onBlur:()=>vr(),onKeyDown:e=>Lr(e,vr),readOnly:me,placeholder:`API key`}),(0,G.jsx)(H,{value:J.model,onChange:e=>An({...J,model:e.target.value}),onBlur:()=>vr(),onKeyDown:e=>Lr(e,vr),readOnly:me,placeholder:`Model id`})]})})]}),A===`keybindings`&&(0,G.jsx)(Vr,{state:d}),A===`skills`&&(0,G.jsx)(Fi,{state:d}),A===`plugins`&&(0,G.jsx)(xi,{state:d}),A===`kanna-plugins`&&Lt&&(0,G.jsx)(Ui,{}),A===`subagents`&&(0,G.jsx)(Pn,{state:d}),A===`models`&&(0,G.jsx)(Sr,{state:d}),A===`mcp-servers`&&(0,G.jsx)(dr,{state:d}),A===`snippets`&&(0,G.jsx)(Ar,{state:d}),A===`instructions`&&(0,G.jsx)(ga,{state:d}),![`general`,`providers`,`keybindings`,`skills`,`plugins`,`subagents`,`models`,`mcp-servers`,`snippets`,`instructions`].includes(A)&&(0,G.jsx)(pa,{status:_,releases:ne,error:O,onRetry:yr,updateSnapshot:X,currentVersion:Oe,onInstallUpdate:e=>d.handleInstallUpdate(e),onCheckForUpdates:()=>d.handleCheckForUpdates({force:!0}),onForceReload:()=>d.handleForceReload()})]},A),d.commandError?(0,G.jsxs)(`div`,{className:`mx-auto mt-4 flex max-w-4xl items-start gap-3 rounded-lg border border-destructive/20 bg-destructive/5 px-4 py-3 text-sm text-destructive`,children:[(0,G.jsx)(rt,{className:`mt-0.5 h-4 w-4 flex-shrink-0`}),(0,G.jsx)(`span`,{children:d.commandError})]}):null]})]})]}),jr?(0,G.jsx)(`div`,{className:`absolute bottom-0 left-0 right-0 border-t border-border bg-background`,children:(0,G.jsx)(`div`,{className:`px-6 py-[14.25px]`,children:(0,G.jsxs)(`div`,{className:`grid gap-3 text-xs text-muted-foreground grid-cols-2 lg:grid-cols-4`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`mb-1 tracking-wide text-xs text-muted-foreground/80`,children:`Machine`}),(0,G.jsx)(`div`,{className:`text-foreground/80`,children:Ee})]}),(0,G.jsxs)(`div`,{className:`hidden md:block`,children:[(0,G.jsx)(`div`,{className:`mb-1 tracking-wide text-xs text-muted-foreground/80`,children:`Connection`}),(0,G.jsx)(`div`,{className:`text-foreground/80`,children:d.connectionStatus})]}),(0,G.jsxs)(`div`,{className:`hidden md:block`,children:[(0,G.jsx)(`div`,{className:`mb-1 tracking-wide text-xs text-muted-foreground/80`,children:`Projects Indexed`}),(0,G.jsx)(`div`,{className:`text-foreground/80`,children:F})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`mb-1 tracking-wide text-xs text-muted-foreground/80`,children:`App Version`}),(0,G.jsx)(`div`,{className:`text-foreground/80`,children:Oe})]})]})})}):null,(0,G.jsx)(ct,{open:bn,onOpenChange:q,children:(0,G.jsxs)(st,{size:`lg`,children:[(0,G.jsxs)(ut,{className:`space-y-4`,children:[(0,G.jsx)(ft,{children:`Tracked Events`}),(0,G.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:`Kanna sends these event names plus the limited property keys below, depending on the event type.`}),(0,G.jsxs)(`div`,{className:`max-h-[60vh] overflow-auto rounded-lg border border-border bg-muted/40 p-3`,children:[(0,G.jsx)(`div`,{className:`text-xs font-medium tracking-wide text-muted-foreground`,children:`Event Names`}),(0,G.jsx)(`ul`,{className:`mt-3 space-y-2 text-sm`,children:xr.map(e=>(0,G.jsx)(`li`,{className:`font-mono text-foreground`,children:e},e))}),(0,G.jsx)(`div`,{className:`mt-6 text-xs font-medium tracking-wide text-muted-foreground`,children:`Property Keys`}),(0,G.jsx)(`ul`,{className:`mt-3 space-y-2 text-sm`,children:yn.map(e=>(0,G.jsx)(`li`,{className:`font-mono text-foreground`,children:e},e))})]})]}),(0,G.jsx)(lt,{children:(0,G.jsx)(M,{variant:`secondary`,size:`sm`,onClick:()=>q(!1),children:`Close`})})]})}),(0,G.jsx)(ct,{open:Ln,onOpenChange:Rn,children:(0,G.jsxs)(st,{size:`lg`,children:[(0,G.jsxs)(ut,{className:`space-y-4`,children:[(0,G.jsx)(ft,{children:`Validation Error`}),(0,G.jsx)(`pre`,{className:`max-h-[60vh] overflow-auto rounded-lg border border-border bg-muted p-3 text-xs font-mono whitespace-pre-wrap break-words`,children:$})]}),(0,G.jsx)(lt,{children:(0,G.jsx)(M,{variant:`secondary`,size:`sm`,onClick:()=>Rn(!1),children:`Close`})})]})})]})}export{_a as SettingsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{f as e}from"./pendingActionsStore-COTh4Ztq.js";var t={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};t.node;var n=e(t);export{n as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./react-DiVRNtpo.js";import{t as n}from"./jsx-runtime-BdxMnOeJ.js";import{ct as r,et as i,ln as a,nt as o,tt as s}from"./useAppGlobalState-DKOGrO5l.js";import{c,f as l}from"./pendingActionsStore-COTh4Ztq.js";import{Bt as u,Ht as d,Ut as f}from"./lexicalToReact-sPUyOWk6.js";import{p}from"./pushClient-BJH_ITRB.js";import{t as m}from"./createScopedStore-BoLB9Rhc.js";import{S as ee,m as h}from"./useTheme-B57LIKyx.js";import{n as g,r as _,t as v}from"./popover-CHM4skzh.js";var y={name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]};y.node;var b=l(y),x={name:`box`,size:24,node:[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]};x.node;var S=l(x),C={name:`gauge`,size:24,node:[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]};C.node;var w=l(C),T={name:`key-round`,size:24,node:[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]};T.node;var E=l(T),D={name:`lock-open`,size:24,node:[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 9.9-1`,key:`1mm8w8`}]],aliases:[`unlock`]};D.node;var O=l(D),k={name:`lock`,size:24,node:[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]};k.node;var A=l(k),j={name:`settings-2`,size:24,node:[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]};j.node;var M=l(j),N={name:`square-menu`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M7 8h10`,key:`1jw688`}],[`path`,{d:`M7 12h10`,key:`b7w52i`}],[`path`,{d:`M7 16h10`,key:`wp8him`}]],aliases:[`menu-square`]};N.node;var P=l(N),F={name:`square-minus`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}]],aliases:[`minus-square`]};F.node;var I=l(F);function L(e){let t=typeof e==`number`?e:Number(e);return Number.isFinite(t)?Math.min(200,Math.max(60,Math.round(t))):60}var R=e(t(),1),z=m(`InputPopover`,()=>e=>({open:!1,setOpen:t=>e({open:t})}));function B(){return e=>({open:!1,query:``,setQuery:t=>e({query:t}),setPopoverOpen:t=>e(t?{open:!0}:{open:!1,query:``}),closeAndClearQuery:()=>e({open:!1,query:``})})}var V=m(`SearchableModelPopover`,B),H=e(n(),1);function U({className:e,...t}){return(0,H.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,className:c(`shrink-0`,e),...t,children:(0,H.jsx)(`path`,{d:`M17.3041 3.541h-3.6718l6.696 16.918H24Zm-10.6082 0L0 20.459h3.7442l1.3693-3.5527h7.0052l1.3693 3.5528h3.7442L10.5363 3.5409Zm-.3712 10.2232 2.2914-5.9456 2.2914 5.9456Z`})})}function W({className:e,...t}){return(0,H.jsx)(`svg`,{viewBox:`0 0 158.7128 157.296`,fill:`currentColor`,"aria-hidden":`true`,className:c(`shrink-0`,e),...t,children:(0,H.jsx)(`path`,{d:`M60.8734 57.2556V42.3124c0-1.2586.4722-2.2029 1.5728-2.8314l30.0443-17.3023c4.0899-2.3593 8.9662-3.4599 13.9988-3.4599 18.8759 0 30.8307 14.6289 30.8307 30.2006 0 1.1007 0 2.3593-.158 3.6178l-31.1446-18.2467c-1.8872-1.1006-3.7754-1.1006-5.6629 0L60.8734 57.2556Zm70.1542 58.2005V79.7487c0-2.2028-.9446-3.7756-2.8318-4.8763l-39.481-22.9651 12.8982-7.3934c1.1007-.6285 2.0453-.6285 3.1458 0l30.0441 17.3024c8.6523 5.0341 14.4708 15.7296 14.4708 26.1107 0 11.9539-7.0769 22.965-18.2461 27.527ZM51.593 83.9964l-12.8982-7.5497c-1.1007-.6285-1.5728-1.5728-1.5728-2.8314V39.0105c0-16.8303 12.8982-29.5722 30.3585-29.5722 6.607 0 12.7403 2.2029 17.9324 6.1349l-30.987 17.9324c-1.8871 1.1007-2.8314 2.6735-2.8314 4.8764v45.6159ZM79.3562 100.0403 60.8733 89.6592V67.6383l18.4829-10.3811 18.4812 10.3811v22.0209l-18.4812 10.3811Zm11.8757 47.8188c-6.607 0-12.7403-2.2031-17.9324-6.1344l30.9866-17.9333c1.8872-1.1005 2.8318-2.6728 2.8318-4.8759v-45.616l13.0564 7.5498c1.1005.6285 1.5723 1.5728 1.5723 2.8314v34.6051c0 16.8297-13.0564 29.5723-30.5147 29.5723ZM53.9522 112.7822 23.9079 95.4798c-8.652-5.0343-14.471-15.7296-14.471-26.1107 0-12.1119 7.2356-22.9652 18.403-27.5272v35.8634c0 2.2028.9443 3.7756 2.8314 4.8763l39.3248 22.8068-12.8982 7.3938c-1.1007.6287-2.045.6287-3.1456 0ZM52.2229 138.5791c-17.7745 0-30.8306-13.3713-30.8306-29.8871 0-1.2585.1578-2.5169.3143-3.7754l30.987 17.9323c1.8871 1.1005 3.7757 1.1005 5.6628 0l39.4811-22.807v14.9435c0 1.2585-.4721 2.2021-1.5728 2.8308l-30.0443 17.3025c-4.0898 2.359-8.9662 3.4605-13.9989 3.4605h.0014ZM91.2319 157.296c19.0327 0 34.9188-13.5272 38.5383-31.4594 17.6164-4.562 28.9425-21.0779 28.9425-37.908 0-11.0112-4.719-21.7066-13.2133-29.4143.7867-3.3035 1.2595-6.607 1.2595-9.909 0-22.4929-18.2471-39.3247-39.3251-39.3247-4.2461 0-8.3363.6285-12.4262 2.045-7.0792-6.9213-16.8318-11.3254-27.5271-11.3254-19.0331 0-34.9191 13.5268-38.5384 31.4591C11.3255 36.0212 0 52.5373 0 69.3675c0 11.0112 4.7184 21.7065 13.2125 29.4142-.7865 3.3035-1.2586 6.6067-1.2586 9.9092 0 22.4923 18.2466 39.3241 39.3248 39.3241 4.2462 0 8.3362-.6277 12.426-2.0441 7.0776 6.921 16.8302 11.3251 27.5271 11.3251Z`})})}function te({className:e,...t}){return(0,H.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,className:c(`shrink-0`,e),...t,children:[(0,H.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`}),(0,H.jsx)(`path`,{d:`M6.3 6.3a8 8 0 1 0 11.4 11.4`}),(0,H.jsx)(`path`,{d:`M17.7 6.3a8 8 0 0 1 0 11.4`}),(0,H.jsx)(`path`,{d:`M2 12h4`}),(0,H.jsx)(`path`,{d:`M18 12h4`})]})}var G={claude:U,codex:W,openrouter:te};function K({onClick:e,selected:t,icon:n,label:r,description:i,disabled:a}){return(0,H.jsxs)(`button`,{onClick:e,disabled:a,className:c(`w-full flex items-center gap-2 p-2 border border-border/0 rounded-lg text-left transition-opacity`,t?`bg-muted border-border`:`hover:opacity-60`,a&&`opacity-40 cursor-not-allowed`),children:[n,(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`text-sm font-medium`,children:r}),i?(0,H.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:i}):null]})]})}function q({trigger:e,triggerClassName:t,disabled:n=!1,children:r}){return n?(0,H.jsx)(`button`,{disabled:!0,className:c(`flex min-h-[36px] items-center gap-1.5 px-2 py-1 text-sm rounded-md text-muted-foreground [&>svg]:shrink-0 opacity-70 cursor-default [&>span]:whitespace-nowrap`,t),children:e}):(0,H.jsx)(z.Provider,{init:void 0,children:(0,H.jsx)(J,{trigger:e,triggerClassName:t,children:r})})}function J({trigger:e,triggerClassName:t,children:n}){let r=z.useScopedStore(e=>e.open),i=z.useScopedStore(e=>e.setOpen);return(0,H.jsxs)(v,{open:r,onOpenChange:i,children:[(0,H.jsx)(_,{asChild:!0,children:(0,H.jsx)(`button`,{type:`button`,className:c(`flex min-h-[36px] cursor-pointer touch-manipulation items-center gap-1.5 px-2 py-1 text-sm rounded-md transition-colors text-muted-foreground [&>svg]:shrink-0 [&>span]:whitespace-nowrap`,`hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,t),children:e})}),(0,H.jsx)(g,{align:`center`,className:`w-64 p-1`,children:(0,H.jsx)(`div`,{className:`space-y-1`,children:typeof n==`function`?n(()=>i(!1)):n})})]})}function Y({models:e,selectedModel:t,onSelect:n,ModelIcon:r}){return(0,H.jsx)(V.Provider,{init:void 0,children:(0,H.jsx)(X,{models:e,selectedModel:t,onSelect:n,ModelIcon:r})})}function X({models:e,selectedModel:t,onSelect:n,ModelIcon:r}){let i=V.useScopedStore(e=>e.open),a=V.useScopedStore(e=>e.query),o=V.useScopedStore(e=>e.setPopoverOpen),s=V.useScopedStore(e=>e.setQuery),l=V.useScopedStore(e=>e.closeAndClearQuery),d=(0,R.useCallback)(e=>{n(e),l()},[n,l]),f=e.find(e=>e.id===t)?.label??t,p=(0,R.useMemo)(()=>{let t=a.trim().toLowerCase();return t?e.filter(e=>e.id.toLowerCase().includes(t)||e.label.toLowerCase().includes(t)):e},[e,a]),m;return m=e.length===0?(0,H.jsx)(`div`,{className:`px-2 py-3 text-xs text-muted-foreground text-center`,children:`Loading models… verify OpenRouter API key in Settings.`}):p.length===0?(0,H.jsx)(`div`,{className:`px-2 py-3 text-xs text-muted-foreground text-center`,children:`No matches`}):p.map(e=>(0,H.jsx)(K,{onClick:()=>d(e.id),selected:t===e.id,icon:(0,H.jsx)(S,{className:`h-4 w-4 text-muted-foreground`}),label:e.label,description:e.id},e.id)),(0,H.jsxs)(v,{open:i,onOpenChange:o,children:[(0,H.jsx)(_,{asChild:!0,children:(0,H.jsxs)(`button`,{type:`button`,className:c(`flex min-h-[36px] cursor-pointer touch-manipulation items-center gap-1.5 px-2 py-1 text-sm rounded-md transition-colors text-muted-foreground [&>svg]:shrink-0 [&>span]:whitespace-nowrap`,`hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`),children:[(0,H.jsx)(r,{className:`h-3.5 w-3.5`}),(0,H.jsx)(`span`,{className:`max-w-[200px] truncate`,children:f})]})}),(0,H.jsxs)(g,{align:`center`,className:`w-80 p-1`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-1.5 border-b border-border/50`,children:[(0,H.jsx)(u,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),(0,H.jsx)(`input`,{type:`text`,value:a,onChange:e=>s(e.target.value),placeholder:`Search models...`,autoFocus:!0,className:`flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground`})]}),(0,H.jsx)(`div`,{className:`max-h-72 overflow-y-auto py-1 space-y-1`,children:m})]})]})}function Z({availableProviders:e,selectedProvider:t,showProviderPicker:n=!0,showCodexCliRequirementHints:a=!1,model:l,modelOptions:u,onProviderChange:m,onModelChange:g,onModelOptionChange:_,planMode:v=!1,onPlanModeChange:y,includePlanMode:b=!0,className:x}){let C=ee(h),T=e.find(e=>e.id===t)??e[0],E=G[t],D=S,k=b&&T?.supportsPlanMode&&y,j=t===`claude`&&`contextWindow`in u?u:null,M=t===`codex`&&`fastMode`in u?u:null,N=T.models.find(e=>e.id===l)?.contextWindowOptions??[],F=j?.contextWindow??i[0].id,L=F===`1m`?P:I,R=T.models.find(e=>e.id===l)?.label??l,z=t===`openrouter`?(0,H.jsx)(Y,{models:T.models,selectedModel:l,onSelect:e=>g?.(t,e),ModelIcon:D}):(0,H.jsx)(q,{trigger:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(D,{className:`h-3.5 w-3.5`}),(0,H.jsx)(`span`,{children:R})]}),children:e=>T.models.map(n=>{let r=S;return(0,H.jsx)(K,{onClick:()=>{g?.(t,n.id),e()},selected:l===n.id,icon:(0,H.jsx)(r,{className:`h-4 w-4 text-muted-foreground`}),label:a&&t===`codex`&&n.id===`gpt-5.5`?(0,H.jsxs)(H.Fragment,{children:[n.label,` `,(0,H.jsx)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:`codex-cli >= 0.124`})]}):n.label},n.id)})});return(0,H.jsxs)(`div`,{className:c(`flex md:justify-center items-center gap-0.5`,x),children:[n?(0,H.jsx)(q,{disabled:!m,trigger:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(E,{className:`h-3.5 w-3.5`}),(0,H.jsx)(`span`,{children:T?.label??t})]}),children:n=>e.map(e=>{let r=G[e.id];return(0,H.jsx)(K,{onClick:()=>{m?.(e.id),n()},selected:t===e.id,icon:(0,H.jsx)(r,{className:`h-4 w-4 text-muted-foreground`}),label:e.label},e.id)})}):null,g==null?(0,H.jsx)(p,{label:`Model is locked while a cron job is running — pause or remove the cron job to change it`,side:`top`,children:(0,H.jsxs)(`span`,{"aria-disabled":`true`,className:`flex min-h-[36px] items-center gap-1.5 px-2 py-1 text-sm rounded-md text-muted-foreground [&>svg]:shrink-0 opacity-70 cursor-default [&>span]:whitespace-nowrap`,children:[(0,H.jsx)(A,{className:`h-3.5 w-3.5`}),(0,H.jsx)(`span`,{children:R})]})}):z,t===`openrouter`?null:(0,H.jsx)(q,{trigger:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(f,{className:`h-3.5 w-3.5`}),(0,H.jsx)(`span`,{children:t===`claude`?s.find(e=>e.id===u.reasoningEffort)?.label??u.reasoningEffort:o.find(e=>e.id===u.reasoningEffort)?.label??u.reasoningEffort})]}),children:e=>t===`claude`?r(l,C).map(t=>(0,H.jsx)(K,{onClick:()=>{_({type:`claudeReasoningEffort`,effort:t.id}),e()},selected:u.reasoningEffort===t.id,icon:(0,H.jsx)(f,{className:`h-4 w-4 text-muted-foreground`}),label:t.label},t.id)):o.map(t=>(0,H.jsx)(K,{onClick:()=>{_({type:`codexReasoningEffort`,effort:t.id}),e()},selected:u.reasoningEffort===t.id,icon:(0,H.jsx)(f,{className:`h-4 w-4 text-muted-foreground`}),label:t.label},t.id))}),t===`claude`&&N.length>1?(0,H.jsx)(q,{trigger:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(L,{className:`h-3.5 w-3.5`}),(0,H.jsx)(`span`,{children:N.find(e=>e.id===F)?.label??F})]}),children:e=>N.map(t=>(0,H.jsx)(K,{onClick:()=>{_({type:`contextWindow`,contextWindow:t.id}),e()},selected:F===t.id,icon:t.id===`1m`?(0,H.jsx)(P,{className:`h-4 w-4 text-muted-foreground`}):(0,H.jsx)(I,{className:`h-4 w-4 text-muted-foreground`}),label:t.label,description:t.id===`1m`?`Expanded context window`:`Standard context window`},t.id))}):null,t===`codex`?(0,H.jsx)(q,{trigger:(0,H.jsxs)(H.Fragment,{children:[M?.fastMode?(0,H.jsx)(w,{className:`h-3.5 w-3.5`}):(0,H.jsx)(w,{className:`h-3.5 w-3.5 -scale-x-100`}),(0,H.jsx)(`span`,{children:M?.fastMode?`Fast Mode`:`Standard`})]}),triggerClassName:M?.fastMode?`text-success-text`:void 0,children:e=>(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(K,{onClick:()=>{_({type:`fastMode`,fastMode:!1}),e()},selected:!M?.fastMode,icon:(0,H.jsx)(w,{className:`h-4 w-4 text-muted-foreground -scale-x-100`}),label:`Standard`}),(0,H.jsx)(K,{onClick:()=>{_({type:`fastMode`,fastMode:!0}),e()},selected:!!M?.fastMode,icon:(0,H.jsx)(w,{className:`h-4 w-4 text-muted-foreground`}),label:`Fast Mode`})]})}):null,k?(0,H.jsx)(q,{trigger:(0,H.jsxs)(H.Fragment,{children:[v?(0,H.jsx)(d,{className:`h-3.5 w-3.5`}):(0,H.jsx)(O,{className:`h-3.5 w-3.5`}),(0,H.jsx)(`span`,{children:v?`Plan Mode`:`Full Access`})]}),triggerClassName:v?`text-info-text`:void 0,children:e=>(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(K,{onClick:()=>{y(!1),e()},selected:!v,icon:(0,H.jsx)(O,{className:`h-4 w-4 text-muted-foreground`}),label:`Full Access`,description:`Execution without approval`}),(0,H.jsx)(K,{onClick:()=>{y(!0),e()},selected:v,icon:(0,H.jsx)(d,{className:`h-4 w-4 text-muted-foreground`}),label:`Plan Mode`,description:`Review a plan before execution`})]})}):null]})}var ne=[{value:`cursor`,label:`Cursor`},{value:`xcode`,label:`Xcode`},{value:`windsurf`,label:`Windsurf`},{value:`custom`,label:`Custom`}],Q={cursor:`/editor-icons/cursor.png`,defaultApp:`/editor-icons/default-app.png`,finder:`/editor-icons/finder.png`,preview:`/editor-icons/preview.png`,xcode:`/editor-icons/xcode.png`,terminal:`/editor-icons/terminal.png`,windsurf:`/editor-icons/windsurf.png`,custom:`/editor-icons/custom.png`};function $({src:e,className:t}){return(0,H.jsx)(`img`,{src:e,alt:``,"aria-hidden":`true`,draggable:!1,className:t})}function re({preset:e,className:t}){switch(e){case`xcode`:return(0,H.jsx)($,{src:Q.xcode,className:t});case`windsurf`:return(0,H.jsx)($,{src:Q.windsurf,className:t});case`custom`:return(0,H.jsx)($,{src:Q.custom,className:t});default:return(0,H.jsx)($,{src:Q.cursor,className:t})}}function ie({className:e}){return(0,H.jsx)($,{src:Q.finder,className:e})}function ae({className:e}){return(0,H.jsx)($,{src:Q.preview,className:e})}function oe({className:e}){return(0,H.jsx)($,{src:Q.defaultApp,className:e})}function se({className:e}){return(0,H.jsx)(a,{className:e})}function ce({className:e}){return(0,H.jsx)($,{src:Q.terminal,className:e})}export{se as a,Z as c,A as d,E as f,ie as i,L as l,ne as n,ae as o,b as p,re as r,ce as s,oe as t,M as u};
|