ompchamber 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -6
- package/dist/client/index.html +1 -1
- package/dist/client/static/css/index.5291f58223.css +2 -0
- package/dist/client/static/js/async/{1k.544adbf77d.js → 1k.5974df3b87.js} +2 -2
- package/dist/client/static/js/async/3j.357c80ff38.js +2 -0
- package/dist/client/static/js/async/{3y.22075aa079.js → 3y.ededeebde8.js} +5 -5
- package/dist/client/static/js/async/51.95bcae98af.js +2 -0
- package/dist/client/static/js/async/6.f034c9b528.js +1 -0
- package/dist/client/static/js/async/a.e05da304c8.js +10 -0
- package/dist/client/static/js/async/ar.1e14da5588.js +1 -0
- package/dist/client/static/js/async/art.62139ed479.js +2 -0
- package/dist/client/static/js/async/ct.b74928f7a3.js +1 -0
- package/dist/client/static/js/async/fw.6a51998a8e.js +6 -0
- package/dist/client/static/js/async/g.7a4bbd4798.js +2 -0
- package/dist/client/static/js/async/g.7a4bbd4798.js.LICENSE.txt +11 -0
- package/dist/client/static/js/async/{k.e878dd350f.js → k.7466330d1a.js} +2 -2
- package/dist/client/static/js/async/katex-vendor.de6a87c308.js +1 -0
- package/dist/client/static/js/async/kc.bbdb35b771.js +1 -0
- package/dist/client/static/js/async/l6.c56640c205.js +1 -0
- package/dist/client/static/js/async/{m.3fc017a055.js → m.4b29d34f93.js} +3 -3
- package/dist/client/static/js/async/{og.ae7acf03ac.js → og.634fba99ac.js} +2 -2
- package/dist/client/static/js/async/q.7fb4d2f374.js +21 -0
- package/dist/client/static/js/async/rd.cb6bf495bb.js +2 -0
- package/dist/client/static/js/async/rf.d626afc367.js +2 -0
- package/dist/client/static/js/async/s.413c2a4683.js +2 -0
- package/dist/client/static/js/async/s.413c2a4683.js.LICENSE.txt +6 -0
- package/dist/client/static/js/async/sy.d16be843a7.js +94 -0
- package/dist/client/static/js/async/t.cb3fcf8615.js +1 -0
- package/dist/client/static/js/async/ud.3065bfee31.js +2 -0
- package/dist/client/static/js/async/uf.46ad6209fa.js +2 -0
- package/dist/client/static/js/async/uf.46ad6209fa.js.LICENSE.txt +6 -0
- package/dist/client/static/js/async/v.7d28d3c241.js +34 -0
- package/dist/client/static/js/async/v0.394ed37c6b.js +2 -0
- package/dist/client/static/js/async/v0.394ed37c6b.js.LICENSE.txt +6 -0
- package/dist/client/static/js/async/vt.42416b707d.js +1 -0
- package/dist/client/static/js/async/vy.bbe114c4e0.js +2 -0
- package/dist/client/static/js/async/vy.bbe114c4e0.js.LICENSE.txt +6 -0
- package/dist/client/static/js/async/xw.ae67ba06fd.js +31 -0
- package/dist/client/static/js/async/xw.ae67ba06fd.js.LICENSE.txt +4 -0
- package/dist/client/static/js/async/yg.35bebd6d0c.js +149 -0
- package/dist/client/static/js/async/yv.2fa22f009a.js +1 -0
- package/dist/client/static/js/index.bf1b1fe988.js +33 -0
- package/dist/client/static/js/index.bf1b1fe988.js.LICENSE.txt +4 -0
- package/dist/client/static/js/{markdown-vendor.9da142c67b.js → markdown-vendor.71e43278b3.js} +1 -1
- package/dist/client/static/js/uy.5f791144ce.js +139 -0
- package/package.json +2 -1
- package/src/client/App.tsx +22 -5
- package/src/client/components/common/MarkdownRenderer.tsx +36 -0
- package/src/client/components/layout/desktop-layout/index.tsx +1 -1
- package/src/client/components/layout/session-sidebar/Modals.tsx +1 -1
- package/src/client/components/mobile/LayoutWrapper.tsx +1 -1
- package/src/client/components/settings/LazyModal.tsx +46 -0
- package/src/client/components/settings/Modal.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/EmptyWorkspacePrompt.tsx +43 -29
- package/src/client/components/workspace/chat-timeline/MessageItem.tsx +15 -69
- package/src/client/components/workspace/chat-timeline/MessageList.tsx +47 -66
- package/src/client/components/workspace/chat-timeline/RunFooter.tsx +60 -0
- package/src/client/components/workspace/chat-timeline/SubagentView.tsx +37 -21
- package/src/client/components/workspace/chat-timeline/ToolCallCard.tsx +22 -4
- package/src/client/components/workspace/chat-timeline/index.tsx +3 -6
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Edit.tsx +15 -19
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/EnvelopeHeader.tsx +46 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/FallbackOutput.tsx +18 -68
- package/src/client/components/workspace/file-explorer/TreeItem.tsx +8 -2
- package/src/client/hooks/chat/omp/index.ts +9 -10
- package/src/client/hooks/chat/omp/revalidation-throttle.ts +6 -5
- package/src/client/hooks/chat/timeline/actions.ts +1 -2
- package/src/client/hooks/chat/timeline/index.ts +5 -0
- package/src/client/hooks/chat/timeline/send.ts +1 -2
- package/src/client/hooks/chat/timeline/session-load.ts +3 -4
- package/src/client/hooks/ui/syntax-ready.ts +16 -3
- package/src/client/main.tsx +2 -5
- package/src/client/stubs/elkjs.ts +37 -0
- package/src/client/tailwind.css +10 -0
- package/src/server/lib/fs/git-ignore.ts +49 -0
- package/src/server/lib/omp/rpc/constants.ts +10 -0
- package/src/server/lib/omp/rpc/lifecycle.test.ts +138 -0
- package/src/server/lib/omp/rpc/manager.ts +32 -4
- package/src/server/lib/omp/rpc/session-commands.ts +32 -9
- package/src/server/lib/omp/rpc/session-registry.ts +3 -2
- package/src/server/lib/omp/rpc/subagent-liveness.test.ts +62 -0
- package/src/server/lib/omp/rpc/subagent-liveness.ts +100 -0
- package/src/server/lib/omp/session/messages.test.ts +112 -0
- package/src/server/lib/omp/session/messages.ts +6 -5
- package/src/server/routes/agent/command.ts +34 -16
- package/src/server/routes/fs/read.ts +15 -7
- package/src/shared/lib/chat/notice-row.test.ts +89 -0
- package/src/shared/lib/chat/notice-row.ts +78 -0
- package/src/shared/lib/chat/omp/abort.ts +41 -0
- package/src/shared/lib/chat/timeline/omp-callbacks.test.ts +154 -0
- package/src/shared/lib/chat/timeline/omp-callbacks.ts +36 -7
- package/src/shared/lib/chat/timeline/run-footer.test.ts +84 -0
- package/src/shared/lib/chat/timeline/run-footer.ts +96 -0
- package/src/shared/lib/chat/tool-output.test.ts +91 -0
- package/src/shared/lib/chat/tool-output.ts +54 -0
- package/src/shared/lib/chat/xml-envelope.ts +158 -0
- package/src/shared/lib/code/highlighter-lazy.ts +106 -0
- package/src/shared/lib/code/highlighter.ts +31 -52
- package/src/shared/lib/code/syntax-highlight.test.ts +36 -1
- package/src/shared/lib/code/syntax-highlight.ts +17 -3
- package/src/shared/lib/format/time.ts +19 -0
- package/src/shared/lib/markdown/fira-code-fonts.css +51 -0
- package/src/shared/lib/markdown/katex-fonts.css +20 -0
- package/src/shared/lib/markdown/katex.ts +101 -0
- package/src/shared/lib/markdown/marked.ts +23 -14
- package/src/shared/lib/markdown/math.test.ts +109 -0
- package/src/shared/lib/markdown/mermaid.ts +6 -0
- package/src/shared/lib/markdown/sanitize.ts +48 -2
- package/src/shared/lib/omp/session/mapper.ts +11 -3
- package/src/shared/lib/omp/session/messages-map.ts +12 -12
- package/src/shared/types/chat.ts +3 -1
- package/src/shared/types/fs.ts +3 -0
- package/dist/client/static/css/g.f36aa429fa.css +0 -1
- package/dist/client/static/css/index.a0f07455bd.css +0 -2
- package/dist/client/static/css/katex-vendor.ca3a0600e8.css +0 -1
- package/dist/client/static/font/KaTeX_AMS-Regular.1608a09b4a.woff +0 -0
- package/dist/client/static/font/KaTeX_AMS-Regular.4aafdb685c.ttf +0 -0
- package/dist/client/static/font/KaTeX_Caligraphic-Bold.b67709187b.woff +0 -0
- package/dist/client/static/font/KaTeX_Caligraphic-Bold.cce5b8ecea.ttf +0 -0
- package/dist/client/static/font/KaTeX_Caligraphic-Regular.07ef19e7b0.ttf +0 -0
- package/dist/client/static/font/KaTeX_Caligraphic-Regular.dad44a7fc6.woff +0 -0
- package/dist/client/static/font/KaTeX_Fraktur-Bold.9f256b8593.woff +0 -0
- package/dist/client/static/font/KaTeX_Fraktur-Bold.b18f59e1d1.ttf +0 -0
- package/dist/client/static/font/KaTeX_Fraktur-Regular.7c1871215e.woff +0 -0
- package/dist/client/static/font/KaTeX_Fraktur-Regular.ed38e79f57.ttf +0 -0
- package/dist/client/static/font/KaTeX_Main-Bold.b74a1a8b2c.ttf +0 -0
- package/dist/client/static/font/KaTeX_Main-Bold.d181c4650d.woff +0 -0
- package/dist/client/static/font/KaTeX_Main-BoldItalic.70d8b0a530.ttf +0 -0
- package/dist/client/static/font/KaTeX_Main-BoldItalic.e3f82f9d27.woff +0 -0
- package/dist/client/static/font/KaTeX_Main-Italic.47373d1e51.ttf +0 -0
- package/dist/client/static/font/KaTeX_Main-Italic.9024d815ba.woff +0 -0
- package/dist/client/static/font/KaTeX_Main-Regular.7f51fe0340.woff +0 -0
- package/dist/client/static/font/KaTeX_Main-Regular.b7f8fe9b5f.ttf +0 -0
- package/dist/client/static/font/KaTeX_Math-BoldItalic.a879cf8383.ttf +0 -0
- package/dist/client/static/font/KaTeX_Math-BoldItalic.f1035d8d5d.woff +0 -0
- package/dist/client/static/font/KaTeX_Math-Italic.5295ba483a.woff +0 -0
- package/dist/client/static/font/KaTeX_Math-Italic.939bc64440.ttf +0 -0
- package/dist/client/static/font/KaTeX_SansSerif-Bold.94e1e8dc5f.ttf +0 -0
- package/dist/client/static/font/KaTeX_SansSerif-Bold.bf59d231c3.woff +0 -0
- package/dist/client/static/font/KaTeX_SansSerif-Italic.7c9bc82b17.woff +0 -0
- package/dist/client/static/font/KaTeX_SansSerif-Italic.b4c20c84d8.ttf +0 -0
- package/dist/client/static/font/KaTeX_SansSerif-Regular.740484788f.woff +0 -0
- package/dist/client/static/font/KaTeX_SansSerif-Regular.d4d7ba4804.ttf +0 -0
- package/dist/client/static/font/KaTeX_Script-Regular.0750571032.woff +0 -0
- package/dist/client/static/font/KaTeX_Script-Regular.fe9cbbe1a0.ttf +0 -0
- package/dist/client/static/font/KaTeX_Size1-Regular.e1e279cbdd.woff +0 -0
- package/dist/client/static/font/KaTeX_Size1-Regular.fabc004aab.ttf +0 -0
- package/dist/client/static/font/KaTeX_Size2-Regular.577270225e.woff +0 -0
- package/dist/client/static/font/KaTeX_Size2-Regular.d6b476ecd3.ttf +0 -0
- package/dist/client/static/font/KaTeX_Size3-Regular.9acaf01c64.woff +0 -0
- package/dist/client/static/font/KaTeX_Size3-Regular.a144ef5840.ttf +0 -0
- package/dist/client/static/font/KaTeX_Size4-Regular.7a996c9da2.woff +0 -0
- package/dist/client/static/font/KaTeX_Size4-Regular.fbccdabe0a.ttf +0 -0
- package/dist/client/static/font/KaTeX_Typewriter-Regular.6258592bdc.woff +0 -0
- package/dist/client/static/font/KaTeX_Typewriter-Regular.d97aaf4a1e.ttf +0 -0
- package/dist/client/static/font/fira-code-cyrillic-400-normal.5971438a4a.woff2 +0 -0
- package/dist/client/static/font/fira-code-cyrillic-400-normal.9bb7bfea9c.woff +0 -0
- package/dist/client/static/font/fira-code-cyrillic-500-normal.5486265b18.woff2 +0 -0
- package/dist/client/static/font/fira-code-cyrillic-500-normal.89f92bfb31.woff +0 -0
- package/dist/client/static/font/fira-code-cyrillic-600-normal.2805b497e5.woff +0 -0
- package/dist/client/static/font/fira-code-cyrillic-600-normal.86e0df22a3.woff2 +0 -0
- package/dist/client/static/font/fira-code-cyrillic-700-normal.505a88f22a.woff +0 -0
- package/dist/client/static/font/fira-code-cyrillic-700-normal.76f5e8d2e2.woff2 +0 -0
- package/dist/client/static/font/fira-code-cyrillic-ext-400-normal.3c4b15e57d.woff2 +0 -0
- package/dist/client/static/font/fira-code-cyrillic-ext-400-normal.61323debaa.woff +0 -0
- package/dist/client/static/font/fira-code-cyrillic-ext-500-normal.0f34210f2a.woff2 +0 -0
- package/dist/client/static/font/fira-code-cyrillic-ext-500-normal.2497cfa1aa.woff +0 -0
- package/dist/client/static/font/fira-code-cyrillic-ext-600-normal.40fce94af9.woff2 +0 -0
- package/dist/client/static/font/fira-code-cyrillic-ext-600-normal.6c8774b829.woff +0 -0
- package/dist/client/static/font/fira-code-cyrillic-ext-700-normal.4b742eb865.woff +0 -0
- package/dist/client/static/font/fira-code-cyrillic-ext-700-normal.e75eb4fccc.woff2 +0 -0
- package/dist/client/static/font/fira-code-greek-400-normal.bb900468b6.woff2 +0 -0
- package/dist/client/static/font/fira-code-greek-400-normal.be76e699ba.woff +0 -0
- package/dist/client/static/font/fira-code-greek-500-normal.176c9fb001.woff2 +0 -0
- package/dist/client/static/font/fira-code-greek-500-normal.d2c596136b.woff +0 -0
- package/dist/client/static/font/fira-code-greek-600-normal.490c3deed7.woff +0 -0
- package/dist/client/static/font/fira-code-greek-600-normal.7df14376d9.woff2 +0 -0
- package/dist/client/static/font/fira-code-greek-700-normal.c82b6072fc.woff2 +0 -0
- package/dist/client/static/font/fira-code-greek-700-normal.d5f2b2917b.woff +0 -0
- package/dist/client/static/font/fira-code-greek-ext-400-normal.4849a79781.woff +0 -0
- package/dist/client/static/font/fira-code-greek-ext-400-normal.7f5bfc4538.woff2 +0 -0
- package/dist/client/static/font/fira-code-greek-ext-500-normal.aaccca4075.woff2 +0 -0
- package/dist/client/static/font/fira-code-greek-ext-500-normal.e383181256.woff +0 -0
- package/dist/client/static/font/fira-code-greek-ext-600-normal.78cb4bff8e.woff +0 -0
- package/dist/client/static/font/fira-code-greek-ext-600-normal.d6c93d54f9.woff2 +0 -0
- package/dist/client/static/font/fira-code-greek-ext-700-normal.57ec7c92d9.woff +0 -0
- package/dist/client/static/font/fira-code-greek-ext-700-normal.8fafdae5e8.woff2 +0 -0
- package/dist/client/static/font/fira-code-latin-400-normal.973295532b.woff +0 -0
- package/dist/client/static/font/fira-code-latin-500-normal.7ae2be8fb8.woff +0 -0
- package/dist/client/static/font/fira-code-latin-600-normal.1dbbe5bc27.woff +0 -0
- package/dist/client/static/font/fira-code-latin-700-normal.497a70148b.woff +0 -0
- package/dist/client/static/font/fira-code-latin-ext-400-normal.9dfae29aaf.woff +0 -0
- package/dist/client/static/font/fira-code-latin-ext-400-normal.e534ae46e2.woff2 +0 -0
- package/dist/client/static/font/fira-code-latin-ext-500-normal.24c7b781b0.woff +0 -0
- package/dist/client/static/font/fira-code-latin-ext-500-normal.aad44ab072.woff2 +0 -0
- package/dist/client/static/font/fira-code-latin-ext-600-normal.7bed0f2f7e.woff +0 -0
- package/dist/client/static/font/fira-code-latin-ext-600-normal.c509a7c9f1.woff2 +0 -0
- package/dist/client/static/font/fira-code-latin-ext-700-normal.6c66c8b0a9.woff2 +0 -0
- package/dist/client/static/font/fira-code-latin-ext-700-normal.88f64e2822.woff +0 -0
- package/dist/client/static/font/fira-code-symbols2-400-normal.97d3f4b17c.woff +0 -0
- package/dist/client/static/font/fira-code-symbols2-500-normal.b06f1a06e4.woff +0 -0
- package/dist/client/static/font/fira-code-symbols2-600-normal.304b653b93.woff +0 -0
- package/dist/client/static/font/fira-code-symbols2-700-normal.d8ce0ad586.woff +0 -0
- package/dist/client/static/js/async/3j.a2fcea99be.js +0 -2
- package/dist/client/static/js/async/51.1938cec320.js +0 -2
- package/dist/client/static/js/async/6.7929428505.js +0 -1
- package/dist/client/static/js/async/69.a18a10882f.js +0 -1
- package/dist/client/static/js/async/a.bce4542392.js +0 -1
- package/dist/client/static/js/async/ar.9dc8b1992a.js +0 -2
- package/dist/client/static/js/async/bi.cbfe8eaa8e.js +0 -1
- package/dist/client/static/js/async/ct.38d9da8a5a.js +0 -1
- package/dist/client/static/js/async/fw.fb1a08b92d.js +0 -6
- package/dist/client/static/js/async/l6.45f3b62e15.js +0 -1
- package/dist/client/static/js/async/q.0b6fb9bf8d.js +0 -21
- package/dist/client/static/js/async/rd.b77011ab7f.js +0 -2
- package/dist/client/static/js/async/rf.cfbde7f744.js +0 -2
- package/dist/client/static/js/async/s.c7d521a8ae.js +0 -2
- package/dist/client/static/js/async/sy.7345abcd67.js +0 -94
- package/dist/client/static/js/async/t.0dcb01dfde.js +0 -1
- package/dist/client/static/js/async/v.5c7a4b087b.js +0 -1
- package/dist/client/static/js/async/vu.311f1d202c.js +0 -34
- package/dist/client/static/js/async/yg.9bd4e09ecb.js +0 -149
- package/dist/client/static/js/async/yv.593a3f7d54.js +0 -1
- package/dist/client/static/js/g.124fba0826.js +0 -139
- package/dist/client/static/js/index.907fd4670e.js +0 -68
- package/dist/client/static/js/katex-vendor.95e48cf65a.js +0 -1
- package/src/shared/lib/chat/order.ts +0 -40
- /package/dist/client/static/js/async/{1k.544adbf77d.js.LICENSE.txt → 1k.5974df3b87.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/async/{3j.a2fcea99be.js.LICENSE.txt → 3j.357c80ff38.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/async/{3y.22075aa079.js.LICENSE.txt → 3y.ededeebde8.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/async/{51.1938cec320.js.LICENSE.txt → 51.95bcae98af.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/async/{ar.9dc8b1992a.js.LICENSE.txt → a.e05da304c8.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/async/{fw.fb1a08b92d.js.LICENSE.txt → art.62139ed479.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/async/{m.3fc017a055.js.LICENSE.txt → fw.6a51998a8e.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/async/{q.0b6fb9bf8d.js.LICENSE.txt → m.4b29d34f93.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/async/{rf.cfbde7f744.js.LICENSE.txt → q.7fb4d2f374.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/async/{rd.b77011ab7f.js.LICENSE.txt → rd.cb6bf495bb.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/async/{s.c7d521a8ae.js.LICENSE.txt → rf.d626afc367.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/{index.907fd4670e.js.LICENSE.txt → async/ud.3065bfee31.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/{g.124fba0826.js.LICENSE.txt → uy.5f791144ce.js.LICENSE.txt} +0 -0
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/*! LICENSE: index.907fd4670e.js.LICENSE.txt */
|
|
2
|
-
(()=>{"use strict";var e,t,n,i,r,a={d(e,t,n){n.d(t,{T:()=>S});var i=n("j"),r=n("H"),a=n("XT"),l=n("HA"),s=n("Bi"),o=n("rt"),c=n("qg");function d(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function p(e,t){try{return s.Ay.renderToString(e,{throwOnError:!1,displayMode:t})}catch{return t?`<p>${e}</p>`:e}}let u=new a.Dz({gfm:!0,breaks:!0});function m(e,t){let n=e.replace(/"/g,""");return`<div class="code-block">
|
|
3
|
-
<button type="button" class="code-copy-float" data-copy="${n}" aria-label="Copy code">
|
|
4
|
-
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>
|
|
5
|
-
</button>
|
|
6
|
-
${t}
|
|
7
|
-
</div>
|
|
8
|
-
`}u.use((0,l.A)()),u.use({renderer:{code:e=>e.raw&&/^```/.test(e.raw)||(e.text??"").includes("\n")?function(e){let t=e.lang?.trim()||"text",n=e.text??"";if("mermaid"===t){let e,t;return e=`<pre><code class="language-mermaid">${d(n)}</code></pre>`,t=m(n,e),`<div class="mermaid-block" data-mermaid="${encodeURIComponent(n)}" data-mermaid-state="pending">${t}</div>`}let i="text"===t?d(n):(0,c.wY)(n,t);return m(n,`<pre><code class="language-${t}">${i}</code></pre>`)}(e):`<code class="inline-code">${d(e.text??"")}</code>`,codespan:e=>`<code class="inline-code">${d(e.text??"")}</code>`}}),u.use({extensions:[{name:"inlineMath",level:"inline",start:e=>e.match(/\\\(/)?.index,tokenizer(e){let t=/^\\\(([\s\S]+?)\\\)/.exec(e);return t?{type:"inlineMath",raw:t[0],text:t[1]}:void 0},renderer:e=>p(e.text??"",!1)},{name:"blockMath",level:"block",start:e=>e.match(/^\\\[/)?.index,tokenizer(e){let t=/^\\\[([\s\S]+?)\\\]/.exec(e);return t?{type:"blockMath",raw:t[0],text:t[1]}:void 0},renderer:e=>p(e.text??"",!0)},{name:"blockMathDisplay",level:"block",start:e=>e.match(/^\$\$/)?.index,tokenizer(e){let t=/^\$\$([\s\S]+?)\$\$(?:\n|$)/.exec(e);return t?{type:"blockMathDisplay",raw:t[0],text:t[1]}:void 0},renderer:e=>p(e.text??"",!0)},{name:"inlineMathDollar",level:"inline",start(e){let t=/(^|[^\w$])\$(?!\$)(?!\s)/.exec(e);return t?t.index+(t[1]?.length??0):void 0},tokenizer(e){let t=/^\$(?!\$)(?!\s)((?:\\\$|[^$])*?)(?<!\s)\$(?!\$)(?!\d)/.exec(e);return t?{type:"inlineMathDollar",raw:t[0],text:t[1]}:void 0},renderer:e=>p(e.text??"",!1)}]});let h=/\[([^\]]*)\]\(streamdown:incomplete-link\)/g;var b=n("ok");let f=new Map,x=null,g=null;function v(){let e=document.documentElement.dataset.theme||document.documentElement.getAttribute("data-theme");return"one-dark-pro-soft"===e||"noir"===e||"dark"===e?"dark":"default"}function k(e,t){return`${e}\0${t}`}async function y(e){return x&&g===e||(g=e,x=Promise.all([n.e("a3"),n.e("3y")]).then(n.bind(n,"Fl")).then(t=>(t.default.initialize({startOnLoad:!1,securityLevel:"strict",theme:e,flowchart:{useMaxWidth:!1,wrappingWidth:1e5},sequence:{useMaxWidth:!1}}),t.default)).catch(e=>{throw x=null,e})),x}function w(e,t,n){let i=(e.dataset.mermaid??"").replace(/"/g,""");e.innerHTML=`<button type="button" class="code-copy-float" data-copy="${i}" aria-label="Copy diagram source"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg></button>`+t,e.dataset.mermaidState="done",e.dataset.mermaidTheme=n;let r=e.querySelector(":scope > svg"),a=Number(r?.getAttribute("width"));r&&Number.isFinite(a)&&a>0&&e.style.setProperty("--mermaid-diagram-max",`${Math.round(.8*a)}px`)}let N=0;async function Y(e,t){let n=e.dataset.mermaid;if(null==n)return!1;let i=v(),r=decodeURIComponent(n),a=f.get(k(i,r))??null;if(a)return w(e,a,i),!0;if(t)return!0;e.dataset.mermaidState="rendering";try{let t=await y(i),{svg:n}=await t.render(`mermaid-svg-${Date.now()}-${N++}`,r);if(!e.isConnected)return!1;let a=(0,b.V)(n);if(f.size>=60){let e=f.keys().next().value;void 0!==e&&f.delete(e)}return f.set(k(i,r),a),w(e,a,i),!0}catch{return e.isConnected&&(e.dataset.mermaidState="error"),!1}}async function D(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=v(),i=Array.from(e.querySelectorAll(".mermaid-block")),r=await Promise.all(i.map(async e=>{let i=e.dataset.mermaidState,r=e.dataset.mermaidTheme===n;return"done"===i&&!!r&&!t.force||"rendering"!==i&&Y(e,!0===t.cachedOnly)}));return{rendered:r.filter(Boolean).length,failed:r.filter(e=>!e).length}}var A=n("pH"),F=n("Po");let C="u"<typeof window?r.vJ:r.Nf;function S(e){let{content:t,className:n=""}=e,a=(0,r.li)(null),l=(0,F.w)(),s=(0,r.Kr)(()=>{let e,n;if(!t)return"";let i=(e=t.split("`").map((e,t)=>t%2==1?e:e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")).join("`"),n=(0,o.Ay)(e,{katex:!0,inlineKatex:!0}).replace(h,(e,t)=>`<span class="md-incomplete-link">${t}</span>`),u.parse(n).trim());return(0,b.p)(i)},[t,l]),c=s.includes("mermaid-block");C(()=>{let e;if(!c||"u"<typeof window)return;let t=a.current;if(!t)return;let n=()=>{let e=a.current;e&&e.isConnected&&D(e)};n();let i=new MutationObserver(()=>{let t=a.current;t?.isConnected&&D(t,{cachedOnly:!0}),window.clearTimeout(e),e=window.setTimeout(n,120)});i.observe(t,{childList:!0});let r=()=>n();return window.addEventListener("omp:theme-changed",r),()=>{window.clearTimeout(e),i.disconnect(),window.removeEventListener("omp:theme-changed",r)}},[c,s]);let d=(0,r.hb)(e=>{let t=e.target.closest("button.code-copy-float");if(!t)return;let n=t.dataset.copy??"";n&&(e.preventDefault(),e.stopPropagation(),(0,A.l)(n).then(e=>{e&&(t.setAttribute("data-copied","true"),t.innerHTML='<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>',setTimeout(()=>{t.removeAttribute("data-copied"),t.innerHTML='<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>'},2e3))}))},[]);return t?(0,i.Y)("div",{ref:a,className:`prose-content text-[13px] text-ink leading-relaxed select-text ${n}`,onClick:d,dangerouslySetInnerHTML:{__html:s}}):null}},nj(e,t,n){var i=n("j");function r(e){let{value:t,label:n,hint:r,tone:a="default",variant:l="metric",className:s=""}=e;return"compact"===l?(0,i.FD)("div",{className:"bg-canvas border border-ink/10 rounded-lg px-2.5 py-1.5 flex flex-col gap-0.5 flex-1 min-w-0",children:[(0,i.Y)("span",{className:"text-[10px] font-medium text-ink/50",children:n}),(0,i.Y)("span",{className:"text-xs font-semibold font-mono text-ink truncate",children:t})]}):(0,i.FD)("div",{className:`${"muted"===a?"bg-ink/5 border-ink/10":"bg-paper border-ink/15"} border rounded-lg p-3 shadow-xs flex flex-col justify-between h-full min-w-0 ${s}`,children:[(0,i.FD)("div",{className:"min-w-0",children:[(0,i.Y)("div",{className:"text-base font-bold tracking-tight text-ink leading-tight tabular-nums break-normal",children:t}),(0,i.Y)("div",{className:"text-[11px] font-semibold text-ink/75 mt-1.5 leading-snug min-h-[30px] flex items-start",children:(0,i.Y)("span",{className:"min-w-0 break-normal",children:n})})]}),r&&(0,i.Y)("div",{className:"text-[10px] text-ink/50 mt-1.5 leading-tight break-words",children:r})]})}n.d(t,{h:()=>r})},wu(e,t,n){n.d(t,{y:()=>d});var i=n("j"),r=n("H"),a=n("G"),l=n("p"),s=n("mX"),o=n("S");function c(e){let{toast:t,onDismiss:n,duration:c}=e,[d,p]=(0,r.J0)(!1),u=c??t.duration??4e3,m=(0,r.li)(null);return(0,r.vJ)(()=>{let e=requestAnimationFrame(()=>p(!0)),i=setTimeout(()=>{p(!1),m.current=setTimeout(()=>n(t.id),200)},u);return()=>{cancelAnimationFrame(e),clearTimeout(i),m.current&&clearTimeout(m.current)}},[t.id,u,n]),(0,a.d5)((0,i.FD)("div",{className:`fixed bottom-4 right-4 z-[200] flex items-center space-x-2 bg-paper border shadow-2xl rounded-lg px-4 py-3 text-xs font-sans transition-all duration-200 ${"error"===t.type?"border-error/40":"border-ink/15"} ${d?"opacity-100 translate-y-0":"opacity-0 translate-y-2"}`,role:"status",children:["error"===t.type?(0,i.Y)(l.A,{size:15,className:"text-error flex-shrink-0"}):(0,i.Y)(s.A,{size:15,className:"text-success flex-shrink-0"}),(0,i.Y)("span",{className:"text-ink max-w-[320px]",children:t.message}),t.action&&(0,i.Y)("button",{type:"button",onClick:()=>{t.action?.onClick(),p(!1),m.current=setTimeout(()=>n(t.id),200)},className:"flex-shrink-0 px-2 py-0.5 rounded bg-ink text-paper font-semibold hover:opacity-80 transition-opacity",children:t.action.label}),(0,i.Y)("button",{type:"button",onClick:()=>{p(!1),m.current=setTimeout(()=>n(t.id),200)},className:"text-ink/40 hover:text-ink transition-colors flex-shrink-0",title:"Dismiss",children:(0,i.Y)(o.A,{size:13})})]}),document.body)}function d(e){let{toasts:t,onDismiss:n}=e;return(0,i.Y)(i.FK,{children:t.map(e=>(0,i.Y)(c,{toast:e,onDismiss:n},e.id))})}},HO(e,t,n){n.d(t,{P:()=>p});var i=n("j"),r=n("H");let a=`
|
|
9
|
-
.code-editor-native-textarea {
|
|
10
|
-
-webkit-text-fill-color: transparent;
|
|
11
|
-
}
|
|
12
|
-
.code-editor-native-textarea::placeholder {
|
|
13
|
-
-webkit-text-fill-color: var(--theme-ink);
|
|
14
|
-
opacity: 0.45;
|
|
15
|
-
}
|
|
16
|
-
`;function l(){return(0,i.Y)("style",{dangerouslySetInnerHTML:{__html:a}})}function s(e,t){return e.substring(0,t).split("\n")}function o(e){let{value:t,onValueChange:n,highlight:a,padding:o=0,preClassName:c,textareaClassName:d,style:p,className:u,placeholder:m,readOnly:h,autoFocus:b}=e,f=(0,r.li)(null),x=(0,r.li)({stack:[],offset:-1}),[g,v]=(0,r.J0)(!0);(0,r.vJ)(()=>{let e=f.current;if(!e)return;let t={value:e.value,selectionStart:e.selectionStart,selectionEnd:e.selectionEnd,timestamp:Date.now()},{stack:n,offset:i}=x.current;n.length&&i>-1&&(x.current.stack=n.slice(0,i+1)),x.current.stack.push(t),x.current.offset=x.current.stack.length-1},[t]);let k=e=>{let t=f.current,i=x.current.stack[x.current.offset];if(i&&t&&(x.current.stack[x.current.offset]={...i,selectionStart:t.selectionStart,selectionEnd:t.selectionEnd}),x.current.stack.push({...e,timestamp:Date.now()}),x.current.offset=x.current.stack.length-1,x.current.stack.length>100){let e=x.current.stack.length-100;x.current.stack=x.current.stack.slice(e),x.current.offset=Math.max(x.current.offset-e,0)}n(e.value),t&&(t.value=e.value,t.selectionStart=e.selectionStart,t.selectionEnd=e.selectionEnd)},y={paddingTop:o,paddingRight:o,paddingBottom:o,paddingLeft:o},w=a(t),N={margin:0,border:0,background:"none",boxSizing:"inherit",display:"inherit",fontFamily:"inherit",fontSize:"inherit",fontStyle:"inherit",fontVariantLigatures:"inherit",fontWeight:"inherit",letterSpacing:"inherit",lineHeight:"inherit",tabSize:"inherit",textIndent:"inherit",textRendering:"inherit",textTransform:"inherit",whiteSpace:"pre-wrap",wordBreak:"keep-all",overflowWrap:"break-word"};return(0,i.FD)("div",{className:u,style:{position:"relative",textAlign:"left",boxSizing:"border-box",padding:0,overflow:"hidden",...p},children:[(0,i.Y)("pre",{className:c,"aria-hidden":"true",style:{...N,...y,position:"relative",pointerEvents:"none"},dangerouslySetInnerHTML:{__html:w+"<br />"}}),(0,i.Y)("textarea",{ref:f,className:`code-editor-native-textarea${d?` ${d}`:""}`,style:{...N,...y,position:"absolute",top:0,left:0,height:"100%",width:"100%",resize:"none",color:"inherit",overflow:"hidden",WebkitTextFillColor:"transparent"},value:t,onChange:e=>{let{value:t,selectionStart:i,selectionEnd:r}=e.target,{stack:a,offset:l}=x.current,o=Date.now();a.length&&l>-1&&(x.current.stack=a.slice(0,l+1));let c=x.current.stack[x.current.offset];if(c&&o-c.timestamp<3e3){let e=/[^a-z0-9]([a-z0-9]+)$/i,a=s(c.value,c.selectionStart).pop()?.match(e),l=s(t,i).pop()?.match(e);if(a?.[1]&&l?.[1]?.startsWith(a[1])){x.current.stack[x.current.offset]={value:t,selectionStart:i,selectionEnd:r,timestamp:o},n(t);return}}x.current.stack.push({value:t,selectionStart:i,selectionEnd:r,timestamp:o}),x.current.offset=x.current.stack.length-1,n(t)},onKeyDown:e=>{if("Escape"===e.key)return void e.currentTarget.blur();let{value:t,selectionStart:i,selectionEnd:r}=e.currentTarget,a=/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform),l=/Win/i.test(navigator.platform);if("Tab"===e.key&&g){if(e.preventDefault(),e.shiftKey){let e=s(t,i),n=e.length-1,a=s(t,r).length-1,l=t.split("\n").map((e,t)=>t>=n&&t<=a&&e.startsWith(" ")?e.substring(2):e).join("\n");if(l!==t){let a=e[n];k({value:l,selectionStart:a?.startsWith(" ")?i-2:i,selectionEnd:r-(t.length-l.length)})}}else if(i!==r){let e=s(t,i),n=e.length-1,a=s(t,r).length-1,l=e[n];k({value:t.split("\n").map((e,t)=>t>=n&&t<=a?" "+e:e).join("\n"),selectionStart:l&&/\S/.test(l)?i+2:i,selectionEnd:r+2*(a-n+1)})}else{let e=i+2;k({value:t.substring(0,i)+" "+t.substring(r),selectionStart:e,selectionEnd:e})}return}if("Backspace"===e.key&&i===r){if(t.substring(0,i).endsWith(" ")){e.preventDefault();let n=i-2;k({value:t.substring(0,i-2)+t.substring(r),selectionStart:n,selectionEnd:n})}return}if("Enter"===e.key&&i===r){let n=s(t,i).pop(),a=n?.match(/^\s+/);if(a?.[0]){e.preventDefault();let n="\n"+a[0],l=i+n.length;k({value:t.substring(0,i)+n+t.substring(r),selectionStart:l,selectionEnd:l})}return}if((a?e.metaKey&&"z"===e.key.toLowerCase():e.ctrlKey&&"z"===e.key.toLowerCase())&&!e.shiftKey&&!e.altKey){e.preventDefault();let{stack:t,offset:i}=x.current,r=t[i-1];r&&f.current&&(f.current.value=r.value,f.current.selectionStart=r.selectionStart,f.current.selectionEnd=r.selectionEnd,n(r.value),x.current.offset=Math.max(i-1,0));return}if((a?e.metaKey&&e.shiftKey&&"z"===e.key.toLowerCase():l?e.ctrlKey&&"y"===e.key.toLowerCase():e.ctrlKey&&e.shiftKey&&"z"===e.key.toLowerCase())&&!e.altKey){e.preventDefault();let{stack:t,offset:i}=x.current,r=t[i+1];r&&f.current&&(f.current.value=r.value,f.current.selectionStart=r.selectionStart,f.current.selectionEnd=r.selectionEnd,n(r.value),x.current.offset=Math.min(i+1,t.length-1));return}e.ctrlKey&&"m"===e.key.toLowerCase()&&(!a||e.shiftKey)&&(e.preventDefault(),v(e=>!e))},placeholder:m,readOnly:h,autoFocus:b,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",spellcheck:!1,"data-gramm":!1}),(0,i.Y)(l,{})]})}var c=n("qg"),d=n("Po");function p(e){let{value:t,onValueChange:n,language:r,wordWrap:a,rootClassName:l,gutterClassName:s,gutterStyle:p,gutterLineClassName:u,editorWrapperClassName:m,editorClassName:h,editorPadding:b=0,editorStyle:f}=e,x=a?"!whitespace-pre-wrap !break-words":"!whitespace-pre !break-normal";return(0,d.w)(),(0,i.FD)("div",{className:l,children:[(0,i.Y)("div",{className:s,style:p,children:t.split("\n").map((e,t)=>(0,i.Y)("div",{className:u,children:t+1},t+1))}),(0,i.Y)("div",{className:m,children:(0,i.Y)(o,{value:t,onValueChange:n,highlight:e=>(0,c.wY)(e,r),padding:b,textareaClassName:`focus:outline-none ${x}`,preClassName:x,style:f,className:h})})]})}},cx(e,t,n){n.d(t,{o:()=>f});var i=n("j"),r=n("Y"),a=n("g6"),l=n("dg"),s=n("SR"),o=n("sb"),c=n("OQ"),d=n("gj"),p=n("HD");let u={Angular:{path:"M16.712 17.711H7.288l-1.204 2.916L12 24l5.916-3.373-1.204-2.916ZM14.692 0l7.832 16.855.814-12.856L14.692 0ZM9.308 0 .662 3.999l.814 12.856L9.308 0Zm-.405 13.93h6.198L12 6.396 8.903 13.93Z",color:"#0F0F11"},Astro:{path:"M8.358 20.162c-1.186-1.07-1.532-3.316-1.038-4.944.856 1.026 2.043 1.352 3.272 1.535 1.897.283 3.76.177 5.522-.678.202-.098.388-.229.608-.36.166.473.209.95.151 1.437-.14 1.185-.738 2.1-1.688 2.794-.38.277-.782.525-1.175.787-1.205.804-1.531 1.747-1.078 3.119l.044.148a3.158 3.158 0 0 1-1.407-1.188 3.31 3.31 0 0 1-.544-1.815c-.004-.32-.004-.642-.048-.958-.106-.769-.472-1.113-1.161-1.133-.707-.02-1.267.411-1.415 1.09-.012.053-.028.104-.045.165h.002zm-5.961-4.445s3.24-1.575 6.49-1.575l2.451-7.565c.092-.366.36-.614.662-.614.302 0 .57.248.662.614l2.45 7.565c3.85 0 6.491 1.575 6.491 1.575L16.088.727C15.93.285 15.663 0 15.303 0H8.697c-.36 0-.615.285-.784.727l-5.516 14.99z",color:"#BC52EE"},C:{path:"M16.5921 9.1962s-.354-3.298-3.627-3.39c-3.2741-.09-4.9552 2.474-4.9552 6.14 0 3.6651 1.858 6.5972 5.0451 6.5972 3.184 0 3.5381-3.665 3.5381-3.665l6.1041.365s.36 3.31-2.196 5.836c-2.552 2.5241-5.6901 2.9371-7.8762 2.9201-2.19-.017-5.2261.034-8.1602-2.97-2.938-3.0101-3.436-5.9302-3.436-8.8002 0-2.8701.556-6.6702 4.047-9.5502C7.444.72 9.849 0 12.254 0c10.0422 0 10.7172 9.2602 10.7172 9.2602z",color:"#A8B9CC"},Cplusplus:{path:"M22.394 6c-.167-.29-.398-.543-.652-.69L12.926.22c-.509-.294-1.34-.294-1.848 0L2.26 5.31c-.508.293-.923 1.013-.923 1.6v10.18c0 .294.104.62.271.91.167.29.398.543.652.69l8.816 5.09c.508.293 1.34.293 1.848 0l8.816-5.09c.254-.147.485-.4.652-.69.167-.29.27-.616.27-.91V6.91c.003-.294-.1-.62-.268-.91zM12 19.11c-3.92 0-7.109-3.19-7.109-7.11 0-3.92 3.19-7.11 7.11-7.11a7.133 7.133 0 016.156 3.553l-3.076 1.78a3.567 3.567 0 00-3.08-1.78A3.56 3.56 0 008.444 12 3.56 3.56 0 0012 15.555a3.57 3.57 0 003.08-1.778l3.078 1.78A7.135 7.135 0 0112 19.11zm7.11-6.715h-.79v.79h-.79v-.79h-.79v-.79h.79v-.79h.79v.79h.79zm2.962 0h-.79v.79h-.79v-.79h-.79v-.79h.79v-.79h.79v.79h.79z",color:"#00599C"},Csharp:{path:"M14.2209.0875v5.9613l-3.7433.5012v3.5233l3.7433-.5012v3.5735l3.492-.4672V9.1047L24 8.2634l-.4631-3.4613-5.824.7794V.0875zM6.287 1.145v5.9618L0 7.9483l.4634 3.4613 5.8514-.7834 3.4644-.4637V1.145zm3.5198 9.7185l-3.492.4675v3.578l-6.183.8276.4633 3.4613 5.8239-.7796v5.4942h3.492v-5.962l3.6114-.4834V13.944l-3.7156.4973zm13.73 1.7405l-5.824.779-3.492.4673v9.0179h3.492v-5.9618L24 16.0652Z",color:"#99CC00"},Css:{path:"M0 0v20.16A3.84 3.84 0 0 0 3.84 24h16.32A3.84 3.84 0 0 0 24 20.16V3.84A3.84 3.84 0 0 0 20.16 0Zm14.256 13.08c1.56 0 2.28 1.08 2.304 2.64h-1.608c.024-.288-.048-.6-.144-.84-.096-.192-.288-.264-.552-.264-.456 0-.696.264-.696.84-.024.576.288.888.768 1.08.72.288 1.608.744 1.92 1.296q.432.648.432 1.656c0 1.608-.912 2.592-2.496 2.592-1.656 0-2.4-1.032-2.424-2.688h1.68c0 .792.264 1.176.792 1.176.264 0 .456-.072.552-.24.192-.312.24-1.176-.048-1.512-.312-.408-.912-.6-1.32-.816q-.828-.396-1.224-.936c-.24-.36-.36-.888-.36-1.536 0-1.44.936-2.472 2.424-2.448m5.4 0c1.584 0 2.304 1.08 2.328 2.64h-1.608c0-.288-.048-.6-.168-.84-.096-.192-.264-.264-.528-.264-.48 0-.72.264-.72.84s.288.888.792 1.08c.696.288 1.608.744 1.92 1.296.264.432.408.984.408 1.656.024 1.608-.888 2.592-2.472 2.592-1.68 0-2.424-1.056-2.448-2.688h1.68c0 .744.264 1.176.792 1.176.264 0 .456-.072.552-.24.216-.312.264-1.176-.048-1.512-.288-.408-.888-.6-1.32-.816-.552-.264-.96-.576-1.2-.936s-.36-.888-.36-1.536c-.024-1.44.912-2.472 2.4-2.448m-11.031.018c.711-.006 1.419.198 1.839.63.432.432.672 1.128.648 1.992H9.336c.024-.456-.096-.792-.432-.96-.312-.144-.768-.048-.888.24-.12.264-.192.576-.168.864v3.504c0 .744.264 1.128.768 1.128a.65.65 0 0 0 .552-.264c.168-.24.192-.552.168-.84h1.776c.096 1.632-.984 2.712-2.568 2.688-1.536 0-2.496-.864-2.472-2.472v-4.032c0-.816.24-1.44.696-1.848.432-.408 1.146-.624 1.857-.63",color:"#663399"},Dart:{path:"M4.105 4.105S9.158 1.58 11.684.316a3.079 3.079 0 0 1 1.481-.315c.766.047 1.677.788 1.677.788L24 9.948v9.789h-4.263V24H9.789l-9-9C.303 14.5 0 13.795 0 13.105c0-.319.18-.818.316-1.105l3.789-7.895zm.679.679v11.787c.002.543.021 1.024.498 1.508L10.204 23h8.533v-4.263L4.784 4.784zm12.055-.678c-.899-.896-1.809-1.78-2.74-2.643-.302-.267-.567-.468-1.07-.462-.37.014-.87.195-.87.195L6.341 4.105l10.498.001z",color:"#0175C2"},Docker:{path:"M13.983 11.078h2.119a.186.186 0 00.186-.185V9.006a.186.186 0 00-.186-.186h-2.119a.185.185 0 00-.185.185v1.888c0 .102.083.185.185.185m-2.954-5.43h2.118a.186.186 0 00.186-.186V3.574a.186.186 0 00-.186-.185h-2.118a.185.185 0 00-.185.185v1.888c0 .102.082.185.185.185m0 2.716h2.118a.187.187 0 00.186-.186V6.29a.186.186 0 00-.186-.185h-2.118a.185.185 0 00-.185.185v1.887c0 .102.082.185.185.186m-2.93 0h2.12a.186.186 0 00.184-.186V6.29a.185.185 0 00-.185-.185H8.1a.185.185 0 00-.185.185v1.887c0 .102.083.185.185.186m-2.964 0h2.119a.186.186 0 00.185-.186V6.29a.185.185 0 00-.185-.185H5.136a.186.186 0 00-.186.185v1.887c0 .102.084.185.186.186m5.893 2.715h2.118a.186.186 0 00.186-.185V9.006a.186.186 0 00-.186-.186h-2.118a.185.185 0 00-.185.185v1.888c0 .102.082.185.185.185m-2.93 0h2.12a.185.185 0 00.184-.185V9.006a.185.185 0 00-.184-.186h-2.12a.185.185 0 00-.184.185v1.888c0 .102.083.185.185.185m-2.964 0h2.119a.185.185 0 00.185-.185V9.006a.185.185 0 00-.184-.186h-2.12a.186.186 0 00-.186.186v1.887c0 .102.084.185.186.185m-2.92 0h2.12a.185.185 0 00.184-.185V9.006a.185.185 0 00-.184-.186h-2.12a.185.185 0 00-.184.185v1.888c0 .102.082.185.185.185M23.763 9.89c-.065-.051-.672-.51-1.954-.51-.338.001-.676.03-1.01.087-.248-1.7-1.653-2.53-1.716-2.566l-.344-.199-.226.327c-.284.438-.49.922-.612 1.43-.23.97-.09 1.882.403 2.661-.595.332-1.55.413-1.744.42H.751a.751.751 0 00-.75.748 11.376 11.376 0 00.692 4.062c.545 1.428 1.355 2.48 2.41 3.124 1.18.723 3.1 1.137 5.275 1.137.983.003 1.963-.086 2.93-.266a12.248 12.248 0 003.823-1.389c.98-.567 1.86-1.288 2.61-2.136 1.252-1.418 1.998-2.997 2.553-4.4h.221c1.372 0 2.215-.549 2.68-1.009.309-.293.55-.65.707-1.046l.098-.288Z",color:"#2496ED"},Elixir:{path:"M19.793 16.575c0 3.752-2.927 7.426-7.743 7.426-5.249 0-7.843-3.71-7.843-8.29 0-5.21 3.892-12.952 8-15.647a.397.397 0 0 1 .61.371 9.716 9.716 0 0 0 1.694 6.518c.522.795 1.092 1.478 1.763 2.352.94 1.227 1.637 1.906 2.644 3.842l.015.028a7.107 7.107 0 0 1 .86 3.4z",color:"#4B275F"},Gnubash:{path:"M21.038,4.9l-7.577-4.498C13.009,0.134,12.505,0,12,0c-0.505,0-1.009,0.134-1.462,0.403L2.961,4.9 C2.057,5.437,1.5,6.429,1.5,7.503v8.995c0,1.073,0.557,2.066,1.462,2.603l7.577,4.497C10.991,23.866,11.495,24,12,24 c0.505,0,1.009-0.134,1.461-0.402l7.577-4.497c0.904-0.537,1.462-1.529,1.462-2.603V7.503C22.5,6.429,21.943,5.437,21.038,4.9z M15.17,18.946l0.013,0.646c0.001,0.078-0.05,0.167-0.111,0.198l-0.383,0.22c-0.061,0.031-0.111-0.007-0.112-0.085L14.57,19.29 c-0.328,0.136-0.66,0.169-0.872,0.084c-0.04-0.016-0.057-0.075-0.041-0.142l0.139-0.584c0.011-0.046,0.036-0.092,0.069-0.121 c0.012-0.011,0.024-0.02,0.036-0.026c0.022-0.011,0.043-0.014,0.062-0.006c0.229,0.077,0.521,0.041,0.802-0.101 c0.357-0.181,0.596-0.545,0.592-0.907c-0.003-0.328-0.181-0.465-0.613-0.468c-0.55,0.001-1.064-0.107-1.072-0.917 c-0.007-0.667,0.34-1.361,0.889-1.8l-0.007-0.652c-0.001-0.08,0.048-0.168,0.111-0.2l0.37-0.236 c0.061-0.031,0.111,0.007,0.112,0.087l0.006,0.653c0.273-0.109,0.511-0.138,0.726-0.088c0.047,0.012,0.067,0.076,0.048,0.151 l-0.144,0.578c-0.011,0.044-0.036,0.088-0.065,0.116c-0.012,0.012-0.025,0.021-0.038,0.028c-0.019,0.01-0.038,0.013-0.057,0.009 c-0.098-0.022-0.332-0.073-0.699,0.113c-0.385,0.195-0.52,0.53-0.517,0.778c0.003,0.297,0.155,0.387,0.681,0.396 c0.7,0.012,1.003,0.318,1.01,1.023C16.105,17.747,15.736,18.491,15.17,18.946z M19.143,17.859c0,0.06-0.008,0.116-0.058,0.145 l-1.916,1.164c-0.05,0.029-0.09,0.004-0.09-0.056v-0.494c0-0.06,0.037-0.093,0.087-0.122l1.887-1.129 c0.05-0.029,0.09-0.004,0.09,0.056V17.859z M20.459,6.797l-7.168,4.427c-0.894,0.523-1.553,1.109-1.553,2.187v8.833 c0,0.645,0.26,1.063,0.66,1.184c-0.131,0.023-0.264,0.039-0.398,0.039c-0.42,0-0.833-0.114-1.197-0.33L3.226,18.64 c-0.741-0.44-1.201-1.261-1.201-2.142V7.503c0-0.881,0.46-1.702,1.201-2.142l7.577-4.498c0.363-0.216,0.777-0.33,1.197-0.33 c0.419,0,0.833,0.114,1.197,0.33l7.577,4.498c0.624,0.371,1.046,1.013,1.164,1.732C21.686,6.557,21.12,6.411,20.459,6.797z",color:"#4EAA25"},Go:{path:"M1.811 10.231c-.047 0-.058-.023-.035-.059l.246-.315c.023-.035.081-.058.128-.058h4.172c.046 0 .058.035.035.07l-.199.303c-.023.036-.082.07-.117.07zM.047 11.306c-.047 0-.059-.023-.035-.058l.245-.316c.023-.035.082-.058.129-.058h5.328c.047 0 .07.035.058.07l-.093.28c-.012.047-.058.07-.105.07zm2.828 1.075c-.047 0-.059-.035-.035-.07l.163-.292c.023-.035.07-.07.117-.07h2.337c.047 0 .07.035.07.082l-.023.28c0 .047-.047.082-.082.082zm12.129-2.36c-.736.187-1.239.327-1.963.514-.176.046-.187.058-.34-.117-.174-.199-.303-.327-.548-.444-.737-.362-1.45-.257-2.115.175-.795.514-1.204 1.274-1.192 2.22.011.935.654 1.706 1.577 1.835.795.105 1.46-.175 1.987-.77.105-.13.198-.27.315-.434H10.47c-.245 0-.304-.152-.222-.35.152-.362.432-.97.596-1.274a.315.315 0 01.292-.187h4.253c-.023.316-.023.631-.07.947a4.983 4.983 0 01-.958 2.29c-.841 1.11-1.94 1.8-3.33 1.986-1.145.152-2.209-.07-3.143-.77-.865-.655-1.356-1.52-1.484-2.595-.152-1.274.222-2.419.993-3.424.83-1.086 1.928-1.776 3.272-2.02 1.098-.2 2.15-.07 3.096.571.62.41 1.063.97 1.356 1.648.07.105.023.164-.117.2m3.868 6.461c-1.064-.024-2.034-.328-2.852-1.029a3.665 3.665 0 01-1.262-2.255c-.21-1.32.152-2.489.947-3.529.853-1.122 1.881-1.706 3.272-1.95 1.192-.21 2.314-.095 3.33.595.923.63 1.496 1.484 1.648 2.605.198 1.578-.257 2.863-1.344 3.962-.771.783-1.718 1.273-2.805 1.495-.315.06-.63.07-.934.106zm2.78-4.72c-.011-.153-.011-.27-.034-.387-.21-1.157-1.274-1.81-2.384-1.554-1.087.245-1.788.935-2.045 2.033-.21.912.234 1.835 1.075 2.21.643.28 1.285.244 1.905-.07.923-.48 1.425-1.228 1.484-2.233z",color:"#00ADD8"},Graphql:{path:"M12.002 0a2.138 2.138 0 1 0 0 4.277 2.138 2.138 0 1 0 0-4.277zm8.54 4.931a2.138 2.138 0 1 0 0 4.277 2.138 2.138 0 1 0 0-4.277zm0 9.862a2.138 2.138 0 1 0 0 4.277 2.138 2.138 0 1 0 0-4.277zm-8.54 4.931a2.138 2.138 0 1 0 0 4.276 2.138 2.138 0 1 0 0-4.276zm-8.542-4.93a2.138 2.138 0 1 0 0 4.276 2.138 2.138 0 1 0 0-4.277zm0-9.863a2.138 2.138 0 1 0 0 4.277 2.138 2.138 0 1 0 0-4.277zm8.542-3.378L2.953 6.777v10.448l9.049 5.224 9.047-5.224V6.777zm0 1.601 7.66 13.27H4.34zm-1.387.371L3.97 15.037V7.363zm2.774 0 6.646 3.838v7.674zM5.355 17.44h13.293l-6.646 3.836z",color:"#E10098"},Haskell:{path:"M0 3.535L5.647 12 0 20.465h4.235L9.883 12 4.235 3.535zm5.647 0L11.294 12l-5.647 8.465h4.235l3.53-5.29 3.53 5.29h4.234L9.883 3.535zm8.941 4.938l1.883 2.822H24V8.473zm2.824 4.232l1.882 2.822H24v-2.822z",color:"#5D4F85"},Html5:{path:"M1.5 0h21l-1.91 21.563L11.977 24l-8.564-2.438L1.5 0zm7.031 9.75l-.232-2.718 10.059.003.23-2.622L5.412 4.41l.698 8.01h9.126l-.326 3.426-2.91.804-2.955-.81-.188-2.11H6.248l.33 4.171L12 19.351l5.379-1.443.744-8.157H8.531z",color:"#E34F26"},Javascript:{path:"M0 0h24v24H0V0zm22.034 18.276c-.175-1.095-.888-2.015-3.003-2.873-.736-.345-1.554-.585-1.797-1.14-.091-.33-.105-.51-.046-.705.15-.646.915-.84 1.515-.66.39.12.75.42.976.9 1.034-.676 1.034-.676 1.755-1.125-.27-.42-.404-.601-.586-.78-.63-.705-1.469-1.065-2.834-1.034l-.705.089c-.676.165-1.32.525-1.71 1.005-1.14 1.291-.811 3.541.569 4.471 1.365 1.02 3.361 1.244 3.616 2.205.24 1.17-.87 1.545-1.966 1.41-.811-.18-1.26-.586-1.755-1.336l-1.83 1.051c.21.48.45.689.81 1.109 1.74 1.756 6.09 1.666 6.871-1.004.029-.09.24-.705.074-1.65l.046.067zm-8.983-7.245h-2.248c0 1.938-.009 3.864-.009 5.805 0 1.232.063 2.363-.138 2.711-.33.689-1.18.601-1.566.48-.396-.196-.597-.466-.83-.855-.063-.105-.11-.196-.127-.196l-1.825 1.125c.305.63.75 1.172 1.324 1.517.855.51 2.004.675 3.207.405.783-.226 1.458-.691 1.811-1.411.51-.93.402-2.07.397-3.346.012-2.054 0-4.109 0-6.179l.004-.056z",color:"#F7DF1E"},Julia:{path:"M11.138 17.569a5.569 5.569 0 1 1-11.138 0 5.569 5.569 0 1 1 11.138 0zm6.431-11.138a5.569 5.569 0 1 1-11.138 0 5.569 5.569 0 1 1 11.138 0zM24 17.569a5.569 5.569 0 1 1-11.138 0 5.569 5.569 0 1 1 11.138 0z",color:"#9558B2"},Kotlin:{path:"M24 24H0V0h24L12 12Z",color:"#7F52FF"},Kubernetes:{path:"M10.204 14.35l.007.01-.999 2.413a5.171 5.171 0 0 1-2.075-2.597l2.578-.437.004.005a.44.44 0 0 1 .484.606zm-.833-2.129a.44.44 0 0 0 .173-.756l.002-.011L7.585 9.7a5.143 5.143 0 0 0-.73 3.255l2.514-.725.002-.009zm1.145-1.98a.44.44 0 0 0 .699-.337l.01-.005.15-2.62a5.144 5.144 0 0 0-3.01 1.442l2.147 1.523.004-.002zm.76 2.75l.723.349.722-.347.18-.78-.5-.623h-.804l-.5.623.179.779zm1.5-3.095a.44.44 0 0 0 .7.336l.008.003 2.134-1.513a5.188 5.188 0 0 0-2.992-1.442l.148 2.615.002.001zm10.876 5.97l-5.773 7.181a1.6 1.6 0 0 1-1.248.594l-9.261.003a1.6 1.6 0 0 1-1.247-.596l-5.776-7.18a1.583 1.583 0 0 1-.307-1.34L2.1 5.573c.108-.47.425-.864.863-1.073L11.305.513a1.606 1.606 0 0 1 1.385 0l8.345 3.985c.438.209.755.604.863 1.073l2.062 8.955c.108.47-.005.963-.308 1.34zm-3.289-2.057c-.042-.01-.103-.026-.145-.034-.174-.033-.315-.025-.479-.038-.35-.037-.638-.067-.895-.148-.105-.04-.18-.165-.216-.216l-.201-.059a6.45 6.45 0 0 0-.105-2.332 6.465 6.465 0 0 0-.936-2.163c.052-.047.15-.133.177-.159.008-.09.001-.183.094-.282.197-.185.444-.338.743-.522.142-.084.273-.137.415-.242.032-.024.076-.062.11-.089.24-.191.295-.52.123-.736-.172-.216-.506-.236-.745-.045-.034.027-.08.062-.111.088-.134.116-.217.23-.33.35-.246.25-.45.458-.673.609-.097.056-.239.037-.303.033l-.19.135a6.545 6.545 0 0 0-4.146-2.003l-.012-.223c-.065-.062-.143-.115-.163-.25-.022-.268.015-.557.057-.905.023-.163.061-.298.068-.475.001-.04-.001-.099-.001-.142 0-.306-.224-.555-.5-.555-.275 0-.499.249-.499.555l.001.014c0 .041-.002.092 0 .128.006.177.044.312.067.475.042.348.078.637.056.906a.545.545 0 0 1-.162.258l-.012.211a6.424 6.424 0 0 0-4.166 2.003 8.373 8.373 0 0 1-.18-.128c-.09.012-.18.04-.297-.029-.223-.15-.427-.358-.673-.608-.113-.12-.195-.234-.329-.349-.03-.026-.077-.062-.111-.088a.594.594 0 0 0-.348-.132.481.481 0 0 0-.398.176c-.172.216-.117.546.123.737l.007.005.104.083c.142.105.272.159.414.242.299.185.546.338.743.522.076.082.09.226.1.288l.16.143a6.462 6.462 0 0 0-1.02 4.506l-.208.06c-.055.072-.133.184-.215.217-.257.081-.546.11-.895.147-.164.014-.305.006-.48.039-.037.007-.09.02-.133.03l-.004.002-.007.002c-.295.071-.484.342-.423.608.061.267.349.429.645.365l.007-.001.01-.003.129-.029c.17-.046.294-.113.448-.172.33-.118.604-.217.87-.256.112-.009.23.069.288.101l.217-.037a6.5 6.5 0 0 0 2.88 3.596l-.09.218c.033.084.069.199.044.282-.097.252-.263.517-.452.813-.091.136-.185.242-.268.399-.02.037-.045.095-.064.134-.128.275-.034.591.213.71.248.12.556-.007.69-.282v-.002c.02-.039.046-.09.062-.127.07-.162.094-.301.144-.458.132-.332.205-.68.387-.897.05-.06.13-.082.215-.105l.113-.205a6.453 6.453 0 0 0 4.609.012l.106.192c.086.028.18.042.256.155.136.232.229.507.342.84.05.156.074.295.145.457.016.037.043.09.062.129.133.276.442.402.69.282.247-.118.341-.435.213-.71-.02-.039-.045-.096-.065-.134-.083-.156-.177-.261-.268-.398-.19-.296-.346-.541-.443-.793-.04-.13.007-.21.038-.294-.018-.022-.059-.144-.083-.202a6.499 6.499 0 0 0 2.88-3.622c.064.01.176.03.213.038.075-.05.144-.114.28-.104.266.039.54.138.87.256.154.06.277.128.448.173.036.01.088.019.13.028l.009.003.007.001c.297.064.584-.098.645-.365.06-.266-.128-.537-.423-.608zM16.4 9.701l-1.95 1.746v.005a.44.44 0 0 0 .173.757l.003.01 2.526.728a5.199 5.199 0 0 0-.108-1.674A5.208 5.208 0 0 0 16.4 9.7zm-4.013 5.325a.437.437 0 0 0-.404-.232.44.44 0 0 0-.372.233h-.002l-1.268 2.292a5.164 5.164 0 0 0 3.326.003l-1.27-2.296h-.01zm1.888-1.293a.44.44 0 0 0-.27.036.44.44 0 0 0-.214.572l-.003.004 1.01 2.438a5.15 5.15 0 0 0 2.081-2.615l-2.6-.44-.004.005z",color:"#326CE5"},Lua:{path:"M.38 10.377l-.272-.037c-.048.344-.082.695-.101 1.041l.275.016c.018-.34.051-.682.098-1.02zM4.136 3.289l-.184-.205c-.258.232-.509.48-.746.734l.202.188c.231-.248.476-.49.728-.717zM5.769 2.059l-.146-.235c-.296.186-.586.385-.863.594l.166.219c.27-.203.554-.399.843-.578zM1.824 18.369c.185.297.384.586.593.863l.22-.164c-.205-.271-.399-.555-.58-.844l-.233.145zM1.127 16.402l-.255.104c.129.318.274.635.431.943l.005.01.245-.125-.005-.01c-.153-.301-.295-.611-.421-.922zM.298 9.309l.269.063c.076-.332.168-.664.272-.986l-.261-.087c-.108.332-.202.672-.28 1.01zM.274 12.42l-.275.01c.012.348.04.699.083 1.043l.273-.033c-.042-.336-.069-.68-.081-1.02zM.256 14.506c.073.34.162.682.264 1.014l.263-.08c-.1-.326-.187-.658-.258-.99l-.269.056zM11.573.275L11.563 0c-.348.012-.699.039-1.044.082l.034.273c.338-.041.68-.068 1.02-.08zM23.221 8.566c.1.326.186.66.256.992l.27-.059c-.072-.34-.16-.682-.262-1.014l-.264.081zM17.621 1.389c-.309-.164-.627-.314-.947-.449l-.107.252c.314.133.625.281.926.439l.128-.242zM15.693.572c-.332-.105-.67-.199-1.01-.277l-.063.268c.332.076.664.168.988.273l.085-.264zM6.674 1.545c.298-.15.606-.291.916-.418L7.486.873c-.317.127-.632.272-.937.428l-.015.008.125.244.015-.008zM23.727 11.588l.275-.01a11.797 11.797 0 0 0-.082-1.045l-.273.033c.041.338.068.682.08 1.022zM13.654.105c-.346-.047-.696-.08-1.043-.098l-.014.273c.339.018.683.051 1.019.098l.038-.273zM9.544.527l-.058-.27c-.34.072-.681.16-1.014.264l.081.262c.325-.099.659-.185.991-.256zM1.921 5.469l.231.15c.185-.285.384-.566.592-.834l-.217-.17c-.213.276-.417.563-.606.854zM.943 7.318l.253.107c.132-.313.28-.625.439-.924l-.243-.128c-.163.307-.314.625-.449.945zM18.223 21.943l.145.234c.295-.186.586-.385.863-.594l-.164-.219c-.272.204-.557.4-.844.579zM21.248 19.219l.217.17c.215-.273.418-.561.607-.854l-.23-.148c-.186.285-.385.564-.594.832zM19.855 20.715l.184.203c.258-.23.51-.479.746-.732l-.201-.188c-.23.248-.477.488-.729.717zM22.359 17.504l.244.129c.162-.307.314-.625.449-.945l-.254-.107a11.27 11.27 0 0 1-.439.923zM23.617 13.629l.273.039c.049-.346.082-.695.102-1.043l-.275-.014c-.018.338-.051.682-.1 1.018zM23.156 15.621l.264.086c.107-.332.201-.67.279-1.01l-.268-.063c-.077.333-.169.665-.275.987zM22.453 6.672c.154.303.297.617.424.932l.256-.104c-.131-.322-.277-.643-.436-.953l-.244.125zM8.296 23.418c.331.107.67.201 1.009.279l.062-.268c-.331-.076-.663-.168-.986-.273l-.085.262zM10.335 23.889c.345.049.696.082 1.043.102l.014-.275c-.339-.018-.682-.051-1.019-.098l-.038.271zM17.326 22.449c-.303.154-.613.297-.926.424l.104.256c.318-.131.639-.275.947-.434l.004-.002-.123-.246-.006.002zM4.613 21.467c.274.213.562.418.854.605l.149-.23c-.285-.184-.565-.385-.833-.592l-.17.217zM12.417 23.725l.009.275c.348-.014.699-.041 1.045-.084l-.035-.271c-.336.041-.68.068-1.019.08zM6.37 22.604c.307.162.625.314.946.449l.107-.254c-.313-.133-.624-.279-.924-.439l-.129.244zM3.083 20.041c.233.258.48.51.734.746l.188-.201c-.249-.23-.49-.477-.717-.729l-.205.184zM14.445 23.475l.059.27c.34-.074.68-.162 1.014-.266l-.082-.262c-.325.099-.659.185-.991.258zM21.18.129A2.689 2.689 0 1 0 21.18 5.507 2.689 2.689 0 1 0 21.18.129zM15.324 15.447c0 .471.314.66.852.66.67 0 1.297-.396 1.297-1.016v-.645c-.23.107-.379.141-1.107.24-.735.109-1.042.306-1.042.761zM12 2.818c-5.07 0-9.18 4.109-9.18 9.18 0 5.068 4.11 9.18 9.18 9.18 5.07 0 9.18-4.111 9.18-9.18 0-5.07-4.11-9.18-9.18-9.18zm-2.487 13.77H5.771v-6.023h.769v5.346h2.974v.677zm4.13 0h-.619v-.67c-.405.57-.811.793-1.446.793-.843 0-1.38-.463-1.38-1.182v-3.271h.686v3c0 .52.347.85.893.85.719 0 1.181-.578 1.181-1.461v-2.389h.686v4.33zm-.53-8.393c0-1.484 1.205-2.689 2.689-2.689s2.688 1.205 2.688 2.689-1.203 2.688-2.688 2.688-2.689-1.203-2.689-2.688zm5.567 7.856v.52c-.223.059-.33.074-.471.074-.34 0-.637-.238-.711-.57-.381.406-.918.637-1.471.637-.877 0-1.422-.463-1.422-1.248 0-.527.256-.916.76-1.123.266-.107.414-.141 1.389-.264.545-.066.719-.191.719-.48v-.182c0-.412-.348-.645-.967-.645-.645 0-.957.24-1.016.77h-.693c.041-1 .686-1.404 1.734-1.404 1.066 0 1.627.412 1.627 1.182v2.412c0 .215.133.338.373.338.041-.002.074-.002.149-.017z",color:"#000080"},Markdown:{path:"M22.27 19.385H1.73A1.73 1.73 0 010 17.655V6.345a1.73 1.73 0 011.73-1.73h20.54A1.73 1.73 0 0124 6.345v11.308a1.73 1.73 0 01-1.73 1.731zM5.769 15.923v-4.5l2.308 2.885 2.307-2.885v4.5h2.308V8.078h-2.308l-2.307 2.885-2.308-2.885H3.46v7.847zM21.232 12h-2.309V8.077h-2.307V12h-2.308l3.461 4.039z",color:"#6D80A6"},Mongodb:{path:"M17.193 9.555c-1.264-5.58-4.252-7.414-4.573-8.115-.28-.394-.53-.954-.735-1.44-.036.495-.055.685-.523 1.184-.723.566-4.438 3.682-4.74 10.02-.282 5.912 4.27 9.435 4.888 9.884l.07.05A73.49 73.49 0 0111.91 24h.481c.114-1.032.284-2.056.51-3.07.417-.296.604-.463.85-.693a11.342 11.342 0 003.639-8.464c.01-.814-.103-1.662-.197-2.218zm-5.336 8.195s0-8.291.275-8.29c.213 0 .49 10.695.49 10.695-.381-.045-.765-1.76-.765-2.405z",color:"#47A248"},Mysql:{path:"M16.405 5.501c-.115 0-.193.014-.274.033v.013h.014c.054.104.146.18.214.273.054.107.1.214.154.32l.014-.015c.094-.066.14-.172.14-.333-.04-.047-.046-.094-.08-.14-.04-.067-.126-.1-.18-.153zM5.77 18.695h-.927a50.854 50.854 0 00-.27-4.41h-.008l-1.41 4.41H2.45l-1.4-4.41h-.01a72.892 72.892 0 00-.195 4.41H0c.055-1.966.192-3.81.41-5.53h1.15l1.335 4.064h.008l1.347-4.064h1.095c.242 2.015.384 3.86.428 5.53zm4.017-4.08c-.378 2.045-.876 3.533-1.492 4.46-.482.716-1.01 1.073-1.583 1.073-.153 0-.34-.046-.566-.138v-.494c.11.017.24.026.386.026.268 0 .483-.075.647-.222.197-.18.295-.382.295-.605 0-.155-.077-.47-.23-.944L6.23 14.615h.91l.727 2.36c.164.536.233.91.205 1.123.4-1.064.678-2.227.835-3.483zm12.325 4.08h-2.63v-5.53h.885v4.85h1.745zm-3.32.135l-1.016-.5c.09-.076.177-.158.255-.25.433-.506.648-1.258.648-2.253 0-1.83-.718-2.746-2.155-2.746-.704 0-1.254.232-1.65.697-.43.508-.646 1.256-.646 2.245 0 .972.19 1.686.574 2.14.35.41.877.615 1.583.615.264 0 .506-.033.725-.098l1.325.772.36-.622zM15.5 17.588c-.225-.36-.337-.94-.337-1.736 0-1.393.424-2.09 1.27-2.09.443 0 .77.167.977.5.224.362.336.936.336 1.723 0 1.404-.424 2.108-1.27 2.108-.445 0-.77-.167-.978-.5zm-1.658-.425c0 .47-.172.856-.516 1.156-.344.3-.803.45-1.384.45-.543 0-1.064-.172-1.573-.515l.237-.476c.438.22.833.328 1.19.328.332 0 .593-.073.783-.22a.754.754 0 00.3-.615c0-.33-.23-.61-.648-.845-.388-.213-1.163-.657-1.163-.657-.422-.307-.632-.636-.632-1.177 0-.45.157-.81.47-1.085.315-.278.72-.415 1.22-.415.512 0 .98.136 1.4.41l-.213.476a2.726 2.726 0 00-1.064-.23c-.283 0-.502.068-.654.206a.685.685 0 00-.248.524c0 .328.234.61.666.85.393.215 1.187.67 1.187.67.433.305.648.63.648 1.168zm9.382-5.852c-.535-.014-.95.04-1.297.188-.1.04-.26.04-.274.167.055.053.063.14.11.214.08.134.218.313.346.407.14.11.28.216.427.31.26.16.555.255.81.416.145.094.293.213.44.313.073.05.12.14.214.172v-.02c-.046-.06-.06-.147-.105-.214-.067-.067-.134-.127-.2-.193a3.223 3.223 0 00-.695-.675c-.214-.146-.682-.35-.77-.595l-.013-.014c.146-.013.32-.066.46-.106.227-.06.435-.047.67-.106.106-.027.213-.06.32-.094v-.06c-.12-.12-.21-.283-.334-.395a8.867 8.867 0 00-1.104-.823c-.21-.134-.476-.22-.697-.334-.08-.04-.214-.06-.26-.127-.12-.146-.19-.34-.275-.514a17.69 17.69 0 01-.547-1.163c-.12-.262-.193-.523-.34-.763-.69-1.137-1.437-1.826-2.586-2.5-.247-.14-.543-.2-.856-.274-.167-.008-.334-.02-.5-.027-.11-.047-.216-.174-.31-.235-.38-.24-1.364-.76-1.644-.072-.18.434.267.862.422 1.082.115.153.26.328.34.5.047.116.06.235.107.356.106.294.207.622.347.897.073.14.153.287.247.413.054.073.146.107.167.227-.094.136-.1.334-.154.5-.24.757-.146 1.693.194 2.25.107.166.362.534.703.393.3-.12.234-.5.32-.835.02-.08.007-.133.048-.187v.015c.094.188.188.367.274.555.206.328.566.668.867.895.16.12.287.328.487.402v-.02h-.015c-.043-.058-.1-.086-.154-.133a3.445 3.445 0 01-.35-.4 8.76 8.76 0 01-.747-1.218c-.11-.21-.202-.436-.29-.643-.04-.08-.04-.2-.107-.24-.1.146-.247.273-.32.453-.127.288-.14.642-.188 1.01-.027.007-.014 0-.027.014-.214-.052-.287-.274-.367-.46-.2-.475-.233-1.238-.06-1.785.047-.14.247-.582.167-.716-.042-.127-.174-.2-.247-.303a2.478 2.478 0 01-.24-.427c-.16-.374-.24-.788-.414-1.162-.08-.173-.22-.354-.334-.513-.127-.18-.267-.307-.368-.52-.033-.073-.08-.194-.027-.274.014-.054.042-.075.094-.09.088-.072.335.022.422.062.247.1.455.194.662.334.094.066.195.193.315.226h.14c.214.047.455.014.655.073.355.114.675.28.962.46a5.953 5.953 0 012.085 2.286c.08.154.115.295.188.455.14.33.313.663.455.982.14.315.275.636.476.897.1.14.502.213.682.286.133.06.34.115.46.188.23.14.454.3.67.454.11.076.443.243.463.378z",color:"#4479A1"},Nginx:{path:"M12 0L1.605 6v12L12 24l10.395-6V6L12 0zm6 16.59c0 .705-.646 1.29-1.529 1.29-.631 0-1.351-.255-1.801-.81l-6-7.141v6.66c0 .721-.57 1.29-1.274 1.29H7.32c-.721 0-1.29-.6-1.29-1.29V7.41c0-.705.63-1.29 1.5-1.29.646 0 1.38.255 1.83.81l5.97 7.141V7.41c0-.721.6-1.29 1.29-1.29h.075c.72 0 1.29.6 1.29 1.29v9.18H18z",color:"#009639"},Npm:{path:"M1.763 0C.786 0 0 .786 0 1.763v20.474C0 23.214.786 24 1.763 24h20.474c.977 0 1.763-.786 1.763-1.763V1.763C24 .786 23.214 0 22.237 0zM5.13 5.323l13.837.019-.009 13.836h-3.464l.01-10.382h-3.456L12.04 19.17H5.113z",color:"#CB3837"},Openjdk:{path:"M11.915 0 11.7.215C9.515 2.4 7.47 6.39 6.046 10.483c-1.064 1.024-3.633 2.81-3.711 3.551-.093.87 1.746 2.611 1.55 3.235-.198.625-1.304 1.408-1.014 1.939.1.188.823.011 1.277-.491a13.389 13.389 0 0 0-.017 2.14c.076.906.27 1.668.643 2.232.372.563.956.911 1.667.911.397 0 .727-.114 1.024-.264.298-.149.571-.33.91-.5.68-.34 1.634-.666 3.53-.604 1.903.062 2.872.39 3.559.704.687.314 1.15.664 1.925.664.767 0 1.395-.336 1.807-.9.412-.563.631-1.33.72-2.24.06-.623.055-1.32 0-2.066.454.45 1.117.604 1.213.424.29-.53-.816-1.314-1.013-1.937-.198-.624 1.642-2.366 1.549-3.236-.08-.748-2.707-2.568-3.748-3.586C16.428 6.374 14.308 2.394 12.13.215zm.175 6.038a2.95 2.95 0 0 1 2.943 2.942 2.95 2.95 0 0 1-2.943 2.943A2.95 2.95 0 0 1 9.148 8.98a2.95 2.95 0 0 1 2.942-2.942zM8.685 7.983a3.515 3.515 0 0 0-.145.997c0 1.951 1.6 3.55 3.55 3.55 1.95 0 3.55-1.598 3.55-3.55 0-.329-.046-.648-.132-.951.334.095.64.208.915.336a42.699 42.699 0 0 1 2.042 5.829c.678 2.545 1.01 4.92.846 6.607-.082.844-.29 1.51-.606 1.94-.315.431-.713.651-1.315.651-.593 0-.932-.27-1.673-.61-.741-.338-1.825-.694-3.792-.758-1.974-.064-3.073.293-3.821.669-.375.188-.659.373-.911.5s-.466.2-.752.2c-.53 0-.876-.209-1.16-.64-.285-.43-.474-1.101-.545-1.948-.141-1.693.176-4.069.823-6.614a43.155 43.155 0 0 1 1.934-5.783c.348-.167.749-.31 1.192-.425zm-3.382 4.362a.216.216 0 0 1 .13.031c-.166.56-.323 1.116-.463 1.665a33.849 33.849 0 0 0-.547 2.555 3.9 3.9 0 0 0-.2-.39c-.58-1.012-.914-1.642-1.16-2.08.315-.24 1.679-1.755 2.24-1.781zm13.394.01c.562.027 1.926 1.543 2.24 1.783-.246.438-.58 1.068-1.16 2.08a4.428 4.428 0 0 0-.163.309 32.354 32.354 0 0 0-.562-2.49 40.579 40.579 0 0 0-.482-1.652.216.216 0 0 1 .127-.03z",color:"#000000"},Perl:{path:"M12 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0m.157 1.103a10.91 10.91 0 0 1 9.214 5.404c-1.962.152-3.156 1.698-5.132 3.553-2.81 2.637-4.562.582-5.288-.898-.447-1.004-.847-2.117-1.544-2.769A.4.4 0 0 1 9.3 6.02l.08-.37a.083.083 0 0 0-.074-.1c-.33-.022-.601.093-.84.368a2.5 2.5 0 0 0-.375-.064c-.863-.093-1.036.345-1.873.345H5.81c-.758 0-1.391.361-1.7.892-.248.424-.257.884.15.93-.126.445.292.62 1.224.192 0 0 .733.421 1.749.421.549 0 .712.087.914.967.486 2.138 2.404 5.655 6.282 5.655l.118.166c.659.934.86 2.113.48 3.184-.307.867-.697 1.531-.697 1.531q.01.178.01.349c0 .81-.175 1.553-.387 2.23a10.91 10.91 0 0 1-11.989-6.342A10.91 10.91 0 0 1 7.608 2.01a10.9 10.9 0 0 1 4.55-.907M7.524 6.47c.288 0 .575.231.477.272a.4.4 0 0 1-.1.02.38.38 0 0 1-.375.327.384.384 0 0 1-.378-.326.4.4 0 0 1-.101-.02c-.098-.042.19-.273.477-.273m10.193 10.49q.05 0 .101.007.326.054.694.096.135.01.269.026a13.4 13.4 0 0 0 2.846-.007 10.9 10.9 0 0 1-2.007 2.705c-.11-.23-.547-1.19-.573-2.196q-.156-.01-.313-.026-.13-.014-.256-.022a18 18 0 0 1-.735-.102h-.003c-.032 0-.06.01-.074.035l-.003.012q-.081.265-.182.544c.428 1.084.652 2.078.652 2.078.14.22.258.432.363.64a11 11 0 0 1-2.168 1.264 11 11 0 0 1-1.205.426 13.3 13.3 0 0 1 1.055-2.531s.678-1.445 1.027-2.564v-.004a.55.55 0 0 1 .512-.38",color:"#0073A1"},Php:{path:"M7.01 10.207h-.944l-.515 2.648h.838c.556 0 .97-.105 1.242-.314.272-.21.455-.559.55-1.049.092-.47.05-.802-.124-.995-.175-.193-.523-.29-1.047-.29zM12 5.688C5.373 5.688 0 8.514 0 12s5.373 6.313 12 6.313S24 15.486 24 12c0-3.486-5.373-6.312-12-6.312zm-3.26 7.451c-.261.25-.575.438-.917.551-.336.108-.765.164-1.285.164H5.357l-.327 1.681H3.652l1.23-6.326h2.65c.797 0 1.378.209 1.744.628.366.418.476 1.002.33 1.752a2.836 2.836 0 0 1-.305.847c-.143.255-.33.49-.561.703zm4.024.715l.543-2.799c.063-.318.039-.536-.068-.651-.107-.116-.336-.174-.687-.174H11.46l-.704 3.625H9.388l1.23-6.327h1.367l-.327 1.682h1.218c.767 0 1.295.134 1.586.401s.378.7.263 1.299l-.572 2.944h-1.389zm7.597-2.265a2.782 2.782 0 0 1-.305.847c-.143.255-.33.49-.561.703a2.44 2.44 0 0 1-.917.551c-.336.108-.765.164-1.286.164h-1.18l-.327 1.682h-1.378l1.23-6.326h2.649c.797 0 1.378.209 1.744.628.366.417.477 1.001.331 1.751zM17.766 10.207h-.943l-.516 2.648h.838c.557 0 .971-.105 1.242-.314.272-.21.455-.559.551-1.049.092-.47.049-.802-.125-.995s-.524-.29-1.047-.29z",color:"#777BB4"},Postgresql:{path:"M23.5594 14.7228a.5269.5269 0 0 0-.0563-.1191c-.139-.2632-.4768-.3418-1.0074-.2321-1.6533.3411-2.2935.1312-2.5256-.0191 1.342-2.0482 2.445-4.522 3.0411-6.8297.2714-1.0507.7982-3.5237.1222-4.7316a1.5641 1.5641 0 0 0-.1509-.235C21.6931.9086 19.8007.0248 17.5099.0005c-1.4947-.0158-2.7705.3461-3.1161.4794a9.449 9.449 0 0 0-.5159-.0816 8.044 8.044 0 0 0-1.3114-.1278c-1.1822-.0184-2.2038.2642-3.0498.8406-.8573-.3211-4.7888-1.645-7.2219.0788C.9359 2.1526.3086 3.8733.4302 6.3043c.0409.818.5069 3.334 1.2423 5.7436.4598 1.5065.9387 2.7019 1.4334 3.582.553.9942 1.1259 1.5933 1.7143 1.7895.4474.1491 1.1327.1441 1.8581-.7279.8012-.9635 1.5903-1.8258 1.9446-2.2069.4351.2355.9064.3625 1.39.3772a.0569.0569 0 0 0 .0004.0041 11.0312 11.0312 0 0 0-.2472.3054c-.3389.4302-.4094.5197-1.5002.7443-.3102.064-1.1344.2339-1.1464.8115-.0025.1224.0329.2309.0919.3268.2269.4231.9216.6097 1.015.6331 1.3345.3335 2.5044.092 3.3714-.6787-.017 2.231.0775 4.4174.3454 5.0874.2212.5529.7618 1.9045 2.4692 1.9043.2505 0 .5263-.0291.8296-.0941 1.7819-.3821 2.5557-1.1696 2.855-2.9059.1503-.8707.4016-2.8753.5388-4.1012.0169-.0703.0357-.1207.057-.1362.0007-.0005.0697-.0471.4272.0307a.3673.3673 0 0 0 .0443.0068l.2539.0223.0149.001c.8468.0384 1.9114-.1426 2.5312-.4308.6438-.2988 1.8057-1.0323 1.5951-1.6698zM2.371 11.8765c-.7435-2.4358-1.1779-4.8851-1.2123-5.5719-.1086-2.1714.4171-3.6829 1.5623-4.4927 1.8367-1.2986 4.8398-.5408 6.108-.13-.0032.0032-.0066.0061-.0098.0094-2.0238 2.044-1.9758 5.536-1.9708 5.7495-.0002.0823.0066.1989.0162.3593.0348.5873.0996 1.6804-.0735 2.9184-.1609 1.1504.1937 2.2764.9728 3.0892.0806.0841.1648.1631.2518.2374-.3468.3714-1.1004 1.1926-1.9025 2.1576-.5677.6825-.9597.5517-1.0886.5087-.3919-.1307-.813-.5871-1.2381-1.3223-.4796-.839-.9635-2.0317-1.4155-3.5126zm6.0072 5.0871c-.1711-.0428-.3271-.1132-.4322-.1772.0889-.0394.2374-.0902.4833-.1409 1.2833-.2641 1.4815-.4506 1.9143-1.0002.0992-.126.2116-.2687.3673-.4426a.3549.3549 0 0 0 .0737-.1298c.1708-.1513.2724-.1099.4369-.0417.156.0646.3078.26.3695.4752.0291.1016.0619.2945-.0452.4444-.9043 1.2658-2.2216 1.2494-3.1676 1.0128zm2.094-3.988-.0525.141c-.133.3566-.2567.6881-.3334 1.003-.6674-.0021-1.3168-.2872-1.8105-.8024-.6279-.6551-.9131-1.5664-.7825-2.5004.1828-1.3079.1153-2.4468.079-3.0586-.005-.0857-.0095-.1607-.0122-.2199.2957-.2621 1.6659-.9962 2.6429-.7724.4459.1022.7176.4057.8305.928.5846 2.7038.0774 3.8307-.3302 4.7363-.084.1866-.1633.3629-.2311.5454zm7.3637 4.5725c-.0169.1768-.0358.376-.0618.5959l-.146.4383a.3547.3547 0 0 0-.0182.1077c-.0059.4747-.054.6489-.115.8693-.0634.2292-.1353.4891-.1794 1.0575-.11 1.4143-.8782 2.2267-2.4172 2.5565-1.5155.3251-1.7843-.4968-2.0212-1.2217a6.5824 6.5824 0 0 0-.0769-.2266c-.2154-.5858-.1911-1.4119-.1574-2.5551.0165-.5612-.0249-1.9013-.3302-2.6462.0044-.2932.0106-.5909.019-.8918a.3529.3529 0 0 0-.0153-.1126 1.4927 1.4927 0 0 0-.0439-.208c-.1226-.4283-.4213-.7866-.7797-.9351-.1424-.059-.4038-.1672-.7178-.0869.067-.276.1831-.5875.309-.9249l.0529-.142c.0595-.16.134-.3257.213-.5012.4265-.9476 1.0106-2.2453.3766-5.1772-.2374-1.0981-1.0304-1.6343-2.2324-1.5098-.7207.0746-1.3799.3654-1.7088.5321a5.6716 5.6716 0 0 0-.1958.1041c.0918-1.1064.4386-3.1741 1.7357-4.4823a4.0306 4.0306 0 0 1 .3033-.276.3532.3532 0 0 0 .1447-.0644c.7524-.5706 1.6945-.8506 2.802-.8325.4091.0067.8017.0339 1.1742.081 1.939.3544 3.2439 1.4468 4.0359 2.3827.8143.9623 1.2552 1.9315 1.4312 2.4543-1.3232-.1346-2.2234.1268-2.6797.779-.9926 1.4189.543 4.1729 1.2811 5.4964.1353.2426.2522.4522.2889.5413.2403.5825.5515.9713.7787 1.2552.0696.087.1372.1714.1885.245-.4008.1155-1.1208.3825-1.0552 1.717-.0123.1563-.0423.4469-.0834.8148-.0461.2077-.0702.4603-.0994.7662zm.8905-1.6211c-.0405-.8316.2691-.9185.5967-1.0105a2.8566 2.8566 0 0 0 .135-.0406 1.202 1.202 0 0 0 .1342.103c.5703.3765 1.5823.4213 3.0068.1344-.2016.1769-.5189.3994-.9533.6011-.4098.1903-1.0957.333-1.7473.3636-.7197.0336-1.0859-.0807-1.1721-.151zm.5695-9.2712c-.0059.3508-.0542.6692-.1054 1.0017-.055.3576-.112.7274-.1264 1.1762-.0142.4368.0404.8909.0932 1.3301.1066.887.216 1.8003-.2075 2.7014a3.5272 3.5272 0 0 1-.1876-.3856c-.0527-.1276-.1669-.3326-.3251-.6162-.6156-1.1041-2.0574-3.6896-1.3193-4.7446.3795-.5427 1.3408-.5661 2.1781-.463zm.2284 7.0137a12.3762 12.3762 0 0 0-.0853-.1074l-.0355-.0444c.7262-1.1995.5842-2.3862.4578-3.4385-.0519-.4318-.1009-.8396-.0885-1.2226.0129-.4061.0666-.7543.1185-1.0911.0639-.415.1288-.8443.1109-1.3505.0134-.0531.0188-.1158.0118-.1902-.0457-.4855-.5999-1.938-1.7294-3.253-.6076-.7073-1.4896-1.4972-2.6889-2.0395.5251-.1066 1.2328-.2035 2.0244-.1859 2.0515.0456 3.6746.8135 4.8242 2.2824a.908.908 0 0 1 .0667.1002c.7231 1.3556-.2762 6.2751-2.9867 10.5405zm-8.8166-6.1162c-.025.1794-.3089.4225-.6211.4225a.5821.5821 0 0 1-.0809-.0056c-.1873-.026-.3765-.144-.5059-.3156-.0458-.0605-.1203-.178-.1055-.2844.0055-.0401.0261-.0985.0925-.1488.1182-.0894.3518-.1226.6096-.0867.3163.0441.6426.1938.6113.4186zm7.9305-.4114c.0111.0792-.049.201-.1531.3102-.0683.0717-.212.1961-.4079.2232a.5456.5456 0 0 1-.075.0052c-.2935 0-.5414-.2344-.5607-.3717-.024-.1765.2641-.3106.5611-.352.297-.0414.6111.0088.6356.1851z",color:"#4169E1"},Python:{path:"M14.25.18l.9.2.73.26.59.3.45.32.34.34.25.34.16.33.1.3.04.26.02.2-.01.13V8.5l-.05.63-.13.55-.21.46-.26.38-.3.31-.33.25-.35.19-.35.14-.33.1-.3.07-.26.04-.21.02H8.77l-.69.05-.59.14-.5.22-.41.27-.33.32-.27.35-.2.36-.15.37-.1.35-.07.32-.04.27-.02.21v3.06H3.17l-.21-.03-.28-.07-.32-.12-.35-.18-.36-.26-.36-.36-.35-.46-.32-.59-.28-.73-.21-.88-.14-1.05-.05-1.23.06-1.22.16-1.04.24-.87.32-.71.36-.57.4-.44.42-.33.42-.24.4-.16.36-.1.32-.05.24-.01h.16l.06.01h8.16v-.83H6.18l-.01-2.75-.02-.37.05-.34.11-.31.17-.28.25-.26.31-.23.38-.2.44-.18.51-.15.58-.12.64-.1.71-.06.77-.04.84-.02 1.27.05zm-6.3 1.98l-.23.33-.08.41.08.41.23.34.33.22.41.09.41-.09.33-.22.23-.34.08-.41-.08-.41-.23-.33-.33-.22-.41-.09-.41.09zm13.09 3.95l.28.06.32.12.35.18.36.27.36.35.35.47.32.59.28.73.21.88.14 1.04.05 1.23-.06 1.23-.16 1.04-.24.86-.32.71-.36.57-.4.45-.42.33-.42.24-.4.16-.36.09-.32.05-.24.02-.16-.01h-8.22v.82h5.84l.01 2.76.02.36-.05.34-.11.31-.17.29-.25.25-.31.24-.38.2-.44.17-.51.15-.58.13-.64.09-.71.07-.77.04-.84.01-1.27-.04-1.07-.14-.9-.2-.73-.25-.59-.3-.45-.33-.34-.34-.25-.34-.16-.33-.1-.3-.04-.25-.02-.2.01-.13v-5.34l.05-.64.13-.54.21-.46.26-.38.3-.32.33-.24.35-.2.35-.14.33-.1.3-.06.26-.04.21-.02.13-.01h5.84l.69-.05.59-.14.5-.21.41-.28.33-.32.27-.35.2-.36.15-.36.1-.35.07-.32.04-.28.02-.21V6.07h2.09l.14.01zm-6.47 14.25l-.23.33-.08.41.08.41.23.33.33.23.41.08.41-.08.33-.23.23-.33.08-.41-.08-.41-.23-.33-.33-.23-.41-.08-.41.08z",color:"#3776AB"},R:{path:"M12 2.746c-6.627 0-12 3.599-12 8.037 0 3.897 4.144 7.144 9.64 7.88V16.26c-2.924-.915-4.925-2.755-4.925-4.877 0-3.035 4.084-5.494 9.12-5.494 5.038 0 8.757 1.683 8.757 5.494 0 1.976-.999 3.379-2.662 4.272.09.066.174.128.258.216.169.149.25.363.372.544 2.128-1.45 3.44-3.437 3.44-5.631 0-4.44-5.373-8.038-12-8.038zm-2.111 4.99v13.516l4.093-.002-.002-5.291h1.1c.225 0 .321.066.549.25.272.22.715.982.715.982l2.164 4.063 4.627-.002-2.864-4.826s-.086-.193-.265-.383a2.22 2.22 0 00-.582-.416c-.422-.214-1.149-.434-1.149-.434s3.578-.264 3.578-3.826c0-3.562-3.744-3.63-3.744-3.63zm4.127 2.93l2.478.002s1.149-.062 1.149 1.127c0 1.165-1.149 1.17-1.149 1.17h-2.478zm1.754 6.119c-.494.049-1.012.079-1.54.088v1.807a16.622 16.622 0 002.37-.473l-.471-.891s-.108-.183-.248-.394c-.039-.054-.08-.098-.111-.137z",color:"#276DC3"},React:{path:"M14.23 12.004a2.236 2.236 0 0 1-2.235 2.236 2.236 2.236 0 0 1-2.236-2.236 2.236 2.236 0 0 1 2.235-2.236 2.236 2.236 0 0 1 2.236 2.236zm2.648-10.69c-1.346 0-3.107.96-4.888 2.622-1.78-1.653-3.542-2.602-4.887-2.602-.41 0-.783.093-1.106.278-1.375.793-1.683 3.264-.973 6.365C1.98 8.917 0 10.42 0 12.004c0 1.59 1.99 3.097 5.043 4.03-.704 3.113-.39 5.588.988 6.38.32.187.69.275 1.102.275 1.345 0 3.107-.96 4.888-2.624 1.78 1.654 3.542 2.603 4.887 2.603.41 0 .783-.09 1.106-.275 1.374-.792 1.683-3.263.973-6.365C22.02 15.096 24 13.59 24 12.004c0-1.59-1.99-3.097-5.043-4.032.704-3.11.39-5.587-.988-6.38-.318-.184-.688-.277-1.092-.278zm-.005 1.09v.006c.225 0 .406.044.558.127.666.382.955 1.835.73 3.704-.054.46-.142.945-.25 1.44-.96-.236-2.006-.417-3.107-.534-.66-.905-1.345-1.727-2.035-2.447 1.592-1.48 3.087-2.292 4.105-2.295zm-9.77.02c1.012 0 2.514.808 4.11 2.28-.686.72-1.37 1.537-2.02 2.442-1.107.117-2.154.298-3.113.538-.112-.49-.195-.964-.254-1.42-.23-1.868.054-3.32.714-3.707.19-.09.4-.127.563-.132zm4.882 3.05c.455.468.91.992 1.36 1.564-.44-.02-.89-.034-1.345-.034-.46 0-.915.01-1.36.034.44-.572.895-1.096 1.345-1.565zM12 8.1c.74 0 1.477.034 2.202.093.406.582.802 1.203 1.183 1.86.372.64.71 1.29 1.018 1.946-.308.655-.646 1.31-1.013 1.95-.38.66-.773 1.288-1.18 1.87-.728.063-1.466.098-2.21.098-.74 0-1.477-.035-2.202-.093-.406-.582-.802-1.204-1.183-1.86-.372-.64-.71-1.29-1.018-1.946.303-.657.646-1.313 1.013-1.954.38-.66.773-1.286 1.18-1.868.728-.064 1.466-.098 2.21-.098zm-3.635.254c-.24.377-.48.763-.704 1.16-.225.39-.435.782-.635 1.174-.265-.656-.49-1.31-.676-1.947.64-.15 1.315-.283 2.015-.386zm7.26 0c.695.103 1.365.23 2.006.387-.18.632-.405 1.282-.66 1.933-.2-.39-.41-.783-.64-1.174-.225-.392-.465-.774-.705-1.146zm3.063.675c.484.15.944.317 1.375.498 1.732.74 2.852 1.708 2.852 2.476-.005.768-1.125 1.74-2.857 2.475-.42.18-.88.342-1.355.493-.28-.958-.646-1.956-1.1-2.98.45-1.017.81-2.01 1.085-2.964zm-13.395.004c.278.96.645 1.957 1.1 2.98-.45 1.017-.812 2.01-1.086 2.964-.484-.15-.944-.318-1.37-.5-1.732-.737-2.852-1.706-2.852-2.474 0-.768 1.12-1.742 2.852-2.476.42-.18.88-.342 1.356-.494zm11.678 4.28c.265.657.49 1.312.676 1.948-.64.157-1.316.29-2.016.39.24-.375.48-.762.705-1.158.225-.39.435-.788.636-1.18zm-9.945.02c.2.392.41.783.64 1.175.23.39.465.772.705 1.143-.695-.102-1.365-.23-2.006-.386.18-.63.406-1.282.66-1.933zM17.92 16.32c.112.493.2.968.254 1.423.23 1.868-.054 3.32-.714 3.708-.147.09-.338.128-.563.128-1.012 0-2.514-.807-4.11-2.28.686-.72 1.37-1.536 2.02-2.44 1.107-.118 2.154-.3 3.113-.54zm-11.83.01c.96.234 2.006.415 3.107.532.66.905 1.345 1.727 2.035 2.446-1.595 1.483-3.092 2.295-4.11 2.295-.22-.005-.406-.05-.553-.132-.666-.38-.955-1.834-.73-3.703.054-.46.142-.944.25-1.438zm4.56.64c.44.02.89.034 1.345.034.46 0 .915-.01 1.36-.034-.44.572-.895 1.095-1.345 1.565-.455-.47-.91-.993-1.36-1.565z",color:"#61DAFB"},Redis:{path:"M22.71 13.145c-1.66 2.092-3.452 4.483-7.038 4.483-3.203 0-4.397-2.825-4.48-5.12.701 1.484 2.073 2.685 4.214 2.63 4.117-.133 6.94-3.852 6.94-7.239 0-4.05-3.022-6.972-8.268-6.972-3.752 0-8.4 1.428-11.455 3.685C2.59 6.937 3.885 9.958 4.35 9.626c2.648-1.904 4.748-3.13 6.784-3.744C8.12 9.244.886 17.05 0 18.425c.1 1.261 1.66 4.648 2.424 4.648.232 0 .431-.133.664-.365a100.49 100.49 0 0 0 5.54-6.765c.222 3.104 1.748 6.898 6.014 6.898 3.819 0 7.604-2.756 9.33-8.965.2-.764-.73-1.361-1.261-.73zm-4.349-5.013c0 1.959-1.926 2.922-3.685 2.922-.941 0-1.664-.247-2.235-.568 1.051-1.592 2.092-3.225 3.21-4.973 1.972.334 2.71 1.43 2.71 2.619z",color:"#FF4438"},Ruby:{path:"M20.156.083c3.033.525 3.893 2.598 3.829 4.77L24 4.822 22.635 22.71 4.89 23.926h.016C3.433 23.864.15 23.729 0 19.139l1.645-3 2.819 6.586.503 1.172 2.805-9.144-.03.007.016-.03 9.255 2.956-1.396-5.431-.99-3.9 8.82-.569-.615-.51L16.5 2.114 20.159.073l-.003.01zM0 19.089zM5.13 5.073c3.561-3.533 8.157-5.621 9.922-3.84 1.762 1.777-.105 6.105-3.673 9.636-3.563 3.532-8.103 5.734-9.864 3.957-1.766-1.777.045-6.217 3.612-9.75l.003-.003z",color:"#CC342D"},Rust:{path:"M23.8346 11.7033l-1.0073-.6236a13.7268 13.7268 0 00-.0283-.2936l.8656-.8069a.3483.3483 0 00-.1154-.578l-1.1066-.414a8.4958 8.4958 0 00-.087-.2856l.6904-.9587a.3462.3462 0 00-.2257-.5446l-1.1663-.1894a9.3574 9.3574 0 00-.1407-.2622l.49-1.0761a.3437.3437 0 00-.0274-.3361.3486.3486 0 00-.3006-.154l-1.1845.0416a6.7444 6.7444 0 00-.1873-.2268l.2723-1.153a.3472.3472 0 00-.417-.4172l-1.1532.2724a14.0183 14.0183 0 00-.2278-.1873l.0415-1.1845a.3442.3442 0 00-.49-.328l-1.076.491c-.0872-.0476-.1742-.0952-.2623-.1407l-.1903-1.1673A.3483.3483 0 0016.256.955l-.9597.6905a8.4867 8.4867 0 00-.2855-.086l-.414-1.1066a.3483.3483 0 00-.5781-.1154l-.8069.8666a9.2936 9.2936 0 00-.2936-.0284L12.2946.1683a.3462.3462 0 00-.5892 0l-.6236 1.0073a13.7383 13.7383 0 00-.2936.0284L9.9803.3374a.3462.3462 0 00-.578.1154l-.4141 1.1065c-.0962.0274-.1903.0567-.2855.086L7.744.955a.3483.3483 0 00-.5447.2258L7.009 2.348a9.3574 9.3574 0 00-.2622.1407l-1.0762-.491a.3462.3462 0 00-.49.328l.0416 1.1845a7.9826 7.9826 0 00-.2278.1873L3.8413 3.425a.3472.3472 0 00-.4171.4171l.2713 1.1531c-.0628.075-.1255.1509-.1863.2268l-1.1845-.0415a.3462.3462 0 00-.328.49l.491 1.0761a9.167 9.167 0 00-.1407.2622l-1.1662.1894a.3483.3483 0 00-.2258.5446l.6904.9587a13.303 13.303 0 00-.087.2855l-1.1065.414a.3483.3483 0 00-.1155.5781l.8656.807a9.2936 9.2936 0 00-.0283.2935l-1.0073.6236a.3442.3442 0 000 .5892l1.0073.6236c.008.0982.0182.1964.0283.2936l-.8656.8079a.3462.3462 0 00.1155.578l1.1065.4141c.0273.0962.0567.1914.087.2855l-.6904.9587a.3452.3452 0 00.2268.5447l1.1662.1893c.0456.088.0922.1751.1408.2622l-.491 1.0762a.3462.3462 0 00.328.49l1.1834-.0415c.0618.0769.1235.1528.1873.2277l-.2713 1.1541a.3462.3462 0 00.4171.4161l1.153-.2713c.075.0638.151.1255.2279.1863l-.0415 1.1845a.3442.3442 0 00.49.327l1.0761-.49c.087.0486.1741.0951.2622.1407l.1903 1.1662a.3483.3483 0 00.5447.2268l.9587-.6904a9.299 9.299 0 00.2855.087l.414 1.1066a.3452.3452 0 00.5781.1154l.8079-.8656c.0972.0111.1954.0203.2936.0294l.6236 1.0073a.3472.3472 0 00.5892 0l.6236-1.0073c.0982-.0091.1964-.0183.2936-.0294l.8069.8656a.3483.3483 0 00.578-.1154l.4141-1.1066a8.4626 8.4626 0 00.2855-.087l.9587.6904a.3452.3452 0 00.5447-.2268l.1903-1.1662c.088-.0456.1751-.0931.2622-.1407l1.0762.49a.3472.3472 0 00.49-.327l-.0415-1.1845a6.7267 6.7267 0 00.2267-.1863l1.1531.2713a.3472.3472 0 00.4171-.416l-.2713-1.1542c.0628-.0749.1255-.1508.1863-.2278l1.1845.0415a.3442.3442 0 00.328-.49l-.49-1.076c.0475-.0872.0951-.1742.1407-.2623l1.1662-.1893a.3483.3483 0 00.2258-.5447l-.6904-.9587.087-.2855 1.1066-.414a.3462.3462 0 00.1154-.5781l-.8656-.8079c.0101-.0972.0202-.1954.0283-.2936l1.0073-.6236a.3442.3442 0 000-.5892zm-6.7413 8.3551a.7138.7138 0 01.2986-1.396.714.714 0 11-.2997 1.396zm-.3422-2.3142a.649.649 0 00-.7715.5l-.3573 1.6685c-1.1035.501-2.3285.7795-3.6193.7795a8.7368 8.7368 0 01-3.6951-.814l-.3574-1.6684a.648.648 0 00-.7714-.499l-1.473.3158a8.7216 8.7216 0 01-.7613-.898h7.1676c.081 0 .1356-.0141.1356-.088v-2.536c0-.074-.0536-.0881-.1356-.0881h-2.0966v-1.6077h2.2677c.2065 0 1.1065.0587 1.394 1.2088.0901.3533.2875 1.5044.4232 1.8729.1346.413.6833 1.2381 1.2685 1.2381h3.5716a.7492.7492 0 00.1296-.0131 8.7874 8.7874 0 01-.8119.9526zM6.8369 20.024a.714.714 0 11-.2997-1.396.714.714 0 01.2997 1.396zM4.1177 8.9972a.7137.7137 0 11-1.304.5791.7137.7137 0 011.304-.579zm-.8352 1.9813l1.5347-.6824a.65.65 0 00.33-.8585l-.3158-.7147h1.2432v5.6025H3.5669a8.7753 8.7753 0 01-.2834-3.348zm6.7343-.5437V8.7836h2.9601c.153 0 1.0792.1772 1.0792.8697 0 .575-.7107.7815-1.2948.7815zm10.7574 1.4862c0 .2187-.008.4363-.0243.651h-.9c-.09 0-.1265.0586-.1265.1477v.413c0 .973-.5487 1.1846-1.0296 1.2382-.4576.0517-.9648-.1913-1.0275-.4717-.2704-1.5186-.7198-1.8436-1.4305-2.4034.8817-.5599 1.799-1.386 1.799-2.4915 0-1.1936-.819-1.9458-1.3769-2.3153-.7825-.5163-1.6491-.6195-1.883-.6195H5.4682a8.7651 8.7651 0 014.907-2.7699l1.0974 1.151a.648.648 0 00.9182.0213l1.227-1.1743a8.7753 8.7753 0 016.0044 4.2762l-.8403 1.8982a.652.652 0 00.33.8585l1.6178.7188c.0283.2875.0425.577.0425.8717zm-9.3006-9.5993a.7128.7128 0 11.984 1.0316.7137.7137 0 01-.984-1.0316zm8.3389 6.71a.7107.7107 0 01.9395-.3625.7137.7137 0 11-.9405.3635z",color:"#F74C00"},Scala:{path:"M4.589 24c4.537 0 13.81-1.516 14.821-3v-5.729c-.957 1.408-10.284 2.912-14.821 2.912V24zM4.589 16.365c4.537 0 13.81-1.516 14.821-3V7.636c-.957 1.408-10.284 2.912-14.821 2.912v5.817zM4.589 8.729c4.537 0 13.81-1.516 14.821-3V0C18.453 1.408 9.126 2.912 4.589 2.912v5.817z",color:"#DC322F"},Svelte:{path:"M10.354 21.125a4.44 4.44 0 0 1-4.765-1.767 4.109 4.109 0 0 1-.703-3.107 3.898 3.898 0 0 1 .134-.522l.105-.321.287.21a7.21 7.21 0 0 0 2.186 1.092l.208.063-.02.208a1.253 1.253 0 0 0 .226.83 1.337 1.337 0 0 0 1.435.533 1.231 1.231 0 0 0 .343-.15l5.59-3.562a1.164 1.164 0 0 0 .524-.778 1.242 1.242 0 0 0-.211-.937 1.338 1.338 0 0 0-1.435-.533 1.23 1.23 0 0 0-.343.15l-2.133 1.36a4.078 4.078 0 0 1-1.135.499 4.44 4.44 0 0 1-4.765-1.766 4.108 4.108 0 0 1-.702-3.108 3.855 3.855 0 0 1 1.742-2.582l5.589-3.563a4.072 4.072 0 0 1 1.135-.499 4.44 4.44 0 0 1 4.765 1.767 4.109 4.109 0 0 1 .703 3.107 3.943 3.943 0 0 1-.134.522l-.105.321-.286-.21a7.204 7.204 0 0 0-2.187-1.093l-.208-.063.02-.207a1.255 1.255 0 0 0-.226-.831 1.337 1.337 0 0 0-1.435-.532 1.231 1.231 0 0 0-.343.15L8.62 9.368a1.162 1.162 0 0 0-.524.778 1.24 1.24 0 0 0 .211.937 1.338 1.338 0 0 0 1.435.533 1.235 1.235 0 0 0 .344-.151l2.132-1.36a4.067 4.067 0 0 1 1.135-.498 4.44 4.44 0 0 1 4.765 1.766 4.108 4.108 0 0 1 .702 3.108 3.857 3.857 0 0 1-1.742 2.583l-5.589 3.562a4.072 4.072 0 0 1-1.135.499m10.358-17.95C18.484-.015 14.082-.96 10.9 1.068L5.31 4.63a6.412 6.412 0 0 0-2.896 4.295 6.753 6.753 0 0 0 .666 4.336 6.43 6.43 0 0 0-.96 2.396 6.833 6.833 0 0 0 1.168 5.167c2.229 3.19 6.63 4.135 9.812 2.108l5.59-3.562a6.41 6.41 0 0 0 2.896-4.295 6.756 6.756 0 0 0-.665-4.336 6.429 6.429 0 0 0 .958-2.396 6.831 6.831 0 0 0-1.167-5.168Z",color:"#FF3E00"},Swift:{path:"M7.508 0c-.287 0-.573 0-.86.002-.241.002-.483.003-.724.01-.132.003-.263.009-.395.015A9.154 9.154 0 0 0 4.348.15 5.492 5.492 0 0 0 2.85.645 5.04 5.04 0 0 0 .645 2.848c-.245.48-.4.972-.495 1.5-.093.52-.122 1.05-.136 1.576a35.2 35.2 0 0 0-.012.724C0 6.935 0 7.221 0 7.508v8.984c0 .287 0 .575.002.862.002.24.005.481.012.722.014.526.043 1.057.136 1.576.095.528.25 1.02.495 1.5a5.03 5.03 0 0 0 2.205 2.203c.48.244.97.4 1.498.495.52.093 1.05.124 1.576.138.241.007.483.009.724.01.287.002.573.002.86.002h8.984c.287 0 .573 0 .86-.002.241-.001.483-.003.724-.01a10.523 10.523 0 0 0 1.578-.138 5.322 5.322 0 0 0 1.498-.495 5.035 5.035 0 0 0 2.203-2.203c.245-.48.4-.972.495-1.5.093-.52.124-1.05.138-1.576.007-.241.009-.481.01-.722.002-.287.002-.575.002-.862V7.508c0-.287 0-.573-.002-.86a33.662 33.662 0 0 0-.01-.724 10.5 10.5 0 0 0-.138-1.576 5.328 5.328 0 0 0-.495-1.5A5.039 5.039 0 0 0 21.152.645 5.32 5.32 0 0 0 19.654.15a10.493 10.493 0 0 0-1.578-.138 34.98 34.98 0 0 0-.722-.01C17.067 0 16.779 0 16.492 0H7.508zm6.035 3.41c4.114 2.47 6.545 7.162 5.549 11.131-.024.093-.05.181-.076.272l.002.001c2.062 2.538 1.5 5.258 1.236 4.745-1.072-2.086-3.066-1.568-4.088-1.043a6.803 6.803 0 0 1-.281.158l-.02.012-.002.002c-2.115 1.123-4.957 1.205-7.812-.022a12.568 12.568 0 0 1-5.64-4.838c.649.48 1.35.902 2.097 1.252 3.019 1.414 6.051 1.311 8.197-.002C9.651 12.73 7.101 9.67 5.146 7.191a10.628 10.628 0 0 1-1.005-1.384c2.34 2.142 6.038 4.83 7.365 5.576C8.69 8.408 6.208 4.743 6.324 4.86c4.436 4.47 8.528 6.996 8.528 6.996.154.085.27.154.36.213.085-.215.16-.437.224-.668.708-2.588-.09-5.548-1.893-7.992z",color:"#F05138"},Tailwindcss:{path:"M12.001,4.8c-3.2,0-5.2,1.6-6,4.8c1.2-1.6,2.6-2.2,4.2-1.8c0.913,0.228,1.565,0.89,2.288,1.624 C13.666,10.618,15.027,12,18.001,12c3.2,0,5.2-1.6,6-4.8c-1.2,1.6-2.6,2.2-4.2,1.8c-0.913-0.228-1.565-0.89-2.288-1.624 C16.337,6.182,14.976,4.8,12.001,4.8z M6.001,12c-3.2,0-5.2,1.6-6,4.8c1.2-1.6,2.6-2.2,4.2-1.8c0.913,0.228,1.565,0.89,2.288,1.624 c1.177,1.194,2.538,2.576,5.512,2.576c3.2,0,5.2-1.6,6-4.8c-1.2,1.6-2.6,2.2-4.2,1.8c-0.913-0.228-1.565-0.89-2.288-1.624 C10.337,13.382,8.976,12,6.001,12z",color:"#06B6D4"},Typescript:{path:"M1.125 0C.502 0 0 .502 0 1.125v21.75C0 23.498.502 24 1.125 24h21.75c.623 0 1.125-.502 1.125-1.125V1.125C24 .502 23.498 0 22.875 0zm17.363 9.75c.612 0 1.154.037 1.627.111a6.38 6.38 0 0 1 1.306.34v2.458a3.95 3.95 0 0 0-.643-.361 5.093 5.093 0 0 0-.717-.26 5.453 5.453 0 0 0-1.426-.2c-.3 0-.573.028-.819.086a2.1 2.1 0 0 0-.623.242c-.17.104-.3.229-.393.374a.888.888 0 0 0-.14.49c0 .196.053.373.156.529.104.156.252.304.443.444s.423.276.696.41c.273.135.582.274.926.416.47.197.892.407 1.266.628.374.222.695.473.963.753.268.279.472.598.614.957.142.359.214.776.214 1.253 0 .657-.125 1.21-.373 1.656a3.033 3.033 0 0 1-1.012 1.085 4.38 4.38 0 0 1-1.487.596c-.566.12-1.163.18-1.79.18a9.916 9.916 0 0 1-1.84-.164 5.544 5.544 0 0 1-1.512-.493v-2.63a5.033 5.033 0 0 0 3.237 1.2c.333 0 .624-.03.872-.09.249-.06.456-.144.623-.25.166-.108.29-.234.373-.38a1.023 1.023 0 0 0-.074-1.089 2.12 2.12 0 0 0-.537-.5 5.597 5.597 0 0 0-.807-.444 27.72 27.72 0 0 0-1.007-.436c-.918-.383-1.602-.852-2.053-1.405-.45-.553-.676-1.222-.676-2.005 0-.614.123-1.141.369-1.582.246-.441.58-.804 1.004-1.089a4.494 4.494 0 0 1 1.47-.629 7.536 7.536 0 0 1 1.77-.201zm-15.113.188h9.563v2.166H9.506v9.646H6.789v-9.646H3.375z",color:"#3178C6"},Vite:{path:"M13.056 23.238a.57.57 0 0 1-1.02-.355v-5.202c0-.63-.512-1.143-1.144-1.143H5.148a.57.57 0 0 1-.464-.903l3.777-5.29c.54-.753 0-1.804-.93-1.804H.57a.574.574 0 0 1-.543-.746.6.6 0 0 1 .08-.157L5.008.78a.57.57 0 0 1 .467-.24h14.589a.57.57 0 0 1 .466.903l-3.778 5.29c-.54.755 0 1.806.93 1.806h5.745c.238 0 .424.138.513.322a.56.56 0 0 1-.063.603z",color:"#9135FF"},Vuedotjs:{path:"M24,1.61H14.06L12,5.16,9.94,1.61H0L12,22.39ZM12,14.08,5.16,2.23H9.59L12,6.41l2.41-4.18h4.43Z",color:"#4FC08D"},Zig:{path:"m23.53 1.02-7.686 3.45h-7.06l-2.98 3.452h7.173L.47 22.98l7.681-3.607h7.065v-.002l2.978-3.45-7.148-.001 12.482-14.9zM0 4.47v14.901h1.883l2.98-3.45H3.451v-8h.942l2.824-3.45H0zm22.117 0-2.98 3.608h1.412v7.844h-.942l-2.98 3.45H24V4.47h-1.883z",color:"#F7A41D"}};function m(e){let{name:t,size:n,className:r}=e,a=u[t];return(0,i.Y)("svg",{viewBox:"0 0 24 24",width:n,height:n,fill:a.color,className:r,"aria-hidden":"true",children:(0,i.Y)("path",{d:a.path})})}let h=[[["tsx","jsx"],"React"],[["ts","mts","cts"],"Typescript"],[["js","cjs","mjs"],"Javascript"],[["go"],"Go"],[["py","pyi"],"Python"],[["rs"],"Rust"],[["php"],"Php"],[["kt","kts"],"Kotlin"],[["swift"],"Swift"],[["rb"],"Ruby"],[["java"],"Openjdk"],[["c","h"],"C"],[["cpp","cc","cxx","hpp","hh"],"Cplusplus"],[["cs"],"Csharp"],[["zig"],"Zig"],[["lua"],"Lua"],[["dart"],"Dart"],[["ex","exs"],"Elixir"],[["hs"],"Haskell"],[["scala"],"Scala"],[["pl","pm"],"Perl"],[["jl"],"Julia"],[["r"],"R"],[["vue"],"Vuedotjs"],[["svelte"],"Svelte"],[["astro"],"Astro"]],b=(()=>{let e=new Map;for(let[t,n]of h)for(let i of t)e.set(i,n);return e})();function f(e){let{name:t,isFolder:n,isOpen:u,size:h=14,className:f=""}=e,x=t.toLowerCase();if(n)return"node_modules"===x?(0,i.Y)(m,{name:"Npm",size:h,className:f}):u?(0,i.Y)(r.A,{size:h,className:`text-meta ${f}`}):(0,i.Y)(a.A,{size:h,className:`text-meta ${f}`});if("package.json"===x)return(0,i.Y)(m,{name:"Npm",size:h,className:f});let g=x.lastIndexOf(".");if(g>=0){let e=x.slice(g+1),t=b.get(e);if(t)return(0,i.Y)(m,{name:t,size:h,className:f})}return x.endsWith(".json")?(0,i.Y)(l.A,{size:h,color:"#eab308",className:f}):x.endsWith(".css")||x.endsWith(".scss")?(0,i.Y)(m,{name:"Css",size:h,className:f}):x.endsWith(".html")?(0,i.Y)(m,{name:"Html5",size:h,className:f}):x.endsWith(".md")||x.endsWith(".txt")?(0,i.Y)(s.A,{size:h,className:`text-ink/70 ${f}`}):x.endsWith(".png")||x.endsWith(".jpg")||x.endsWith(".jpeg")||x.endsWith(".svg")||x.endsWith(".ico")||x.endsWith(".webp")?(0,i.Y)(o.A,{size:h,color:"#c084fc",className:f}):x.endsWith(".sh")||x.endsWith(".bash")?(0,i.Y)(m,{name:"Gnubash",size:h,className:f}):x.startsWith(".env")||x.startsWith(".")||x.includes("config")?(0,i.Y)(c.A,{size:h,className:`text-ink/60 ${f}`}):x.endsWith(".zip")||x.endsWith(".tar.gz")?(0,i.Y)(d.A,{size:h,className:`text-warning ${f}`}):(0,i.Y)(p.A,{size:h,className:`text-ink/60 ${f}`})}},M(e,t,n){n.d(t,{H:()=>f});var i=n("j"),r=n("SU"),a=n("p");function l(e){let{providerName:t,configured:n,error:l,note:s,children:o}=e;return(0,i.FD)("section",{className:"bg-paper border border-ink/15 rounded-lg shadow-xs",children:[(0,i.FD)("header",{className:"flex items-center justify-between gap-2 px-3.5 py-2.5 border-b border-ink/10",children:[(0,i.Y)("span",{className:"text-xs font-semibold text-ink",children:t}),(0,i.Y)("span",{className:"text-[10px] font-mono uppercase tracking-wider text-ink/50",children:n?"Connected":"Not configured"})]}),(0,i.FD)("div",{className:"p-3.5 space-y-4",children:[n?(0,i.FD)(i.FK,{children:[l&&(0,i.FD)("p",{className:"flex items-start gap-2 text-error text-xs leading-relaxed",children:[(0,i.Y)(a.A,{size:14,className:"shrink-0 mt-0.5"}),(0,i.Y)("span",{className:"break-words",children:l})]}),o]}):(0,i.FD)("div",{className:"flex items-start gap-2 text-ink/60 text-xs leading-relaxed",children:[(0,i.Y)(r.A,{size:14,className:"shrink-0 mt-0.5 text-ink/40"}),(0,i.FD)("p",{children:["Add the ",(0,i.Y)("span",{className:"font-semibold text-ink",children:t})," API key in Settings → Providers to see its balance, quota, and usage here."]})]}),s&&(0,i.Y)("p",{className:"text-[10px] text-ink/50 leading-relaxed border-t border-ink/10 pt-2.5",children:s})]})]})}var s=n("nj"),o=n("Rm"),c=n("TW");function d(e){let{window:t}=e,n=t.usedRp+t.remainingRp,r=(0,c.Nk)(t.usedRp,n);return(0,i.FD)("div",{className:"bg-paper border border-ink/15 rounded-lg p-3 shadow-xs space-y-2",children:[(0,i.FD)("div",{className:"flex items-center justify-between gap-2",children:[(0,i.Y)("span",{className:"text-[11px] font-semibold text-ink",children:t.label}),(0,i.FD)("span",{className:"text-[10px] text-ink/50",children:["Resets ",(0,c.r6)(t.resetsAt)]})]}),(0,i.Y)("div",{className:"h-1.5 w-full bg-ink/10 rounded-full overflow-hidden",children:(0,i.Y)("div",{className:"h-full bg-ink/80 rounded-full",style:{width:`${r}%`}})}),(0,i.FD)("div",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-0.5 text-[10px] text-ink/60",children:[(0,i.FD)("span",{children:["Used ",(0,i.Y)("span",{className:"font-semibold text-ink",children:(0,c.QH)(t.usedRp)})," ·"," ",(0,c.l9)(t.usedRp,n)]}),(0,i.FD)("span",{children:["Remaining ",(0,i.Y)("span",{className:"font-semibold text-ink",children:(0,c.QH)(t.remainingRp)})]})]})]})}function p(e){let{coupon:t}=e;return(0,i.FD)("div",{className:"bg-ink/5 border border-ink/10 rounded-lg p-3 shadow-xs",children:[(0,i.FD)("div",{className:"flex items-center gap-1.5 mb-1.5",children:[(0,i.Y)(o.A,{size:12,className:"text-ink/60"}),(0,i.FD)("span",{className:"text-[11px] font-semibold text-ink",children:["Active coupon · ",t.name]})]}),(0,i.FD)("div",{className:"text-[10px] text-ink/60 space-y-0.5",children:[(0,i.FD)("div",{children:["Remaining"," ",(0,i.Y)("span",{className:"font-semibold text-ink",children:null===t.remainingRp?"Unlimited":(0,c.QH)(t.remainingRp)})," ","· Used ",(0,i.Y)("span",{className:"font-semibold text-ink",children:(0,c.QH)(t.usedRp)})]}),(0,i.FD)("div",{children:["Expires ",(0,c.r6)(t.expiresAt)]}),t.scopeModels.length>0&&(0,i.FD)("div",{children:["Models: ",t.scopeModels.join(", ")]})]})]})}function u(e){let{quota:t}=e;return t?(0,i.FD)("div",{className:"space-y-2",children:[(0,i.FD)("div",{className:"flex items-center justify-between gap-2",children:[(0,i.Y)("h4",{className:"text-[10px] font-mono font-semibold uppercase tracking-wider text-ink/40",children:"Quota windows"}),t.planName&&(0,i.FD)("span",{className:"text-[10px] text-ink/60",children:["Plan ",(0,i.Y)("span",{className:"font-semibold text-ink",children:t.planName})]})]}),0===t.windows.length?(0,i.Y)("p",{className:"text-[11px] text-ink/50",children:"No quota windows reported."}):(0,i.Y)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2.5",children:t.windows.map(e=>(0,i.Y)(d,{window:e},e.key))}),t.coupon&&(0,i.Y)(p,{coupon:t.coupon})]}):(0,i.Y)("p",{className:"text-[11px] text-ink/50",children:"Quota data is not available for this account."})}function m(e){let{usage:t}=e;if(!t)return(0,i.Y)("p",{className:"text-[11px] text-ink/50",children:"The 30-day usage report is not available."});let n=t.rows.reduce((e,t)=>e+t.inputTokens,0),r=t.rows.reduce((e,t)=>e+t.outputTokens,0);return(0,i.FD)("div",{className:"space-y-2",children:[(0,i.Y)("h4",{className:"text-[10px] font-mono font-semibold uppercase tracking-wider text-ink/40",children:"30-day usage by model"}),(0,i.Y)("div",{className:"overflow-x-auto border border-ink/15 rounded-lg shadow-xs",children:(0,i.FD)("table",{className:"w-full text-[11px]",children:[(0,i.Y)("thead",{className:"bg-ink/5 text-ink/60",children:(0,i.FD)("tr",{children:[(0,i.Y)("th",{className:"text-left font-semibold px-3 py-2 whitespace-nowrap",children:"Model"}),(0,i.Y)("th",{className:"text-right font-semibold px-3 py-2 whitespace-nowrap",children:"Requests"}),(0,i.Y)("th",{className:"text-right font-semibold px-3 py-2 whitespace-nowrap",children:"Input tokens"}),(0,i.Y)("th",{className:"text-right font-semibold px-3 py-2 whitespace-nowrap",children:"Output tokens"}),(0,i.Y)("th",{className:"text-right font-semibold px-3 py-2 whitespace-nowrap",children:"Cost"})]})}),(0,i.Y)("tbody",{className:"divide-y divide-ink/10",children:0===t.rows.length?(0,i.Y)("tr",{children:(0,i.Y)("td",{colSpan:5,className:"px-3 py-3 text-center text-ink/50",children:"No usage recorded in the last 30 days."})}):t.rows.map(e=>(0,i.FD)("tr",{children:[(0,i.Y)("td",{className:"px-3 py-1.5 font-mono text-ink whitespace-nowrap",children:e.model}),(0,i.Y)("td",{className:"px-3 py-1.5 text-right tabular-nums text-ink/80",children:(0,c.ZV)(e.requests)}),(0,i.Y)("td",{className:"px-3 py-1.5 text-right tabular-nums text-ink/80",children:(0,c.Rk)(e.inputTokens)}),(0,i.Y)("td",{className:"px-3 py-1.5 text-right tabular-nums text-ink/80",children:(0,c.Rk)(e.outputTokens)}),(0,i.Y)("td",{className:"px-3 py-1.5 text-right tabular-nums text-ink/80",children:(0,c.QH)(e.costRp)})]},e.model))}),(0,i.Y)("tfoot",{className:"bg-ink/5 border-t border-ink/15 font-semibold text-ink",children:(0,i.FD)("tr",{children:[(0,i.Y)("td",{className:"px-3 py-2",children:"Total"}),(0,i.Y)("td",{className:"px-3 py-2 text-right tabular-nums",children:(0,c.ZV)(t.totalRequests)}),(0,i.Y)("td",{className:"px-3 py-2 text-right tabular-nums",children:(0,c.Rk)(n)}),(0,i.Y)("td",{className:"px-3 py-2 text-right tabular-nums",children:(0,c.Rk)(r)}),(0,i.Y)("td",{className:"px-3 py-2 text-right tabular-nums",children:(0,c.QH)(t.totalCostRp)})]})})]})})]})}function h(e){let{report:t}=e,{balance:n,usage:r,quota:a}=t;if(!n&&!r&&!a)return(0,i.Y)("p",{className:"text-[11px] text-ink/50",children:"No kenari data was returned for this account."});let l=n?null!==n.amountRp?(0,c.QH)(n.amountRp):n.raw:"—",o=n?null!==n.amountRp?n.raw:"Amount could not be parsed":"Balance unavailable",d=r?r.rows.reduce((e,t)=>e+t.inputTokens+t.outputTokens,0):0;return(0,i.FD)(i.FK,{children:[(0,i.Y)("div",{className:"@container",children:(0,i.FD)("div",{className:"grid grid-cols-3 @[540px]:grid-cols-5 gap-2.5 items-stretch",children:[(0,i.Y)(s.h,{value:l,label:"Wallet balance",hint:o}),(0,i.Y)(s.h,{value:a?.planName??"—",label:"Active plan",hint:a?"kenari quota plan":"Quota unavailable"}),(0,i.Y)(s.h,{value:r?(0,c.ZV)(r.totalRequests):"—",label:"Requests (30 days)",hint:r?"Across all models":"Usage report unavailable"}),(0,i.Y)(s.h,{value:r?(0,c.QH)(r.totalCostRp):"—",label:"Cost (30 days)",hint:r?"Billed in Rupiah":"Usage report unavailable"}),(0,i.Y)(s.h,{value:r?(0,c.Rk)(d):"—",label:"Tokens processed (30 days)",hint:r?"Input + output":"Usage report unavailable",tone:"muted",className:"col-span-2 @[540px]:col-span-1"})]})}),(0,i.Y)(u,{quota:a}),(0,i.Y)(m,{usage:r})]})}function b(e){let{report:t}=e,n=t.balance;return n?(0,i.FD)(i.FK,{children:[(0,i.Y)("div",{className:"@container",children:(0,i.FD)("div",{className:"grid grid-cols-3 @[540px]:grid-cols-5 gap-2.5 items-stretch",children:[(0,i.Y)(s.h,{value:n.isAvailable?"Available":"Unavailable",label:"Prepaid balance",hint:n.isAvailable?"Account can spend":"Top up required",tone:n.isAvailable?"default":"muted"}),(0,i.Y)(s.h,{value:(0,c.ZV)(n.entries.length),label:"Currency buckets",hint:n.entries.length>0?"From the balance endpoint":"No entries returned",tone:"muted"})]})}),0===n.entries.length?(0,i.Y)("p",{className:"text-[11px] text-ink/50",children:"The balance endpoint returned no currency entries."}):(0,i.Y)("div",{className:"grid grid-cols-1 gap-2.5",children:n.entries.map(e=>(0,i.FD)("div",{className:"bg-paper border border-ink/15 rounded-lg p-3 shadow-xs",children:[(0,i.FD)("div",{className:"flex items-center justify-between gap-2 mb-2",children:[(0,i.Y)("span",{className:"text-[11px] font-semibold text-ink",children:e.currency}),(0,i.Y)("span",{className:"text-[10px] font-mono uppercase tracking-wider text-ink/40",children:"Balance"})]}),(0,i.FD)("dl",{className:"grid grid-cols-3 gap-2 text-[10px]",children:[(0,i.FD)("div",{children:[(0,i.Y)("dt",{className:"text-ink/50",children:"Total"}),(0,i.Y)("dd",{className:"font-semibold text-ink tabular-nums break-words",children:(0,c.ej)(e.totalBalance)})]}),(0,i.FD)("div",{children:[(0,i.Y)("dt",{className:"text-ink/50",children:"Granted"}),(0,i.Y)("dd",{className:"font-semibold text-ink tabular-nums break-words",children:(0,c.ej)(e.grantedBalance)})]}),(0,i.FD)("div",{children:[(0,i.Y)("dt",{className:"text-ink/50",children:"Topped up"}),(0,i.Y)("dd",{className:"font-semibold text-ink tabular-nums break-words",children:(0,c.ej)(e.toppedUpBalance)})]})]})]},e.currency))})]}):(0,i.Y)("p",{className:"text-[11px] text-ink/50",children:"DeepSeek balance data is not available."})}function f(e){let{providerId:t,report:n}=e;return"kenari"===t?(0,i.Y)(l,{providerName:"Kenari.id",configured:n.kenari.configured,error:n.kenari.error,children:(0,i.Y)(h,{report:n.kenari})}):(0,i.Y)(l,{providerName:"DeepSeek",configured:n.deepseek.configured,error:n.deepseek.error,note:"DeepSeek exposes no usage or quota API — only the prepaid balance (and the web console at platform.deepseek.com) is available.",children:(0,i.Y)(b,{report:n.deepseek})})}},TW(e,t,n){let i=new Intl.NumberFormat("id-ID",{style:"currency",currency:"IDR",maximumFractionDigits:0}),r=new Intl.NumberFormat("id-ID"),a=new Intl.NumberFormat("id-ID",{minimumFractionDigits:2,maximumFractionDigits:2,useGrouping:!1}),l=new Intl.DateTimeFormat("id-ID",{dateStyle:"medium",timeStyle:"short"});function s(e){return i.format(e)}function o(e){return r.format(e)}function c(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:l.format(t)}function d(e,t){return t<=0?0:Math.min(100,Math.max(0,e/t*100))}function p(e,t){return t<=0?"0%":`${new Intl.NumberFormat("id-ID",{maximumFractionDigits:1}).format(e/t*100)}%`}function u(e){if(!Number.isFinite(e))return"0";let t=Math.abs(e);return t>=1e9?`${a.format(e/1e9)}B`:t>=1e6?`${a.format(e/1e6)}M`:t>=1e3?`${a.format(e/1e3)}K`:o(e)}function m(e){let t=Number(e);return""!==e.trim()&&Number.isFinite(t)?o(t):e}n.d(t,{Nk:()=>d,QH:()=>s,Rk:()=>u,ZV:()=>o,ej:()=>m,l9:()=>p,r6:()=>c})},hm(e,t,n){var i=n("TW");function r(e){let t=e.kenari.quota?.planName,n=e.deepseek.balance?.entries[0];return[{id:"kenari",name:"Kenari.id",configured:e.kenari.configured,error:e.kenari.error,hint:t??"Wallet & quota"},{id:"deepseek",name:"DeepSeek",configured:e.deepseek.configured,error:e.deepseek.error,hint:n?`${n.currency} ${(0,i.ej)(n.totalBalance)}`:"Prepaid balance"}]}function a(e){return e.configured?e.error?"Error":"Connected":"Not configured"}n.d(t,{R:()=>a,T:()=>r})},heW(e,t,n){n.d(t,{M:()=>D});var i=n("j"),r=n("H"),a=n("Xk"),l=n("FL"),s=n("qg"),o=n("l"),c=n("hH"),d=n("cO"),p=n("nV"),u=n("z"),m=n("b0"),h=n("Ih"),b=n("DV"),f=n("r"),x=n("A"),g=n("cx"),v=n("LQ");function k(e){let{filePath:t,status:n,isStaged:r,viewMode:a,ignoreWhitespace:l,additions:s,deletions:k,isLoading:y,isCopied:w,onToggleViewMode:N,onToggleWhitespace:Y,onStageUnstage:D,onDiscard:A,onOpenInEditor:F,onRefresh:C,onCopyDiff:S}=e,T=t.split("/").pop()||t,M=(0,v.R)(n,r);return(0,i.FD)("div",{className:"flex items-center justify-between px-3 py-1.5 bg-paper border-b border-ink/10 text-xs font-sans select-none flex-shrink-0 overflow-x-auto no-scrollbar",children:[(0,i.FD)("div",{className:"hidden md:flex items-center space-x-2 min-w-0 pr-2",children:[(0,i.Y)(g.o,{name:T,size:14,className:"flex-shrink-0"}),(0,i.Y)("span",{className:"font-mono text-ink font-medium truncate",title:t,children:T}),(0,i.FD)("span",{className:`px-1.5 py-0.5 text-[10px] font-mono font-semibold rounded border ${M.badgeBgClass} flex-shrink-0`,children:[M.charStatus," ",M.label]}),(s>0||k>0)&&(0,i.FD)("div",{className:"flex items-center space-x-1.5 text-[11px] font-mono flex-shrink-0 ml-1",children:[s>0&&(0,i.FD)("span",{className:"text-success font-semibold",children:["+",s]}),k>0&&(0,i.FD)("span",{className:"text-error font-semibold",children:["-",k]})]})]}),(0,i.FD)("div",{className:"flex items-center space-x-1 text-ink/70 flex-shrink-0 ml-auto",children:[(0,i.FD)("div",{className:"flex items-center bg-canvas rounded border border-ink/15 p-0.5 mr-1",children:[(0,i.FD)("button",{type:"button",onClick:N,className:`px-2 py-0.5 rounded text-[11px] font-medium flex items-center space-x-1 transition-colors ${"split"===a?"bg-paper text-ink shadow-xs":"text-ink/60 hover:text-ink"}`,title:"Split (side-by-side) Diff",children:[(0,i.Y)(o.A,{size:12}),(0,i.Y)("span",{className:"hidden sm:inline",children:"Split"})]}),(0,i.FD)("button",{type:"button",onClick:N,className:`px-2 py-0.5 rounded text-[11px] font-medium flex items-center space-x-1 transition-colors ${"unified"===a?"bg-paper text-ink shadow-xs":"text-ink/60 hover:text-ink"}`,title:"Unified Diff",children:[(0,i.Y)(c.A,{size:12}),(0,i.Y)("span",{className:"hidden sm:inline",children:"Unified"})]})]}),(0,i.Y)("button",{type:"button",onClick:Y,className:`p-1.5 rounded transition-colors ${l?"bg-ink/10 text-ink":"text-ink/50 hover:text-ink hover:bg-ink/5"}`,title:l?"Whitespace ignored":"Ignore whitespace",children:(0,i.Y)(d.A,{size:13})}),(0,i.Y)("button",{type:"button",onClick:C,className:"p-1.5 text-ink/50 hover:text-ink hover:bg-ink/5 rounded transition-colors",title:"Refresh Diff",disabled:y,children:(0,i.Y)(p.A,{size:13,className:y?"animate-spin":""})}),(0,i.Y)("button",{type:"button",onClick:S,className:"p-1.5 text-ink/50 hover:text-ink hover:bg-ink/5 rounded transition-colors",title:"Copy Diff Text",children:w?(0,i.Y)(u.A,{size:13,className:"text-success"}):(0,i.Y)(m.A,{size:13})}),!r&&(0,i.Y)("button",{type:"button",onClick:A,className:"p-1.5 text-ink/50 hover:text-error hover:bg-error/10 rounded transition-colors",title:"Discard changes in this file",children:(0,i.Y)(h.A,{size:13})}),(0,i.Y)("button",{type:"button",onClick:D,className:"px-2 py-1 text-[11px] font-medium rounded border border-ink/15 hover:bg-ink/5 flex items-center space-x-1 transition-colors text-ink",title:r?"Unstage file":"Stage file",children:r?(0,i.FD)(i.FK,{children:[(0,i.Y)(b.A,{size:12}),(0,i.Y)("span",{children:"Unstage"})]}):(0,i.FD)(i.FK,{children:[(0,i.Y)(f.A,{size:12}),(0,i.Y)("span",{children:"Stage"})]})}),F&&(0,i.FD)("button",{type:"button",onClick:F,className:"px-2 py-1 text-[11px] font-medium rounded bg-ink text-canvas hover:bg-ink/90 flex items-center space-x-1 transition-colors shadow-xs ml-1",title:"Open in Code Editor",children:[(0,i.Y)(x.A,{size:12}),(0,i.Y)("span",{className:"hidden sm:inline",children:"Edit File"})]})]})]})}var y=n("Po");function w(e){let{lines:t,language:n}=e,a=(0,y.w)(),l=(0,r.Kr)(()=>{let e=Array(t.length).fill(""),i=-1,r=r=>{if(i<0)return;let a=(0,s.O9)(t.slice(i,r).map(e=>e.text).join("\n"),n);for(let t=i;t<r;t++)e[t]=a[t-i]??"";i=-1};return t.forEach((e,t)=>{"meta"===e.type?r(t):i<0&&(i=t)}),r(t.length),e},[t,n,a]);return 0===t.length?(0,i.Y)("div",{className:"flex-1 flex items-center justify-center text-ink/40 font-mono text-xs p-8",children:"No differences between working file and target."}):(0,i.Y)("div",{className:"w-full h-full overflow-auto font-mono text-xs select-text bg-paper text-ink code-surface",children:(0,i.Y)("table",{className:"w-max min-w-full border-collapse",children:(0,i.Y)("tbody",{children:t.map((e,t)=>{if("meta"===e.type)return(0,i.FD)("tr",{className:"bg-canvas border-y border-ink/10 text-meta select-none",children:[(0,i.Y)("td",{className:"w-12 text-center py-1 px-2 text-[10px] opacity-60 border-r border-ink/10 font-mono",children:"..."}),(0,i.Y)("td",{className:"w-12 text-center py-1 px-2 text-[10px] opacity-60 border-r border-ink/10 font-mono",children:"..."}),(0,i.Y)("td",{className:"py-1 px-3 text-[11px] font-semibold text-meta font-mono tracking-tight",children:e.text})]},t);let n="add"===e.type,r="del"===e.type;return(0,i.FD)("tr",{className:`transition-colors group ${n?"bg-success/10 hover:bg-success/15":r?"bg-error/10 hover:bg-error/15":"hover:bg-ink/[0.03]"}`,children:[(0,i.Y)("td",{className:`w-12 py-0.5 px-2 text-right text-[10px] select-none border-r border-ink/10 font-mono ${r?"bg-error/15 text-error font-semibold":n?"bg-success/15 text-success/70":"bg-canvas/50 text-ink/40"}`,children:e.oldLineNumber||""}),(0,i.Y)("td",{className:`w-12 py-0.5 px-2 text-right text-[10px] select-none border-r border-ink/10 font-mono ${n?"bg-success/15 text-success font-semibold":r?"bg-error/15 text-error/70":"bg-canvas/50 text-ink/40"}`,children:e.newLineNumber||""}),(0,i.FD)("td",{className:"py-0.5 px-3 whitespace-pre text-ink pr-6",children:[(0,i.Y)("span",{className:`inline-block w-4 text-center select-none font-bold ${n?"text-success":r?"text-error":"opacity-0"}`,children:n?"+":r?"-":" "}),(0,i.Y)("span",{className:"shiki",dangerouslySetInnerHTML:{__html:e.text&&l[t]||" "}})]})]},t)})})})})}function N(e){let{rows:t,language:n}=e,a=(0,y.w)(),l=(0,r.Kr)(()=>{let e=Array(t.length).fill(""),i=Array(t.length).fill(""),r=-1,a=a=>{if(r<0)return;let l=t.slice(r,a),o=(0,s.O9)(l.map(e=>e.left?.text??"").join("\n"),n),c=(0,s.O9)(l.map(e=>e.right?.text??"").join("\n"),n);for(let t=r;t<a;t++)e[t]=o[t-r]??"",i[t]=c[t-r]??"";r=-1};return t.forEach((e,t)=>{e.isMeta?a(t):r<0&&(r=t)}),a(t.length),{left:e,right:i}},[t,n,a]);return 0===t.length?(0,i.Y)("div",{className:"flex-1 flex items-center justify-center text-ink/40 font-mono text-xs p-8",children:"No differences between working file and target."}):(0,i.Y)("div",{className:"w-full h-full overflow-auto font-mono text-xs select-text bg-paper text-ink code-surface",children:(0,i.FD)("div",{className:"w-max min-w-full min-w-[700px]",children:[(0,i.FD)("div",{className:"grid grid-cols-2 sticky top-0 z-10 bg-canvas border-b border-ink/10 text-[11px] text-ink/70 font-sans select-none shadow-xs",children:[(0,i.Y)("div",{className:"px-3 py-1 font-medium border-r border-ink/10 flex items-center justify-between",children:(0,i.Y)("span",{children:"Original (HEAD / Base)"})}),(0,i.Y)("div",{className:"px-3 py-1 font-medium flex items-center justify-between",children:(0,i.Y)("span",{children:"Modified (Working Tree)"})})]}),(0,i.Y)("table",{className:"w-full border-collapse",children:(0,i.Y)("tbody",{children:t.map((e,t)=>{if(e.isMeta)return(0,i.Y)("tr",{className:"bg-canvas border-y border-ink/10 text-meta select-none",children:(0,i.Y)("td",{colSpan:4,className:"py-1 px-3 text-[11px] font-semibold text-meta text-center font-mono",children:e.metaText})},t);let n=e.left,r=e.right,a=n?.type==="del",s=r?.type==="add";return(0,i.FD)("tr",{className:"border-b border-ink/[0.04]",children:[(0,i.Y)("td",{className:`w-12 py-0.5 px-2 text-right text-[10px] select-none border-r border-ink/10 font-mono ${a?"bg-error/15 text-error font-semibold":n?"bg-canvas/50 text-ink/40":"bg-canvas/80 text-transparent"}`,children:n?.lineNumber||""}),(0,i.Y)("td",{className:`min-w-[320px] py-0.5 px-2 whitespace-pre border-r border-ink/10 text-ink ${a?"bg-error/10":n?"hover:bg-ink/[0.02]":"bg-canvas/40 select-none"}`,children:n?(0,i.FD)(i.FK,{children:[(0,i.Y)("span",{className:`inline-block w-4 text-center select-none font-bold ${a?"text-error":"opacity-0"}`,children:a?"-":" "}),(0,i.Y)("span",{className:"shiki",dangerouslySetInnerHTML:{__html:n.text&&l.left[t]||" "}})]}):(0,i.Y)("span",{className:"opacity-0",children:" "})}),(0,i.Y)("td",{className:`w-12 py-0.5 px-2 text-right text-[10px] select-none border-r border-ink/10 font-mono ${s?"bg-success/15 text-success font-semibold":r?"bg-canvas/50 text-ink/40":"bg-canvas/80 text-transparent"}`,children:r?.lineNumber||""}),(0,i.Y)("td",{className:`min-w-[320px] py-0.5 px-2 whitespace-pre text-ink ${s?"bg-success/10":r?"hover:bg-ink/[0.02]":"bg-canvas/40 select-none"}`,children:r?(0,i.FD)(i.FK,{children:[(0,i.Y)("span",{className:`inline-block w-4 text-center select-none font-bold ${s?"text-success":"opacity-0"}`,children:s?"+":" "}),(0,i.Y)("span",{className:"shiki",dangerouslySetInnerHTML:{__html:r.text&&l.right[t]||" "}})]}):(0,i.Y)("span",{className:"opacity-0",children:" "})})]},t)})})})]})})}var Y=n("p");function D(e){let{filePath:t,status:n="M",isStaged:o=!1,root:c,repo:d=".",onOpenInEditor:u,onFileSaved:m,className:h=""}=e,[b,f]=(0,l.LO)("diff.viewMode","unified"),[x,g]=(0,l.LO)("diff.ignoreWhitespace",!1),[v,y]=(0,r.J0)(""),[D,A]=(0,r.J0)(n),[F,C]=(0,r.J0)(o),[S,T]=(0,r.J0)(!0),[M,z]=(0,r.J0)(null),[P,L]=(0,r.J0)(!1),[j,R]=(0,r.J0)(!1),I=(0,a.L)(),E=(0,r.hb)(async()=>{if(t){T(!0),z(null);try{let e=new URLSearchParams({fileDiff:"1",file:t,staged:F?"1":"0",repo:d||"."});(n||D)&&e.set("status",n||D),c&&e.set("root",c);let i=await fetch(`/api/fs/git?${e.toString()}`),r=await i.json();r.success?(y(r.diff||""),r.status&&A(r.status)):z(r.error||"Failed to load file diff")}catch(e){z(e.message||"Error fetching diff")}finally{T(!1)}}},[t,F,d,c]);(0,r.vJ)(()=>{A(n),C(o)},[n,o,t]),(0,r.vJ)(()=>{E()},[E]);let $=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[],i=[],r=0,a=0;if(!e||!e.trim())return{lines:n,splitRows:i,additions:r,deletions:a};let l=e.split(/\r?\n/),s=l.some(e=>e.startsWith("@@"))?l:[`@@ -1,${l.length} +1,${l.length} @@`,...l],o=1,c=1,d=[],p=[],u=()=>{let e=Math.max(d.length,p.length);for(let t=0;t<e;t++)i.push({left:d[t]?{type:"del",text:d[t].text,lineNumber:d[t].lineNumber}:void 0,right:p[t]?{type:"add",text:p[t].text,lineNumber:p[t].lineNumber}:void 0});d=[],p=[]};for(let e of s)if(!(e.startsWith("diff --git")||e.startsWith("index ")||e.startsWith("---")||e.startsWith("+++")||e.startsWith("new file mode")||e.startsWith("deleted file mode")||e.startsWith("similarity index")||e.startsWith("old mode")||e.startsWith("new mode")||e.startsWith("\\ No newline"))){if(e.startsWith("@@")){u();let t=e.match(/@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/);t&&(o=parseInt(t[1],10),c=parseInt(t[2],10)),n.push({type:"meta",text:e}),i.push({isMeta:!0,metaText:e});continue}if(e.startsWith("+")){let i=e.slice(1),a=t?i.trim():i;r++,n.push({type:"add",text:a,newLineNumber:c}),p.push({text:a,lineNumber:c}),c++}else if(e.startsWith("-")){let i=e.slice(1),r=t?i.trim():i;a++,n.push({type:"del",text:r,oldLineNumber:o}),d.push({text:r,lineNumber:o}),o++}else{u();let r=e.startsWith(" ")?e.slice(1):e,a=t?r.trim():r;n.push({type:"context",text:a,oldLineNumber:o,newLineNumber:c}),i.push({left:{type:"context",text:a,lineNumber:o},right:{type:"context",text:a,lineNumber:c}}),o++,c++}}return u(),{lines:n,splitRows:i,additions:r,deletions:a}}(v,x),O=(0,s.sQ)(t);return(0,i.FD)("div",{className:`flex flex-col h-full bg-paper select-text relative font-sans ${h}`,children:[(0,i.Y)(k,{filePath:t,status:D,isStaged:F,viewMode:b,ignoreWhitespace:x,additions:$.additions,deletions:$.deletions,isLoading:S,isCopied:P,onToggleViewMode:()=>{f("unified"===b?"split":"unified")},onToggleWhitespace:()=>{g(!x)},onStageUnstage:()=>{let e=F?"unstage":"stage",n=new FormData;n.set("actionType",e),n.set("file",t),n.set("repo",d||"."),c&&n.set("root",c),I.submit(n,{method:"POST",action:"/api/fs/git"}),C(!F),setTimeout(()=>{E(),m?.()},300)},onDiscard:()=>{R(!0)},onOpenInEditor:u,onRefresh:E,onCopyDiff:()=>{v&&(navigator.clipboard.writeText(v),L(!0),setTimeout(()=>L(!1),2e3))}}),(0,i.Y)("div",{className:"flex-1 overflow-hidden relative flex flex-col bg-paper",children:S?(0,i.FD)("div",{className:"flex-1 flex items-center justify-center space-x-2 text-ink/50 text-xs font-mono",children:[(0,i.Y)(p.A,{size:14,className:"animate-spin"}),(0,i.Y)("span",{children:"Loading file diff..."})]}):M?(0,i.FD)("div",{className:"flex-1 flex flex-col items-center justify-center p-6 text-center space-y-2",children:[(0,i.Y)(Y.A,{size:20,className:"text-error"}),(0,i.Y)("p",{className:"text-xs text-error font-medium",children:M}),(0,i.Y)("button",{onClick:E,className:"px-3 py-1 text-xs bg-ink/10 hover:bg-ink/15 text-ink rounded font-sans transition-colors",children:"Retry"})]}):"split"===b?(0,i.Y)(N,{rows:$.splitRows,language:O}):(0,i.Y)(w,{lines:$.lines,language:O})}),j&&(0,i.Y)("div",{className:"fixed inset-0 bg-ink/20 z-50 flex items-center justify-center p-4 backdrop-blur-xs",children:(0,i.FD)("div",{className:"bg-paper rounded-lg shadow-xl p-4 w-full max-w-sm border border-ink/15",children:[(0,i.Y)("h3",{className:"font-semibold text-ink mb-1.5 text-sm",children:"Discard Changes?"}),(0,i.FD)("p",{className:"text-xs text-ink/70 mb-4",children:["Are you sure you want to discard all unstaged changes in ",(0,i.Y)("span",{className:"font-mono font-medium text-ink",children:t}),"? This cannot be undone."]}),(0,i.FD)("div",{className:"flex justify-end space-x-2",children:[(0,i.Y)("button",{type:"button",onClick:()=>R(!1),className:"px-3 py-1.5 text-xs text-ink hover:bg-ink/5 rounded transition-colors",children:"Cancel"}),(0,i.Y)("button",{type:"button",onClick:()=>{R(!1);let e=new FormData;e.set("actionType","discard"),e.set("file",t),e.set("repo",d||"."),c&&e.set("root",c),I.submit(e,{method:"POST",action:"/api/fs/git"}),setTimeout(()=>{E(),m?.()},300)},className:"px-3 py-1.5 text-xs bg-error text-white rounded hover:bg-error/90 font-medium transition-colors",children:"Discard Changes"})]})]})})]})}},XY(e,t,n){var i=n("H"),r=n("qg");function a(e){return String(e.id??e.path??e.name)}function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{fallback:n,reportLoadError:l=!1,flushOnUnmount:s=!1,reportSaveError:o=!1,downloadMimeType:c="text/plain",onFileSaved:d}=t,[p,u]=(0,i.J0)({}),[m,h]=(0,i.J0)({}),[b,f]=(0,i.J0)(!1),[x,g]=(0,i.J0)(null),[v,k]=(0,i.J0)("idle"),[y,w]=(0,i.J0)(!1),N=e?a(e):"",Y=e?p[N]??e.content??"":"",D=Y!==(m[N]??Y),A=(0,i.li)(new Set),F=(0,i.li)(null),C=(0,i.hb)((e,t)=>{u(n=>({...n,[e]:t})),h(n=>({...n,[e]:t}))},[]),S=(0,i.hb)(async(e,t)=>{if(!e.path)return;k("saving");let n=new FormData;n.append("actionType","save"),n.append("path",e.path),n.append("content",t),e.root&&n.append("root",e.root),e.repo&&"."!==e.repo&&n.append("repo",e.repo);try{let i=await fetch("/api/fs/action",{method:"POST",body:n}),r=await i.json().catch(()=>null);i.ok&&r?.success?(k("saved"),h(n=>({...n,[a(e)]:t})),d?.()):k(o?"error":"idle")}catch{k(o?"error":"idle")}},[d,o]),T=(0,i.li)(S);T.current=S,(0,i.vJ)(()=>{if(!e)return;let t=a(e);if(A.current.has(t))return;if(A.current.add(t),void 0!==e.content){C(t,e.content),g(null);return}if(!e.path)return l?void g("No file path supplied for this attachment."):void C(t,n?n(e.name):"");let i=!1;f(!0),g(null);let r=new URLSearchParams({path:e.path});return e.root&&r.set("root",e.root),e.repo&&"."!==e.repo&&r.set("repo",e.repo),fetch(`/api/fs/read?${r.toString()}`).then(async e=>{let t=await e.json().catch(()=>null);if(l){if(!e.ok||!t||"string"!=typeof t.content)throw Error(t?.error||`HTTP ${e.status}`);return t.content}return"string"==typeof t?.content?t.content:null}).then(r=>{i||C(t,r??(n?n(e.name):""))}).catch(r=>{i||(l?(C(t,""),g(r instanceof Error?r.message:"Failed to read file")):C(t,n?n(e.name):""))}).finally(()=>{i||f(!1)}),()=>{i=!0}},[N,e,n,l,C]),(0,i.vJ)(()=>{if("saved"!==v)return;let e=window.setTimeout(()=>k("idle"),1500);return()=>window.clearTimeout(e)},[v]);let M=(0,i.hb)(t=>{if(!e)return;let n=a(e);if(u(e=>({...e,[n]:t})),!e.path)return;F.current&&window.clearTimeout(F.current.timer);let i=window.setTimeout(()=>{F.current=null,T.current(e,t)},800);F.current={timer:i,file:e,content:t}},[e]),z=(0,i.hb)(()=>{if(!e)return;let t=p[a(e)];void 0!==t&&(F.current&&(window.clearTimeout(F.current.timer),F.current=null),T.current(e,t))},[e,p]),P=(0,i.hb)(()=>{e&&navigator.clipboard&&navigator.clipboard.writeText(p[a(e)]??"").then(()=>{w(!0),window.setTimeout(()=>w(!1),1500)}).catch(()=>{})},[e,p]),L=(0,i.hb)(()=>{if(!e)return;let t=new Blob([p[a(e)]??""],{type:c}),n=URL.createObjectURL(t),i=document.createElement("a");i.href=n,i.download=e.name,i.click(),URL.revokeObjectURL(n)},[e,p,c]),j=(0,i.hb)(()=>{N&&(A.current.delete(N),u(e=>{if(void 0===e[N])return e;let t={...e};return delete t[N],t}))},[N]),R=(0,i.hb)(()=>{A.current.clear(),u({}),h({})},[]),I=(0,i.hb)(e=>{let t=new Set(e.map(String));for(let e of Array.from(A.current))t.has(e)||A.current.delete(e);u(e=>{let n=Object.keys(e);if(n.every(e=>t.has(e)))return e;let i={};for(let r of n)t.has(r)&&(i[r]=e[r]);return i})},[]);return(0,i.vJ)(()=>{if(s)return()=>{let e=F.current;e&&(window.clearTimeout(e.timer),F.current=null,T.current(e.file,e.content))}},[s]),{content:Y,onChange:M,isLoading:b,loadError:x,saveStatus:v,copied:y,isDirty:D,language:e?(0,r.sQ)(e.name):"javascript",saveNow:z,copy:P,download:L,reload:j,reset:R,retain:I}}n.d(t,{n:()=>l})},C7(e,t,n){var i=n("H"),r=n("So");function a(){return(0,i.hb)(e=>{(0,r.l1)(e)},[])}n.d(t,{g:()=>a})},uY(e,t,n){var i=n("H");function r(){let[e,t]=(0,i.J0)(null),[n,r]=(0,i.J0)(!0),[a,l]=(0,i.J0)(null),s=(0,i.hb)(async e=>{e?.silent||r(!0),l(null);try{let e=await fetch("/api/settings/usage");if(!e.ok)throw Error(`Usage request failed (${e.status})`);let n=await e.json();t(n)}catch(e){l(e instanceof Error?e.message:"Failed to load provider usage")}finally{e?.silent||r(!1)}},[]);return(0,i.vJ)(()=>{s()},[s]),{report:e,isLoading:n,error:a,reload:s}}n.d(t,{N:()=>r})},pH(e,t,n){async function i(e){if(!e)return!1;try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0}catch(e){}try{let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.left="-999999px",t.style.top="-999999px",t.setAttribute("readonly",""),document.body.appendChild(t),t.focus(),t.select();let n=document.execCommand("copy");return document.body.removeChild(t),n}catch(e){return console.error("Failed to copy text: ",e),!1}}n.d(t,{l:()=>i})},oj(e,t,n){var i=n("H");function r(e,t){(0,i.vJ)(()=>{let n=n=>{!e.current||e.current.contains(n.target)||t(n)};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)}},[e,t])}n.d(t,{W:()=>r})},jo(e,t,n){var i=n("H");function r(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:600,[t,n]=(0,i.J0)(!1),r=(0,i.li)(null),a=(0,i.hb)(()=>{n(!0),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>n(!1),e)},[e]);return(0,i.vJ)(()=>()=>{r.current&&clearTimeout(r.current)},[]),{isScrolling:t,handleScroll:a}}function a(e){return e?"scrollbar-overlay-scrolling":"scrollbar-overlay"}n.d(t,{K:()=>r,p:()=>a})},Po(e,t,n){var i=n("H"),r=n("zF");function a(){let[e,t]=(0,i.J0)(()=>(0,r.nv)());return(0,i.vJ)(()=>(0,r.Eu)(()=>t(!0)),[]),e}n.d(t,{w:()=>a})},oZ(e,t,n){var i=n("H");function r(){let[e,t]=(0,i.J0)([]),n=(0,i.li)(0);return{toasts:e,pushToast:function(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"error",r=arguments.length>2?arguments[2]:void 0;n.current+=1,t(t=>[...t,{id:n.current,message:e,type:i,...r}])},dismissToast:e=>{t(t=>t.filter(t=>t.id!==e))}}}n.d(t,{Y:()=>r})},cP(e,t,n){var i=n("H");function r(e,t){let{enabled:n,intervalMs:r,guardInFlight:a=!1}=t,l=(0,i.li)(e);l.current=e,(0,i.vJ)(()=>{if(!n||r<=0)return;let e="u"<typeof document||"visible"===document.visibilityState,t=!1,i=()=>{if(!a)return void l.current();if(t)return;let e=l.current();if(!e||"function"!=typeof e.then)return;t=!0;let n=()=>{t=!1};Promise.resolve(e).then(n,n)},s=setInterval(()=>{e&&i()},r),o=()=>{let t="visible"===document.visibilityState;t&&!e&&i(),e=t};return document.addEventListener("visibilitychange",o),()=>{clearInterval(s),document.removeEventListener("visibilitychange",o)}},[n,r,a])}n.d(t,{t:()=>r})},NO(e,t,n){var i=n("H");function r(e,t,n,r){let a=(0,i.li)(n);a.current=n,(0,i.vJ)(()=>{let n=e=>a.current(e);return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)},[e,t,r])}function a(e,t,n){r(window,e,t,n)}function l(e,t,n){r(document,e,t,n)}function s(e,t,n){r(window,e,t,n)}n.d(t,{MN:()=>a,sY:()=>s,zo:()=>l})},so(e,t,n){var i=n("H"),r=n("LQ"),a=n("cP"),l=n("NO");function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:".",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=!(arguments.length>3)||void 0===arguments[3]||arguments[3],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,[c,d]=(0,i.J0)([]),[p,u]=(0,i.J0)(!1),m=(0,i.hb)(()=>{if(!s)return;u(!0);let n=new URLSearchParams;e&&n.set("root",e),t&&"."!==t&&n.set("repo",t),n.set("t",String(Date.now())),fetch(`/api/fs/git?${n.toString()}`).then(e=>e.json()).then(e=>{Array.isArray(e.changes)?d(e.changes):d([])}).catch(()=>d([])).finally(()=>u(!1))},[s,e,t]);(0,i.vJ)(()=>{m()},[m,n]),(0,a.t)(m,{enabled:s,intervalMs:o}),(0,l.MN)("focus",()=>{s&&m()}),(0,l.zo)("visibilitychange",()=>{s&&m()});let h=(0,i.li)(void 0),b=(0,i.hb)(()=>{s&&void 0===h.current&&(h.current=setTimeout(()=>{h.current=void 0,m()},1e3))},[s,m]);(0,i.vJ)(()=>()=>{void 0!==h.current&&clearTimeout(h.current)},[]),(0,l.sY)("omp:session-updated",b),(0,l.sY)("omp:workspace-updated",b);let{fileMap:f,folderMap:x}=(0,i.Kr)(()=>(0,r._)(c),[c]);return{changes:c,fileMap:f,folderMap:x,isLoading:p,refreshGitStatus:m}}n.d(t,{e:()=>s})},Af(e,t,n){var i=n("H"),r=n("Kc"),a=n("cP");function l(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e3;(0,a.t)(e,{enabled:t,intervalMs:n,guardInFlight:!0})}function s(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:500,a=(0,i.li)(e);a.current=e,(0,i.vJ)(()=>{let e;if(!t)return;let i=()=>{clearTimeout(e),e=window.setTimeout(()=>{e=void 0,("u"<typeof document||"visible"===document.visibilityState)&&a.current()},n)};return window.addEventListener(r.s,i),()=>{window.removeEventListener(r.s,i),clearTimeout(e)}},[t,n])}n.d(t,{n:()=>l,w:()=>s})},As(e,t,n){var i=n("H");let r=(0,n("G").q6)(null);function a(){let e=(0,i.NT)(r);if(!e)throw Error("useSessionState used outside SessionStateProvider");return e}n.d(t,{O:()=>a},{b:r})},FL(e,t,n){var i=n("H"),r=n("SS"),a=n("As");function l(e,t){let{sessionId:n,ready:l}=(0,a.O)(),s=(0,r.WV)(n,e),[o,c]=(0,i.J0)(void 0===s?t:s),d=(0,i.li)(n);(0,i.vJ)(()=>{if(d.current!==n&&(d.current=n),!l)return;let i=(0,r.WV)(n,e);c(void 0===i?t:i)},[n,l,e]);let p=t=>{let i="function"==typeof t?t((0,r.WV)(n,e)??o):t;c(i),(0,r.qI)(n,e,i)};return l||void 0===s||s===o?[o,p,l]:[s,p,l]}function s(){let{sessionId:e,ready:t}=(0,a.O)();return{sessionId:e,ready:t,read:(t,n)=>{let i=(0,r.WV)(e,t);return void 0===i?n:i},hydrate:t=>(0,r.E9)(e,t)}}n.d(t,{bL:()=>l,p0:()=>s},{LO:l})},Xk(e,t,n){var i=n("H");async function r(e){let t=await e.text();if(t)try{return JSON.parse(t)}catch{return}}function a(){let[e,t]=(0,i.J0)(void 0),[n,a]=(0,i.J0)("idle"),l=(0,i.li)(!0),s=(0,i.li)(null);(0,i.vJ)(()=>(l.current=!0,()=>{l.current=!1,s.current?.abort(),s.current=null}),[]);let o=(0,i.hb)(async(e,n,i)=>{s.current?.abort();let o=new AbortController;s.current=o,a(i);try{let i=await fetch(e,{...n,signal:o.signal}),a=await r(i);l.current&&s.current===o&&t(a)}catch{}finally{l.current&&s.current===o&&(s.current=null,a("idle"))}},[]);return{data:e,state:n,load:(0,i.hb)(e=>o(e,{method:"GET"},"loading"),[o]),submit:(0,i.hb)((e,t)=>o(t.action,{method:(t.method??"POST").toUpperCase(),body:function(e){if(e instanceof FormData)return e;let t=new URLSearchParams;for(let[n,i]of Object.entries(e))null!=i&&t.set(n,String(i));return t}(e),headers:e instanceof FormData?void 0:{"content-type":"application/x-www-form-urlencoded"}},"submitting"),[o])}}n.d(t,{L:()=>a})},s(e,t,n){var i=n("G");let r=new Set,a="u"<typeof window?"":window.location.search;function l(){for(let e of r)e()}function s(e){return r.add(e),()=>r.delete(e)}function o(e){if("string"==typeof e)return e.startsWith("?")?e:`?${e}`;if(e instanceof URLSearchParams)return e.toString()?`?${e.toString()}`:"";let t=new URLSearchParams;for(let[n,i]of Object.entries(e))null!=i&&t.set(n,String(i));return t.toString()?`?${t.toString()}`:""}function c(){return a}function d(){let e=(0,i.rz)(s,c),t=(0,i.hb)((e,t)=>{var n;let i=(n=new URLSearchParams(a),"function"==typeof e?o(e(new URLSearchParams(n))):o(e)),r=`${window.location.pathname}${i}${window.location.hash}`;t?.replace?window.history.replaceState(null,"",r):window.history.pushState(null,"",r),a=i,l()},[]);return[new URLSearchParams(e),t]}"u">typeof window&&window.addEventListener("popstate",function(){let e="u"<typeof window?"":window.location.search;e!==a&&(a=e,l())}),n.d(t,{o:()=>d})},b(e,t,n){var i=n("j"),r=n("v"),a=n("H"),l=n("s"),s=n("G");let o=(0,s.q6)(null);function c(e,t,n){return Math.min(Math.max(e,t),n)}function d(e,t){return"number"==typeof e?e:"string"==typeof e&&parseFloat(e)||t}function p(e){let{orientation:t,id:n,groupRef:r,onLayoutChanged:l,className:d,children:p}=e,u=(0,a.li)(new Map),m=(0,a.li)(l??null);m.current=l??null;let h=(0,s.Kr)(()=>({orientation:t,panels:u,onLayoutChanged:m}),[t]);return(0,s.vJ)(()=>{if(r)return r.current={setLayout:e=>{for(let[t,n]of Object.entries(e)){let e=u.current.get(t);e&&!e.isFiller&&"number"==typeof n&&e.setSize(c(n,e.minSize,e.maxSize))}m.current?.((()=>{let e={};for(let[t,n]of u.current){let i=n.getSize();null!=i&&(e[t]=i)}return e})(),{isUserInteraction:!1})}},()=>{r.current=null}},[r]),(0,i.Y)(o.Provider,{value:h,children:(0,i.Y)("div",{"data-panel-group":"","data-panel-group-id":n,className:d,style:{display:"flex",flex:"1 1 0%",flexDirection:"horizontal"===t?"row":"column",minWidth:0,minHeight:0},children:p})})}function u(e){let{id:t,panelRef:n,defaultSize:r,minSize:a=0,maxSize:l,filler:p=!1,className:u,style:m,children:h}=e,b=(0,s.NT)(o);if(!b)throw Error(`<Panel id="${t}"> must be rendered inside a <Group>`);let{orientation:f,panels:x}=b,g=d(a,0),v=null!=l?d(l,Number.MAX_SAFE_INTEGER):Number.MAX_SAFE_INTEGER,k=(0,s.li)(null),[y,w]=(0,s.J0)(()=>p?null:c(d(r,g),g,v)),N=(0,s.li)(y);N.current=y,(0,s.vJ)(()=>(x.current.set(t,{id:t,isFiller:p,minSize:g,maxSize:v,setSize:e=>w(e),getSize:()=>N.current}),()=>{x.current.delete(t)}),[t]),(0,s.vJ)(()=>{let e=x.current.get(t);e&&(e.minSize=g,e.maxSize=v)}),(0,s.vJ)(()=>{if(n)return n.current={resize:e=>{w(c(e,g,v))},getSize:()=>{let e=N.current;return null!=e?{inPixels:e}:null}},()=>{n.current=null}},[n,g,v]);let Y=p?{flex:"1 1 0%",minWidth:0,minHeight:0,overflow:"hidden",position:"relative"}:{flex:"0 1 auto",width:"horizontal"===f?y??void 0:void 0,height:"horizontal"===f?void 0:y??void 0,minWidth:"horizontal"===f?g:void 0,minHeight:"horizontal"===f?void 0:g,maxWidth:null!=l?v:void 0,overflow:"hidden",position:"relative"};return(0,i.Y)("div",{ref:k,"data-panel":"","data-panel-id":t,className:u,style:{...Y,...m},children:h})}function m(e){let{className:t,style:n,children:r}=e,a=(0,s.NT)(o),[l,d]=(0,s.J0)(!1),p=(0,s.li)(null),u=(0,s.li)(null);if((0,s.vJ)(()=>()=>u.current?.(),[]),!a)throw Error("<Separator> must be rendered inside a <Group>");let{orientation:m,panels:h,onLayoutChanged:b}=a;return(0,i.FD)(i.FK,{children:[(0,i.Y)("div",{ref:p,"data-separator":"",role:"separator","aria-orientation":"horizontal"===m?"vertical":"horizontal",className:t,style:n,onPointerDown:e=>{let t=p.current;if(!t||0!==e.button)return;let n=t.previousElementSibling,i=t.nextElementSibling,r=n?.getAttribute("data-panel-id"),a=i?.getAttribute("data-panel-id"),l=r?h.current.get(r):void 0,s=a?h.current.get(a):void 0;if(!l||!s||!n||!i)return;e.preventDefault(),d(!0);let o="horizontal"===m?e.clientX:e.clientY,f=e=>"horizontal"===m?e.getBoundingClientRect().width:e.getBoundingClientRect().height,x=l.getSize()??f(n),g=s.getSize()??f(i),v=e=>{var t,n;let i="horizontal"===m?e.clientX:e.clientY,r=(t={size:x,min:l.minSize,max:l.maxSize},n={size:g,min:s.minSize,max:s.maxSize},c(i-o,Math.max(t.min-t.size,n.min-n.size),Math.min(t.max-t.size,n.size-n.min)));l.setSize(c(x+r,l.minSize,l.maxSize)),s.isFiller||s.setSize(c(g-r,s.minSize,s.maxSize))},k=()=>{window.removeEventListener("pointermove",v),window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",y),u.current=null,d(!1);let e={};for(let[t,n]of h.current){let i=n.getSize();null!=i&&(e[t]=i)}b.current?.(e,{isUserInteraction:!0})},y=()=>k();window.addEventListener("pointermove",v),window.addEventListener("pointerup",y),window.addEventListener("pointercancel",y),u.current=k},onDragStart:e=>e.preventDefault(),children:r}),l&&(0,i.Y)("div",{style:{position:"fixed",inset:0,zIndex:9999,cursor:"horizontal"===m?"col-resize":"row-resize"}})]})}var h=n("S"),b=n("w"),f=n("Y"),x=n("o"),g=n("r"),v=n("l"),k=n("C"),y=n("W"),w=n("N"),N=n("YL"),Y=n("q"),D=n("z"),A=n("So"),F=n("C7"),C=n("NO"),S=n("HJ"),T=n("qn"),M=n("s0"),z=n("SJ"),P=n("k"),L=n("K"),j=n("u"),R=n("Np"),I=n("lW"),E=n("n"),$=n("C7P"),O=n("O"),J=n("YO"),_=n("t"),U=n("nV");let K=[{id:"appearance",label:"Appearance",icon:S.A,section:"OMPCHAMBER",description:"Custom themes, typography scale, and layout density."},{id:"chats",label:"Chats",icon:T.A,section:"OMPCHAMBER",description:"Message streaming, thinking blocks, and tool view modes."},{id:"notifications",label:"Notifications",icon:M.A,section:"OMPCHAMBER",description:"Build failure alerts, sounds, and system popups."},{id:"usage",label:"Usage",icon:z.A,section:"OMPCHAMBER",description:"Build minutes quota, storage, and general usage."},{id:"token-usage",label:"Token Usage",icon:P.A,section:"OMPCHAMBER",description:"Token telemetry, cache, and cost breakdown."},{id:"projects",label:"Projects",icon:L.A,section:"WORKSPACE",description:"Workspace directories, roots, and ignored paths."},{id:"omp",label:"OMP Engine",icon:j.A,section:"OMP",description:"Live agent state and native omp config keys."},{id:"providers",label:"Providers",icon:R.A,section:"OMP",description:"AI model engines, endpoints, and credentials."},{id:"agents",label:"Agents",icon:I.A,section:"OMP",description:"Autonomous agent persona, self-healing, and reasoning."},{id:"behavior",label:"Behavior",icon:E.A,section:"OMP",description:"Native AGENTS.md and RULES.md — global instructions, permission gates, and safety filters."},{id:"commands",label:"Commands",icon:w.A,section:"OMP",description:"Slash command macros and terminal shortcuts."},{id:"mcp",label:"MCP",icon:$.A,section:"OMP",description:"Model Context Protocol servers and dynamic tools."},{id:"skills",label:"Skills",icon:O.A,section:"LIBRARY",description:"Manage downloaded skills and scripts."},{id:"skills-catalog",label:"Skills Catalog",icon:J.A,section:"LIBRARY",description:"Browse and install new skills."}];function B(e){let{activeCategory:t,onSelectCategory:n,searchQuery:r,onSearchChange:a,onReloadOmpEngine:l,isReloading:s,className:o=""}=e,c=K.filter(e=>{if(!r.trim())return!0;let t=r.toLowerCase();return e.label.toLowerCase().includes(t)||e.section.toLowerCase().includes(t)||e.description.toLowerCase().includes(t)});return(0,i.FD)("div",{className:`flex flex-col h-full bg-canvas border-r border-ink/10 text-ink select-none ${o}`,children:[(0,i.Y)("div",{className:"p-3 border-b border-ink/10 flex-shrink-0",children:(0,i.FD)("div",{className:"relative flex items-center",children:[(0,i.Y)(_.A,{size:14,className:"absolute left-2.5 text-ink/40 pointer-events-none"}),(0,i.Y)("input",{type:"text",placeholder:"Search settings",value:r,onChange:e=>a(e.currentTarget.value),className:"w-full bg-paper border border-ink/15 rounded-lg pl-8 pr-7 py-1.5 text-xs text-ink placeholder-ink/40 focus:outline-none focus:border-ink/40 transition-colors"}),r&&(0,i.Y)("button",{type:"button",onClick:()=>a(""),className:"absolute right-2 text-ink/40 hover:text-ink p-0.5",children:(0,i.Y)(h.A,{size:12})})]})}),(0,i.Y)("div",{className:"flex-1 scrollbar-overlay-container scrollbar-overlay-static p-2 space-y-4",children:0===c.length?(0,i.Y)("div",{className:"text-center py-8 text-xs text-ink/50 italic",children:"No matching settings found"}):["OMPCHAMBER","WORKSPACE","OMP","LIBRARY"].map(e=>{let r=c.filter(t=>t.section===e);return 0===r.length?null:(0,i.FD)("div",{className:"space-y-1",children:[(0,i.Y)("div",{className:"px-2.5 py-1 text-[10px] font-bold text-ink/40 tracking-wider font-mono uppercase",children:e}),(0,i.Y)("div",{className:"space-y-0.5",children:r.map(e=>{let r=e.icon,a=t===e.id;return(0,i.FD)("button",{type:"button",onClick:()=>n(e.id),className:`w-full flex items-center justify-between px-2.5 py-1.5 rounded-lg text-xs transition-all text-left ${a?"bg-ink/10 font-semibold text-ink shadow-2xs":"text-ink/75 hover:bg-ink/5 hover:text-ink"}`,children:[(0,i.FD)("div",{className:"flex items-center space-x-2.5 truncate",children:[(0,i.Y)(r,{size:14,className:a?"text-ink":"text-ink/60"}),(0,i.Y)("span",{className:"truncate",children:e.label})]}),e.badge&&(0,i.Y)("span",{className:"px-1.5 py-0.2 text-[9px] font-mono font-medium rounded bg-amber-500/15 text-amber-900 border border-amber-500/20",children:e.badge})]},e.id)})})]},e)})}),(0,i.Y)("div",{className:"p-2 border-t border-ink/10 flex-shrink-0 bg-canvas",children:(0,i.FD)("button",{type:"button",onClick:l,disabled:s,className:"w-full flex items-center space-x-2 px-2.5 py-1.5 text-xs text-ink/75 hover:text-ink hover:bg-ink/5 rounded-lg transition-colors font-medium cursor-pointer",children:[(0,i.Y)(U.A,{size:13,className:`${s?"animate-spin text-warning":"text-ink/60"}`}),(0,i.Y)("span",{children:s?"Reloading OMP Engine...":"Reload OMP Engine"})]})})]})}var W=n("yO"),H=n("T");function q(e){let{settings:t,onUpdate:n}=e,r=[{id:"paper",name:"E-Ink Paper",desc:"Tema terang bawaan E-Ink Monochrome.",icon:W.A},{id:"one-dark-pro-soft",name:"One Dark Pro Soft",desc:"Tema gelap ala One Dark Pro.",icon:H.A}];return(0,i.Y)("div",{className:"w-full space-y-8 text-xs text-ink",children:(0,i.FD)("section",{className:"space-y-4",children:[(0,i.FD)("div",{className:"flex items-center space-x-2 border-b border-ink/10 pb-2",children:[(0,i.Y)(S.A,{size:16,className:"text-ink/60"}),(0,i.Y)("h3",{className:"font-semibold text-sm uppercase tracking-wider text-ink/80",children:"Theme Preferences"})]}),(0,i.Y)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:r.map(e=>(0,i.FD)("button",{onClick:()=>n({theme:e.id}),className:`flex items-start space-x-3 p-3 rounded-lg border text-left transition-all ${t.theme===e.id?"border-ink bg-ink/5 ring-1 ring-ink/20":"border-ink/20 bg-paper hover:border-ink/40 hover:bg-ink/5"}`,children:[(0,i.Y)("div",{className:`p-1.5 rounded-full ${t.theme===e.id?"bg-ink text-paper":"bg-canvas text-ink/60"}`,children:(0,i.Y)(e.icon,{size:16})}),(0,i.FD)("div",{className:"flex-1",children:[(0,i.Y)("div",{className:"font-semibold text-ink",children:e.name}),(0,i.Y)("div",{className:"text-ink/60 mt-0.5 leading-relaxed",children:e.desc})]}),t.theme===e.id&&(0,i.Y)(D.A,{size:16,className:"text-ink mt-1"})]},e.id))})]})})}var G=n("F"),V=n("g");function Q(e){let{settings:t,onUpdate:n}=e;return(0,i.FD)("section",{className:"space-y-3",children:[(0,i.FD)("div",{children:[(0,i.Y)("h4",{className:"text-sm font-semibold text-ink",children:"Follow-up Dispatch"}),(0,i.Y)("p",{className:"text-[11px] text-ink/60 mt-0.5",children:"Choose how new user prompts are handled while the AI agent is actively executing."})]}),(0,i.FD)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[(0,i.FD)("div",{onClick:()=>n({followUpBehavior:"queue"}),role:"button",tabIndex:0,onKeyDown:e=>"Enter"===e.key&&n({followUpBehavior:"queue"}),className:`p-3.5 rounded-lg border text-left transition-all cursor-pointer flex flex-col justify-between select-none ${"queue"===t.followUpBehavior?"border-ink bg-ink/5 ring-1 ring-ink/20 shadow-xs":"border-ink/15 bg-paper hover:border-ink/30 hover:bg-ink/[0.02]"}`,children:[(0,i.FD)("div",{children:[(0,i.FD)("div",{className:"flex items-center justify-between mb-2",children:[(0,i.FD)("div",{className:"flex items-center gap-2",children:[(0,i.Y)("div",{className:`w-7 h-7 rounded-md flex items-center justify-center ${"queue"===t.followUpBehavior?"bg-ink text-paper":"bg-ink/5 text-ink/70"}`,children:(0,i.Y)(G.A,{size:15})}),(0,i.Y)("span",{className:"font-semibold text-xs text-ink",children:"Queue Mode"})]}),(0,i.Y)("span",{className:"text-[10px] font-mono uppercase px-1.5 py-0.5 rounded bg-ink/10 text-ink/70 font-medium",children:"Sequential"})]}),(0,i.Y)("p",{className:"text-[11px] text-ink/65 leading-relaxed",children:"Messages wait in an execution queue and run in succession once current inference completes."})]}),(0,i.FD)("div",{className:"mt-3 pt-2.5 border-t border-ink/10 flex items-center justify-between text-[11px]",children:[(0,i.Y)("span",{className:"text-ink/50 text-[10px]",children:"Recommended for batch operations"}),(0,i.Y)("div",{className:`w-4 h-4 rounded-full border flex items-center justify-center ${"queue"===t.followUpBehavior?"border-ink bg-ink text-paper":"border-ink/30 bg-transparent"}`,children:"queue"===t.followUpBehavior&&(0,i.Y)(D.A,{size:10,strokeWidth:3})})]})]}),(0,i.FD)("div",{onClick:()=>n({followUpBehavior:"steering"}),role:"button",tabIndex:0,onKeyDown:e=>"Enter"===e.key&&n({followUpBehavior:"steering"}),className:`p-3.5 rounded-lg border text-left transition-all cursor-pointer flex flex-col justify-between select-none ${"steering"===t.followUpBehavior?"border-ink bg-ink/5 ring-1 ring-ink/20 shadow-xs":"border-ink/15 bg-paper hover:border-ink/30 hover:bg-ink/[0.02]"}`,children:[(0,i.FD)("div",{children:[(0,i.FD)("div",{className:"flex items-center justify-between mb-2",children:[(0,i.FD)("div",{className:"flex items-center gap-2",children:[(0,i.Y)("div",{className:`w-7 h-7 rounded-md flex items-center justify-center ${"steering"===t.followUpBehavior?"bg-ink text-paper":"bg-ink/5 text-ink/70"}`,children:(0,i.Y)(V.A,{size:15})}),(0,i.Y)("span",{className:"font-semibold text-xs text-ink",children:"Steering Mode"})]}),(0,i.Y)("span",{className:"text-[10px] font-mono uppercase px-1.5 py-0.5 rounded bg-ink/10 text-ink/70 font-medium",children:"Intervention"})]}),(0,i.Y)("p",{className:"text-[11px] text-ink/65 leading-relaxed",children:"Immediately redirects current agent trajectory and focuses runtime resources onto the new instruction."})]}),(0,i.FD)("div",{className:"mt-3 pt-2.5 border-t border-ink/10 flex items-center justify-between text-[11px]",children:[(0,i.Y)("span",{className:"text-ink/50 text-[10px]",children:"Recommended for active debugging"}),(0,i.Y)("div",{className:`w-4 h-4 rounded-full border flex items-center justify-center ${"steering"===t.followUpBehavior?"border-ink bg-ink text-paper":"border-ink/30 bg-transparent"}`,children:"steering"===t.followUpBehavior&&(0,i.Y)(D.A,{size:10,strokeWidth:3})})]})]})]})]})}var Z=n("D"),X=n("yh"),ee=n("S0");function et(e){let{settings:t,onUpdate:n}=e,r=["Enter","Shift + Enter","Ctrl / Cmd + Enter"],a=[{id:"keybindingSend",label:"Send Message",desc:"Submit prompt and initiate agent reasoning",icon:Z.A,value:t.keybindingSend||"Enter"},{id:"keybindingNewLine",label:"Line Break",desc:"Insert newline inside input box without dispatching",icon:X.A,value:t.keybindingNewLine||"Shift + Enter"},{id:"keybindingSteering",label:"Steering Intervention",desc:"Send prompt with steering interruption priority",icon:V.A,value:t.keybindingSteering||"Ctrl / Cmd + Enter"}];return(0,i.FD)("section",{className:"space-y-3",children:[(0,i.FD)("div",{className:"flex items-center justify-between",children:[(0,i.FD)("div",{className:"flex items-center gap-2",children:[(0,i.Y)(ee.A,{size:15,className:"text-ink/70"}),(0,i.Y)("h4",{className:"text-sm font-semibold text-ink",children:"Keyboard Shortcuts"})]}),(0,i.Y)("span",{className:"text-[10px] text-ink/50 font-mono",children:"Auto-conflict resolution"})]}),(0,i.Y)("div",{className:"bg-paper border border-ink/15 rounded-lg divide-y divide-ink/10 shadow-xs overflow-hidden",children:a.map(e=>(0,i.FD)("div",{className:"p-3.5 flex flex-col sm:flex-row sm:items-center justify-between gap-3 hover:bg-ink/[0.015] transition-colors",children:[(0,i.FD)("div",{className:"flex items-start gap-3",children:[(0,i.Y)("div",{className:"w-7 h-7 rounded-md bg-ink/5 flex items-center justify-center text-ink/70 flex-shrink-0 mt-0.5",children:(0,i.Y)(e.icon,{size:14})}),(0,i.FD)("div",{children:[(0,i.Y)("div",{className:"font-semibold text-xs text-ink",children:e.label}),(0,i.Y)("div",{className:"text-[11px] text-ink/60 mt-0.5",children:e.desc})]})]}),(0,i.Y)("div",{className:"flex items-center gap-2 self-end sm:self-center",children:(0,i.Y)("select",{value:e.value,onChange:t=>{var i,r;return i=e.id,r=t.currentTarget.value,void n(e=>{let t={[i]:r};for(let n of["keybindingSend","keybindingNewLine","keybindingSteering"].filter(e=>e!==i))e[n]===r&&(t[n]=e[i]);return{...e,...t}})},className:"bg-paper border border-ink/20 rounded-md px-2.5 py-1.5 outline-none focus:border-ink text-[11px] font-medium text-ink cursor-pointer hover:border-ink/40 transition-colors",children:r.map(e=>(0,i.Y)("option",{value:e,children:e},e))})})]},e.id))})]})}var en=n("X"),ei=n("zH");let er=[{id:"websocket",label:"WebSocket",badge:"Default",icon:en.A,description:"One duplex socket carries every agent frame — no per-event HTTP framing, protocol-level ping keepalive, and capped client backoff on drops.",note:"Lowest overhead per frame"},{id:"sse",label:"Server-Sent Events",badge:"Fallback",icon:ei.A,description:"Long-lived HTTP response stream with automatic browser reconnection. Pick this when a proxy or network blocks the WebSocket upgrade.",note:"Works through HTTP-only proxies"}];function ea(e){let{settings:t,onUpdate:n}=e,r=t.streamTransport??"websocket";return(0,i.FD)("section",{className:"space-y-3",children:[(0,i.FD)("div",{children:[(0,i.Y)("h4",{className:"text-sm font-semibold text-ink",children:"Streaming Transport"}),(0,i.Y)("p",{className:"text-[11px] text-ink/60 mt-0.5",children:"Wire protocol for live agent events. Applies to the next connection — reconnect or send a new prompt to switch."})]}),(0,i.Y)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:er.map(e=>{let{id:t,label:a,badge:l,icon:s,description:o,note:c}=e,d=r===t,p=()=>n({streamTransport:t});return(0,i.FD)("div",{onClick:p,role:"button",tabIndex:0,onKeyDown:e=>"Enter"===e.key&&p(),className:`p-3.5 rounded-lg border text-left transition-all cursor-pointer flex flex-col justify-between select-none ${d?"border-ink bg-ink/5 ring-1 ring-ink/20 shadow-xs":"border-ink/15 bg-paper hover:border-ink/30 hover:bg-ink/[0.02]"}`,children:[(0,i.FD)("div",{children:[(0,i.FD)("div",{className:"flex items-center justify-between mb-2",children:[(0,i.FD)("div",{className:"flex items-center gap-2",children:[(0,i.Y)("div",{className:`w-7 h-7 rounded-md flex items-center justify-center ${d?"bg-ink text-paper":"bg-ink/5 text-ink/70"}`,children:(0,i.Y)(s,{size:15})}),(0,i.Y)("span",{className:"font-semibold text-xs text-ink",children:a})]}),(0,i.Y)("span",{className:"text-[10px] font-mono uppercase px-1.5 py-0.5 rounded bg-ink/10 text-ink/70 font-medium",children:l})]}),(0,i.Y)("p",{className:"text-[11px] text-ink/65 leading-relaxed",children:o})]}),(0,i.FD)("div",{className:"mt-3 pt-2.5 border-t border-ink/10 flex items-center justify-between text-[11px]",children:[(0,i.Y)("span",{className:"text-ink/50 text-[10px]",children:c}),(0,i.Y)("div",{className:`w-4 h-4 rounded-full border flex items-center justify-center ${d?"border-ink bg-ink text-paper":"border-ink/30 bg-transparent"}`,children:d&&(0,i.Y)(D.A,{size:10,strokeWidth:3})})]})]},t)})})]})}function el(e){let{settings:t,onUpdate:n}=e;return(0,i.FD)("div",{className:"w-full space-y-7 text-xs text-ink",children:[(0,i.Y)(ea,{settings:t,onUpdate:n}),(0,i.Y)(Q,{settings:t,onUpdate:n}),(0,i.Y)(et,{settings:t,onUpdate:n})]})}var es=n("g6"),eo=n("A"),ec=n("h"),ed=n("a"),ep=n("nv"),eu=n("nT"),em=n("Oj"),eh=n("Gh"),eb=n("R"),ef=n("DK"),ex=n("f"),eg=n("z9"),ev=n("Fx"),ek=n("F9"),ey=n("bt"),ew=n("by");let eN={default:es.A,code:eo.A,terminal:w.A,rocket:ec.A,flask:ed.A,gamepad:ep.A,briefcase:eu.A,home:b.A,globe:em.A,leaf:eh.A,shield:eb.A,palette:S.A,server:ef.A,smartphone:ex.A,database:eg.A,lightbulb:ev.A,music:ek.A,camera:ey.A,book:J.A,heart:ew.A};function eY(e){let{projects:t,selectedProjectId:n,onSelectProject:r,onAddProject:a}=e;return(0,i.FD)("div",{className:"w-56 sm:w-64 border-r border-ink/10 h-full flex flex-col bg-paper/50 flex-shrink-0",children:[(0,i.FD)("div",{className:"px-3.5 py-3 border-b border-ink/10 flex items-center justify-between",children:[(0,i.FD)("span",{className:"text-xs font-semibold text-ink",children:["Total ",t.length]}),(0,i.Y)("button",{type:"button",onClick:a,title:"Add New Project",className:"p-1 rounded text-ink/60 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer",children:(0,i.Y)(g.A,{size:15,strokeWidth:2.2})})]}),(0,i.Y)("div",{className:"flex-1 scrollbar-overlay-container scrollbar-overlay-static p-1.5 space-y-0.5",children:t.map(e=>{let t=e.id===n,a=eN[e.icon]||es.A;return(0,i.FD)("button",{type:"button",onClick:()=>r(e.id),className:`w-full flex items-center gap-2 px-2.5 py-1.5 rounded-md text-left transition-colors cursor-pointer group ${t?"bg-ink/10 text-ink font-medium shadow-2xs":"text-ink/80 hover:bg-ink/5 hover:text-ink"}`,children:[e.customIconUrl?(0,i.Y)("img",{src:e.customIconUrl,alt:"",className:"w-3.5 h-3.5 rounded-xs object-contain flex-shrink-0",referrerPolicy:"no-referrer"}):(0,i.Y)(a,{size:14,className:"flex-shrink-0",style:{color:e.accentColor||"currentColor"}}),(0,i.Y)("span",{className:"text-[11.5px] truncate flex-1",children:e.name})]},e.id)})})]})}var eD=n("m");function eA(e){let{project:t,canDelete:n,onDelete:r}=e;return(0,i.FD)("div",{className:"flex items-start justify-between gap-4 pb-4 border-b border-ink/10",children:[(0,i.FD)("div",{className:"min-w-0 flex-1",children:[(0,i.Y)("h2",{className:"text-xl font-bold tracking-tight text-ink truncate",children:t.name}),(0,i.Y)("p",{className:"text-[11px] font-mono text-ink/50 truncate mt-0.5 select-all",children:t.path})]}),n&&(0,i.Y)("button",{type:"button",onClick:r,title:"Delete Project",className:"p-1.5 text-ink/40 hover:text-error hover:bg-error/10 rounded-md transition-colors cursor-pointer",children:(0,i.Y)(eD.A,{size:15})})]})}function eF(e){let{name:t,onChangeName:n}=e;return(0,i.FD)("div",{className:"space-y-2",children:[(0,i.Y)("label",{htmlFor:"project-name-input",className:"block text-xs font-semibold text-ink",children:"Project Name"}),(0,i.Y)("input",{id:"project-name-input",type:"text",value:t,onChange:e=>n(e.currentTarget.value),placeholder:"Enter project name...",className:"w-full bg-paper border border-ink/20 rounded-md px-3 py-2 text-xs font-medium text-ink outline-none focus:border-ink/60 transition-colors shadow-2xs"})]})}var eC=n("wU"),eS=n("tN"),eT=n("Go"),eM=n("oj");let ez=["Not selected","DeepSeek-V3","DeepSeek-R1","Claude 3.5 Sonnet","Claude 3.7 Sonnet","GPT-4o","Gemini 2.5 Pro"];function eP(e){let{model:t,onSelectModel:n,models:r=ez}=e,l=r&&r.length>0?r:ez,[s,o]=(0,a.J0)(!1),[c,d]=(0,a.J0)(!1),p=(0,a.li)(null);return(0,eM.W)(p,()=>o(!1)),(0,i.FD)("div",{className:"space-y-2.5",children:[(0,i.FD)("div",{className:"flex items-center gap-1.5 relative",children:[(0,i.Y)("h4",{className:"text-xs font-semibold text-ink",children:"Defaults for new chats"}),(0,i.FD)("div",{className:"relative inline-block cursor-help",onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),children:[(0,i.Y)(eC.A,{size:12,className:"text-ink/40 hover:text-ink/70 transition-colors"}),c&&(0,i.Y)("div",{className:"absolute left-4 top-1/2 -translate-y-1/2 bg-ink text-canvas text-[10px] rounded px-2 py-1 shadow-lg whitespace-nowrap z-50 pointer-events-none",children:"Default model assigned when starting new sessions in this project"})]})]}),(0,i.FD)("div",{className:"flex items-center justify-between gap-4 p-3 bg-paper border border-ink/15 rounded-lg",children:[(0,i.FD)("div",{children:[(0,i.Y)("div",{className:"text-xs font-medium text-ink",children:"Project Model"}),(0,i.Y)("div",{className:"text-[11px] text-ink/50",children:"Fallback model for agent sessions"})]}),(0,i.FD)("div",{className:"relative",ref:p,children:[(0,i.FD)("button",{type:"button",onClick:()=>o(!s),className:"flex items-center gap-2 px-3 py-1.5 rounded-md border border-ink/20 hover:border-ink/40 bg-paper text-ink text-xs font-medium transition-colors cursor-pointer shadow-2xs",children:[(0,i.Y)(eS.A,{size:13,className:"text-ink/70"}),(0,i.Y)("span",{children:t||"Not selected"}),(0,i.Y)(eT.A,{size:13,className:"text-ink/50 ml-1"})]}),s&&(0,i.Y)("div",{className:"absolute right-0 mt-1 w-52 bg-paper border border-ink/15 rounded-lg shadow-xl py-1 z-50 max-h-56 scrollbar-overlay-container scrollbar-overlay-static",children:l.map(e=>(0,i.FD)("button",{type:"button",onClick:()=>{n(e),o(!1)},className:"w-full flex items-center justify-between px-3 py-1.5 text-left text-xs hover:bg-ink/5 transition-colors cursor-pointer",children:[(0,i.Y)("span",{className:e===t?"font-semibold text-ink":"text-ink/80",children:e}),e===t&&(0,i.Y)(D.A,{size:13,className:"text-ink"})]},e))})]})]})]})}let eL=[{label:"None",value:"",bgHex:"transparent"},{label:"Sky Blue",value:"#38bdf8",bgHex:"#38bdf8"},{label:"Light Green",value:"#a3e635",bgHex:"#a3e635"},{label:"Coral",value:"#f87171",bgHex:"#f87171"},{label:"Amber",value:"#fbbf24",bgHex:"#fbbf24"},{label:"Teal",value:"#2dd4bf",bgHex:"#2dd4bf"},{label:"Slate",value:"#94a3b8",bgHex:"#94a3b8"},{label:"Rose",value:"#f43f5e",bgHex:"#f43f5e"},{label:"Vivid Blue",value:"#3b82f6",bgHex:"#3b82f6"},{label:"Lime Green",value:"#84cc16",bgHex:"#84cc16"}];function ej(e){let{accentColor:t,onSelectColor:n,options:r=eL}=e,a=r&&r.length>0?r:eL;return(0,i.FD)("div",{className:"space-y-2.5",children:[(0,i.Y)("h4",{className:"text-xs font-semibold text-ink",children:"Accent Color"}),(0,i.Y)("div",{className:"flex flex-wrap items-center gap-2.5",children:a.map(e=>{let r=t===e.value;return""===e.value?(0,i.Y)("button",{type:"button",onClick:()=>n(""),title:"Default / No Accent",className:`w-7 h-7 rounded-full border flex items-center justify-center transition-all cursor-pointer ${r?"border-ink bg-ink/10 ring-2 ring-ink/30 ring-offset-2 ring-offset-paper":"border-ink/25 bg-paper hover:border-ink/50 text-ink/60"}`,children:(0,i.Y)(h.A,{size:12,strokeWidth:2.2})},"none"):(0,i.Y)("button",{type:"button",onClick:()=>n(e.value),title:e.label,style:{backgroundColor:e.bgHex},className:`w-7 h-7 rounded-full transition-all cursor-pointer shadow-2xs ${r?"ring-2 ring-ink ring-offset-2 ring-offset-paper scale-105":"hover:scale-105 opacity-90 hover:opacity-100"}`},e.value)})})]})}var eR=n("ke");let eI=[{id:"default",label:"Default Folder",icon:h.A},{id:"code",label:"Code",icon:eo.A},{id:"terminal",label:"Terminal",icon:w.A},{id:"rocket",label:"Rocket",icon:ec.A},{id:"flask",label:"Flask",icon:ed.A},{id:"gamepad",label:"Gamepad",icon:ep.A},{id:"briefcase",label:"Briefcase",icon:eu.A},{id:"home",label:"Home",icon:b.A},{id:"globe",label:"Globe",icon:em.A},{id:"leaf",label:"Leaf",icon:eh.A},{id:"shield",label:"Shield",icon:eb.A},{id:"palette",label:"Palette",icon:S.A},{id:"server",label:"Server",icon:ef.A},{id:"smartphone",label:"Smartphone",icon:ex.A},{id:"database",label:"Database",icon:eg.A},{id:"lightbulb",label:"Lightbulb",icon:ev.A},{id:"music",label:"Music",icon:ek.A},{id:"camera",label:"Camera",icon:ey.A},{id:"book",label:"Book",icon:J.A},{id:"heart",label:"Heart",icon:ew.A}];function eE(e){let{currentIcon:t,customIconUrl:n,projectName:r,onSelectIcon:l,onSetCustomIcon:s}=e,o=(0,a.li)(null);return(0,i.FD)("div",{className:"space-y-3",children:[(0,i.FD)("div",{className:"flex items-center justify-between",children:[(0,i.Y)("h4",{className:"text-xs font-semibold text-ink",children:"Project Icon"}),n&&(0,i.Y)("button",{type:"button",onClick:()=>s(void 0),className:"text-[11px] text-ink/50 hover:text-error transition-colors cursor-pointer",children:"Reset to standard icon"})]}),(0,i.Y)("div",{className:"flex flex-wrap gap-2",children:eI.map(e=>{let r=!n&&t===e.id,a=e.icon;return(0,i.Y)("button",{type:"button",onClick:()=>{s(void 0),l(e.id)},title:e.label,className:`w-7 h-7 rounded-md flex items-center justify-center transition-all cursor-pointer ${r?"border border-ink/40 bg-ink/5 text-ink shadow-2xs":"text-ink/60 hover:text-ink hover:bg-ink/5"}`,children:(0,i.Y)(a,{size:14,strokeWidth:1.8})},e.id)})}),(0,i.FD)("div",{className:"flex items-center gap-2 pt-1",children:[(0,i.Y)("input",{type:"file",ref:o,onChange:e=>{let t=e.currentTarget.files?.[0];if(!t)return;let n=new FileReader;n.onload=e=>{let t=e.target?.result;t&&(s(t),l("custom"))},n.readAsDataURL(t),e.currentTarget.value=""},accept:"image/*",className:"hidden"}),(0,i.FD)("button",{type:"button",onClick:()=>o.current?.click(),className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-md border border-ink/20 hover:border-ink/40 bg-paper text-ink text-xs font-medium transition-colors cursor-pointer shadow-2xs",children:[(0,i.Y)(eR.A,{size:13,className:"text-ink/60"}),(0,i.Y)("span",{children:"upload icon"})]}),(0,i.FD)("button",{type:"button",onClick:()=>{let e=r.toLowerCase().replace(/[^a-z0-9]/g,"")||"app";s(`https://api.dicebear.com/7.x/identicon/svg?seed=${e}&radius=50`),l("custom")},className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-md border border-ink/20 hover:border-ink/40 bg-paper text-ink text-xs font-medium transition-colors cursor-pointer shadow-2xs",children:[(0,i.Y)(V.A,{size:13,className:"text-ink/60"}),(0,i.Y)("span",{children:"discover favicon"})]}),n&&(0,i.FD)("div",{className:"flex items-center gap-2 ml-2 pl-2 border-l border-ink/10",children:[(0,i.Y)("img",{src:n,alt:"Custom icon",className:"w-5 h-5 rounded-xs object-contain border border-ink/15",referrerPolicy:"no-referrer"}),(0,i.Y)("span",{className:"text-[11px] text-ink/60",children:"Custom active"})]})]})]})}function e$(e){let{project:t,canDelete:n,onUpdateField:r,onDeleteProject:a,availableModels:l,accentColorOptions:s}=e;return(0,i.FD)("div",{className:"flex-1 scrollbar-overlay-container scrollbar-overlay-static p-6 md:p-8 space-y-7",children:[(0,i.Y)(eA,{project:t,canDelete:n,onDelete:a}),(0,i.Y)(eF,{name:t.name,onChangeName:e=>{if(r("name",e),t.path.endsWith(t.name)){let n=t.path.slice(0,-t.name.length);r("path",`${n}${e}`)}}}),(0,i.Y)(eP,{model:t.model,onSelectModel:e=>r("model",e),models:l}),(0,i.Y)(ej,{accentColor:t.accentColor,onSelectColor:e=>r("accentColor",e),options:s}),(0,i.Y)(eE,{currentIcon:t.icon,customIconUrl:t.customIconUrl,projectName:t.name,onSelectIcon:e=>r("icon",e),onSetCustomIcon:e=>r("customIconUrl",e)})]})}let eO={full:"flex h-full w-full items-center justify-center text-xs text-ink/40",fill:"flex-1 flex items-center justify-center text-xs text-ink/40"},eJ=e=>{let{variant:t="full",children:n}=e;return(0,i.Y)("div",{className:eO[t],children:n})};function e_(){let[e,t]=(0,a.J0)([]),[n,r]=(0,a.J0)([]),[l,s]=(0,a.J0)([]),[o,c]=(0,a.J0)("proj-workspace"),[d,p]=(0,a.J0)(!0);(0,a.vJ)(()=>{let e=!0;return(async()=>{try{let n=await fetch("/api/settings/projects"),i=await n.json();if(!e)return;Array.isArray(i?.projects)&&(t(i.projects),c(e=>i.projects.some(t=>t.id===e)?e:i.projects[0]?.id||"")),Array.isArray(i?.availableModels)&&r(i.availableModels),Array.isArray(i?.accentColorOptions)&&s(i.accentColorOptions)}catch(e){console.error("Failed to load projects from API:",e)}finally{e&&p(!1)}})(),()=>{e=!1}},[]);let u=async(e,t,n)=>{if(void 0!==e.folderId)try{let i=await fetch("/api/settings/projects",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:{folderId:e.folderId,[t]:void 0===n?null:n}})});if(!i.ok)throw Error(`HTTP ${i.status}`);window.dispatchEvent(new CustomEvent("omp:workspace-updated",{detail:{folderId:e.folderId}}))}catch(e){console.error("Failed to save project settings:",e)}},m=e.find(e=>e.id===o)||e[0],h=async()=>{let n=`Project ${e.length+1}`;try{let e=await fetch("/api/folders",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:n})}),i=await e.json();if(!e.ok||!i?.success)throw Error(i?.error||`HTTP ${e.status}`);let r=i.folder?.id;if("number"!=typeof r)throw Error("Created workspace has no folder id");let a={id:`folder-${r}`,folderId:r,name:i.folder.name,path:i.folder.project_path||"",model:"Not selected",accentColor:"",icon:"default",isPinned:!1,isExpanded:!0};t(e=>[...e,a]),c(a.id),window.dispatchEvent(new CustomEvent("omp:workspace-updated",{detail:{folderId:r}}))}catch(e){console.error("Failed to add project:",e)}},b=async()=>{if(!(e.length<=1))try{let n=await fetch(`/api/settings/projects?id=${encodeURIComponent(o)}`,{method:"DELETE"});if(!n.ok)throw Error(`HTTP ${n.status}`);let i=e.filter(e=>e.id!==o);t(i),c(i[0]?.id||""),window.dispatchEvent(new CustomEvent("omp:workspace-updated"))}catch(e){console.error("Failed to delete project:",e)}};return((0,C.sY)("omp:workspace-updated",()=>{fetch("/api/settings/projects").then(e=>e.json()).then(e=>{Array.isArray(e?.projects)&&(t(e.projects),c(t=>e.projects.some(e=>e.id===t)?t:e.projects[0]?.id||""))}).catch(e=>{console.error("Failed to refresh projects:",e)})}),d)?(0,i.Y)(eJ,{children:"Loading projects from database..."}):(0,i.FD)("div",{className:"w-full h-full flex flex-col md:flex-row overflow-hidden bg-paper text-ink",children:[(0,i.Y)(eY,{projects:e,selectedProjectId:m?.id||"",onSelectProject:c,onAddProject:h}),m&&(0,i.Y)(e$,{project:m,canDelete:e.length>1,onUpdateField:(e,n)=>{m&&(t(t=>t.map(t=>t.id===m.id?{...t,[e]:n}:t)),u(m,e,n))},onDeleteProject:b,availableModels:n,accentColorOptions:l})]})}var eU=n("wu");Array.from({length:41},(e,t)=>{let n=["Command Code Qwen-2.5-Coder-32B-Instruct","Command Code DeepSeek-Coder-V2-0724","Command Code Claude-3.5-Haiku-Fast","Command Code GLM-4-9B-Chat","Command Code Mistral-Codestral-22B","Command Code Llama-3.3-70B-Instruct","Command Code StarCoder-2-15B","Command Code CodeGemma-7B-IT","Command Code Yi-Coder-9B","Command Code DeepSeek-V3-Base","Command Code OpenAI-GPT-4o-Mini","Command Code Gemini-2.5-Flash-Code"],i=t<n.length?n[t]:`Command Code Custom Model-${t+1}`;return{id:`cc-model-${t+1}`,name:i,contextWindow:t%2==0?"1M ctx · 128K out":"128K ctx · 16K out",hasTools:!0,hasVision:t%3==0,hasReasoning:t%4==0,isVisible:!0,temperature:.6,maxTokens:64e3}});let eK=[{id:"openai",name:"OpenAI",slug:"openai",icon:"openai",defaultUrl:"https://api.openai.com/v1"},{id:"anthropic",name:"Anthropic",slug:"anthropic",icon:"claude",defaultUrl:"https://api.anthropic.com/v1"},{id:"google",name:"Google Gemini",slug:"google",icon:"gemini",defaultUrl:"https://generativelanguage.googleapis.com/v1beta"},{id:"groq",name:"Groq Cloud",slug:"groq",icon:"groq",defaultUrl:"https://api.groq.com/openai/v1"},{id:"mistral",name:"Mistral AI",slug:"mistral",icon:"mistral",defaultUrl:"https://api.mistral.ai/v1"},{id:"ollama",name:"Ollama (Local)",slug:"ollama",icon:"ollama",defaultUrl:"http://localhost:11434/v1"},{id:"custom",name:"Custom OpenAI-Compatible",slug:"custom",icon:"custom",defaultUrl:"https://"}],eB=null,eW=null;function eH(){return eW&&eW.expiresAt>Date.now()?Promise.resolve(eW.data):eB||(eB=fetch("/api/models").then(e=>e.ok?e.json():Promise.reject(Error(`GET /api/models failed: ${e.status}`))).then(e=>(eW={data:e,expiresAt:Date.now()+6e4},e)).finally(()=>{eB=null}))}function eq(){eW=null,window.dispatchEvent(new CustomEvent("omp:models-updated"))}function eG(e){return window.addEventListener("omp:models-updated",e),()=>window.removeEventListener("omp:models-updated",e)}async function eV(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];try{let r=await fetch("/api/settings/provider-models",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:e,apiKey:t,providerSlug:n,persistToOmp:i})}),a=await r.json();if(!r.ok)return{ok:!1,error:a?.error||`Request failed (HTTP ${r.status})`};return a}catch(e){return{ok:!1,error:e instanceof Error?e.message:"Network error while fetching models"}}}async function eQ(e,t){try{await Promise.all(t.map(t=>fetch("/api/models",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({actionType:"addModel",model:{id:t.id,name:t.name,provider:e,contextWindow:t.contextWindow?.split(" ")[0]||"128K",thinkingLevel:"Default",isFavorite:!0,capabilities:["Tool calling","Reasoning"],inputFormats:["text"],outputFormats:["text"]}})}))),eq()}catch(e){console.error("Failed to sync provider models to catalog:",e)}}let eZ=/^model-\d+-(?:1|2)$/;async function eX(e){let t=await fetch("/api/settings/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),n=await t.json();if(!t.ok)throw Error(n?.error||`Providers request failed (HTTP ${t.status})`);return eq(),Array.isArray(n.providers)?n.providers:null}var e0=n("oZ"),e1=n("H4"),e2=n("E"),e5=n("tL");function e3(e){let{icon:t,size:n=16,className:r=""}=e;switch(t){case"deepseek":return(0,i.Y)(eS.A,{size:n,className:`text-sky-400 ${r}`});case"agentrouter":return(0,i.Y)(e1.A,{size:n,className:`text-emerald-400 ${r}`});case"commandcode":return(0,i.Y)(e2.A,{size:n,className:`text-amber-400 ${r}`});case"opencode":return(0,i.Y)(en.A,{size:n,className:`text-violet-400 ${r}`});case"claude":return(0,i.Y)(I.A,{size:n,className:`text-orange-400 ${r}`});case"openai":return(0,i.Y)($.A,{size:n,className:`text-emerald-400 ${r}`});case"gemini":return(0,i.Y)(eS.A,{size:n,className:`text-blue-400 ${r}`});case"groq":return(0,i.Y)(e5.A,{size:n,className:`text-amber-500 ${r}`});case"ollama":return(0,i.Y)(ef.A,{size:n,className:`text-slate-400 ${r}`});case"mistral":return(0,i.Y)(em.A,{size:n,className:`text-rose-400 ${r}`});default:return(0,i.Y)(R.A,{size:n,className:`text-ink/60 ${r}`})}}function e4(e){let{providers:t,selectedProviderId:n,onSelectProvider:r,onOpenAddModal:l,projects:s=[{id:"proj-ompchamber",name:"ompchamber"},{id:"proj-workspace",name:"Workspace"},{id:"proj-drrealhandler",name:"drrealhandler"},{id:"proj-opencode-zen",name:"opencode-zen"}],currentProject:o,onSelectProject:c}=e,[d,p]=(0,a.J0)(!1),u=(0,a.li)(null);return(0,eM.W)(u,()=>p(!1)),(0,i.FD)("div",{className:"w-56 sm:w-64 border-r border-ink/10 h-full flex flex-col bg-paper/50 flex-shrink-0",children:[(0,i.FD)("div",{className:"p-3 border-b border-ink/10 relative",ref:u,children:[(0,i.FD)("button",{type:"button",onClick:()=>p(!d),className:"w-full flex items-center justify-between gap-2 px-3 py-1.5 rounded-lg border border-ink/20 hover:border-ink/40 bg-paper text-ink text-xs font-medium transition-colors cursor-pointer shadow-2xs",children:[(0,i.FD)("div",{className:"flex items-center gap-2 truncate",children:[(0,i.Y)(es.A,{size:14,className:"text-ink/60 flex-shrink-0"}),(0,i.Y)("span",{className:"truncate",children:o})]}),(0,i.Y)(eT.A,{size:14,className:"text-ink/50 flex-shrink-0"})]}),d&&(0,i.Y)("div",{className:"absolute left-3 right-3 mt-1.5 bg-paper border border-ink/15 rounded-lg shadow-xl py-1 z-50 max-h-56 scrollbar-overlay-container scrollbar-overlay",children:s.map(e=>(0,i.FD)("button",{type:"button",onClick:()=>{c(e.name),p(!1)},className:"w-full flex items-center justify-between px-3 py-1.5 text-left text-xs hover:bg-ink/5 transition-colors cursor-pointer",children:[(0,i.Y)("span",{className:e.name===o?"font-semibold text-ink":"text-ink/80",children:e.name}),e.name===o&&(0,i.Y)(D.A,{size:13,className:"text-ink"})]},e.id))})]}),(0,i.FD)("div",{className:"px-3.5 py-2.5 flex items-center justify-between",children:[(0,i.FD)("span",{className:"text-xs font-semibold text-ink/70",children:["Total ",t.length]}),(0,i.Y)("button",{type:"button",onClick:l,title:"Add Provider",className:"p-1 rounded text-ink/60 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer",children:(0,i.Y)(g.A,{size:15,strokeWidth:2.2})})]}),(0,i.Y)("div",{className:"px-3.5 pt-1 pb-1.5",children:(0,i.Y)("span",{className:"text-[10px] font-semibold tracking-wider text-ink/50 uppercase",children:"User Providers"})}),(0,i.Y)("div",{className:"flex-1 scrollbar-overlay-container scrollbar-overlay-static p-1.5 space-y-0.5",children:0===t.length?(0,i.Y)("div",{className:"px-2.5 py-4 text-[11px] leading-relaxed text-ink/50",children:"No connected providers yet. Use the plus button above to add one."}):t.map(e=>{let t=e.id===n;return(0,i.FD)("button",{type:"button",onClick:()=>r(e.id),className:`w-full flex items-center justify-between px-2.5 py-2 rounded-md text-left transition-colors cursor-pointer group ${t?"bg-ink/10 text-ink font-medium shadow-2xs":"text-ink/80 hover:bg-ink/5 hover:text-ink"}`,children:[(0,i.FD)("div",{className:"flex items-center gap-2.5 min-w-0",children:[(0,i.Y)(e3,{icon:e.icon,size:15,className:"flex-shrink-0"}),(0,i.Y)("span",{className:"text-[12px] truncate",children:e.name})]}),(0,i.Y)("span",{className:`text-[11px] px-1.5 py-0.5 rounded font-mono ${t?"text-ink/90 bg-ink/10":"text-ink/50 group-hover:text-ink/70"}`,children:e.models.length})]},e.id)})})]})}function e6(e){let{provider:t}=e;return(0,i.FD)("div",{className:"flex flex-col gap-1 pb-4",children:[(0,i.FD)("div",{className:"flex items-center gap-2.5",children:[(0,i.Y)(e3,{icon:t.icon,size:22}),(0,i.Y)("h2",{className:"text-xl font-bold tracking-tight text-ink",children:t.name})]}),(0,i.Y)("p",{className:"text-xs font-mono text-ink/50 pl-8",children:t.slug})]})}var e8=n("Fc"),e7=n("p");function e9(e){let{provider:t,onOpenReconnectModal:n,onToggleDisconnect:r,onToggleDisabled:l}=e,[s,o]=(0,a.J0)(!1),c="connected"===t.status,d=!0===t.disabled;return(0,i.FD)("div",{className:"space-y-6",children:[(0,i.FD)("div",{className:"space-y-3",children:[(0,i.Y)("div",{className:"text-xs font-semibold text-ink",children:"Authentication"}),(0,i.FD)("div",{className:"flex items-center justify-between gap-4",children:[(0,i.FD)("div",{className:"flex items-center gap-2",children:[d?(0,i.FD)(i.FK,{children:[(0,i.Y)(e8.A,{size:15,className:"text-ink/50 flex-shrink-0",strokeWidth:2.4}),(0,i.Y)("span",{className:"text-xs font-medium text-ink/70",children:"Disabled"})]}):c?(0,i.FD)(i.FK,{children:[(0,i.Y)(D.A,{size:15,className:"text-emerald-500 flex-shrink-0",strokeWidth:2.4}),(0,i.Y)("span",{className:"text-xs font-medium text-ink",children:"Connected"})]}):(0,i.FD)(i.FK,{children:[(0,i.Y)(e7.A,{size:15,className:"text-error flex-shrink-0",strokeWidth:2.4}),(0,i.Y)("span",{className:"text-xs font-medium text-error",children:"Disconnected"})]}),(0,i.FD)("div",{className:"relative inline-block cursor-help ml-0.5",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),children:[(0,i.Y)(eC.A,{size:13,className:"text-ink/40 hover:text-ink/70 transition-colors"}),s&&(0,i.Y)("div",{className:"absolute left-4 top-1/2 -translate-y-1/2 bg-ink text-canvas text-[10px] rounded px-2.5 py-1.5 shadow-xl whitespace-nowrap z-50 pointer-events-none",children:d?"Provider is disabled — none of its models appear in the chat model list":c?"Endpoint validated and operational for agent inference":"Provider authentication is currently offline or inactive"})]})]}),(0,i.FD)("div",{className:"flex items-center gap-2",children:[(0,i.Y)("button",{type:"button",onClick:l,title:d?"Offer this provider in the model list again":"Remove this provider from the model list",className:"px-3 py-1.5 rounded-md bg-ink/5 hover:bg-ink/10 text-ink text-xs font-medium transition-colors cursor-pointer border border-ink/10",children:d?"enable":"disable"}),(0,i.Y)("button",{type:"button",onClick:n,className:"px-3 py-1.5 rounded-md bg-ink/5 hover:bg-ink/10 text-ink text-xs font-medium transition-colors cursor-pointer border border-ink/10",children:c?"reconnect":"connect"})]})]})]}),(0,i.Y)("div",{className:"border-b border-ink/10"}),(0,i.FD)("div",{className:"space-y-3",children:[(0,i.Y)("div",{className:"text-xs font-semibold text-ink",children:"Connection Details"}),(0,i.FD)("div",{className:"flex items-center justify-between gap-4",children:[(0,i.FD)("div",{className:"text-xs text-ink/70",children:["Configured in: ",(0,i.Y)("span",{className:"font-mono text-ink font-medium",children:t.configuredIn})]}),c?(0,i.Y)("button",{type:"button",onClick:r,className:"text-xs text-error/90 hover:text-error font-medium hover:underline transition-colors cursor-pointer",children:"disconnect"}):(0,i.Y)("span",{className:"text-xs text-ink/40 italic",children:"inactive"})]})]}),(0,i.Y)("div",{className:"border-b border-ink/10"})]})}var te=n("i"),tt=n("gA"),tn=n("bH"),ti=n("Soe");function tr(e){if(null!=e){if("string"==typeof e)return e;if(Number.isFinite(e)&&!(e<=0)){if(e>=1e6){let t=e/1e6;return`${Number.isInteger(t)?t:t.toFixed(1)}M`}if(e>=1e3){let t=e/1e3;return`${Number.isInteger(t)?t:t.toFixed(1)}K`}return String(e)}}}function ta(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return"number"!=typeof e||!Number.isFinite(e)||e<=0?"":`$${e.toFixed(t)}`}function tl(e){return"number"!=typeof e||!Number.isFinite(e)||e<0?"":e<1024?`${Math.round(e)} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(2)} MB`}function ts(e){return"number"!=typeof e||!Number.isFinite(e)||e<0?"":`$${e.toFixed(2)}`}function to(e){let{models:t,onToggleModelVisibility:n,onHideAll:r,onShowAll:l,onFetchModels:s,canFetchModels:o,isFetchingModels:c,onOpenModelConfig:d,onOpenModelCapabilities:p}=e,[u,m]=(0,a.J0)(""),h=t.filter(e=>e.name.toLowerCase().includes(u.toLowerCase()));return(0,i.FD)("div",{className:"space-y-3.5",children:[(0,i.FD)("div",{className:"flex items-center justify-between gap-4",children:[(0,i.FD)("div",{className:"text-xs font-semibold text-ink",children:["Available Models ",(0,i.FD)("span",{className:"font-normal text-ink/60",children:["(",t.length,")"]})]}),(0,i.FD)("div",{className:"flex items-center gap-2",children:[(0,i.FD)("button",{type:"button",onClick:s,disabled:!o||c,title:o?"Fetch models from provider endpoint":"This provider has no fetchable endpoint",className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded bg-ink text-canvas text-[11px] font-medium hover:opacity-90 transition-opacity cursor-pointer border border-ink disabled:opacity-40 disabled:cursor-not-allowed",children:[(0,i.Y)(U.A,{size:12,className:c?"animate-spin":""}),(0,i.Y)("span",{children:c?"fetching...":"fetch models"})]}),(0,i.Y)("button",{type:"button",onClick:r,className:"px-2.5 py-1 rounded bg-ink/5 hover:bg-ink/10 text-[11px] font-medium text-ink/80 hover:text-ink transition-colors cursor-pointer border border-ink/10",children:"hide all"}),(0,i.Y)("button",{type:"button",onClick:l,className:"px-2.5 py-1 rounded bg-ink/5 hover:bg-ink/10 text-[11px] font-medium text-ink/80 hover:text-ink transition-colors cursor-pointer border border-ink/10",children:"show all"})]})]}),(0,i.FD)("div",{className:"relative flex items-center",children:[(0,i.Y)(_.A,{size:14,className:"absolute left-3 text-ink/40 pointer-events-none"}),(0,i.Y)("input",{type:"text",value:u,onChange:e=>m(e.currentTarget.value),placeholder:"Filter models...",className:"w-full bg-paper border border-ink/15 rounded-lg pl-9 pr-3 py-2 text-xs text-ink placeholder-ink/40 focus:outline-none focus:border-ink/40 transition-colors shadow-2xs"}),u&&(0,i.Y)("button",{type:"button",onClick:()=>m(""),className:"absolute right-3 text-[11px] text-ink/40 hover:text-ink cursor-pointer",children:"clear"})]}),(0,i.Y)("div",{className:"space-y-1 pt-1",children:0===h.length?(0,i.FD)("div",{className:"py-8 text-center text-xs text-ink/40",children:['No models found matching "',u,'"']}):h.map(e=>(0,i.FD)("div",{className:`flex items-center justify-between gap-3 px-3 py-2.5 rounded-lg hover:bg-ink/5 transition-colors group ${!e.isVisible?"opacity-50":""}`,children:[(0,i.Y)("div",{className:"min-w-0 flex-1",children:(0,i.Y)("span",{className:`text-xs font-medium truncate block ${e.isVisible?"text-ink":"text-ink/60 line-through decoration-ink/40"}`,children:e.name})}),(0,i.FD)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(void 0!==e.priceInput||void 0!==e.priceOutput)&&(0,i.FD)("span",{title:`$${e.priceInput??"?"} in / $${e.priceOutput??"?"} out per 1M tokens`,className:"text-[11px] font-mono px-2 py-0.5 rounded bg-ink/5 text-ink/70 border border-ink/10",children:[ts(e.priceInput)," / ",ts(e.priceOutput)]}),e.contextWindow&&(0,i.Y)("span",{className:"text-[11px] font-mono px-2 py-0.5 rounded bg-ink/5 text-ink/70 border border-ink/10",children:tr(e.contextWindow)}),e.hasTools&&(0,i.Y)("button",{type:"button",onClick:()=>p(e),title:"Tool Calling & Steering Capabilities",className:"p-1 rounded text-ink/50 hover:text-ink hover:bg-ink/10 transition-colors cursor-pointer",children:(0,i.Y)(te.A,{size:13,strokeWidth:1.8})}),(0,i.Y)("button",{type:"button",onClick:()=>d(e),title:"Configure Model Parameters",className:"p-1 rounded text-ink/50 hover:text-ink hover:bg-ink/10 transition-colors cursor-pointer",children:(0,i.Y)(y.A,{size:13,strokeWidth:1.8})}),e.hasVision&&(0,i.Y)("div",{title:"Multimodal / Vision inputs enabled",className:"p-1 text-ink/60",children:(0,i.Y)(tt.A,{size:13,strokeWidth:1.8})}),(0,i.Y)("button",{type:"button",onClick:()=>n(e.id),title:e.isVisible?"Hide model from chat picker":"Show model in chat picker",className:`p-1 rounded transition-colors cursor-pointer ${e.isVisible?"text-ink/60 hover:text-ink hover:bg-ink/10":"text-ink/30 hover:text-ink/70 hover:bg-ink/10"}`,children:e.isVisible?(0,i.Y)(tn.A,{size:14,strokeWidth:1.8}):(0,i.Y)(ti.A,{size:14,strokeWidth:1.8})})]})]},e.id))})]})}var tc=n("oE"),td=n("FJ"),tp=n("fa");function tu(e){let{onClose:t,header:n,children:r,footer:a,form:l,maxWidthClass:s="max-w-md",zClass:o="z-[60]"}=e,c=(0,i.FD)(i.FK,{children:[r,a]});return(0,i.Y)("div",{className:`fixed inset-0 bg-ink/40 backdrop-blur-[2px] ${o} flex items-center justify-center p-4`,onClick:t,children:(0,i.FD)("div",{className:`bg-paper border border-ink/15 rounded-xl shadow-2xl w-full ${s} overflow-hidden text-ink`,onClick:e=>e.stopPropagation(),children:[(0,i.FD)("div",{className:"px-5 py-4 border-b border-ink/10 flex items-center justify-between",children:[n,(0,i.Y)("button",{type:"button",onClick:t,className:"p-1 rounded text-ink/40 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer",children:(0,i.Y)(h.A,{size:16})})]}),l?(0,i.Y)("form",{onSubmit:l.onSubmit,className:l.className,children:c}):c]})})}function tm(e){let{isOpen:t,onClose:n,onAddProvider:r,presets:l}=e,s=l[0],[o,c]=(0,a.J0)(s?.id||"openai"),[d,p]=(0,a.J0)(s?.name||"OpenAI"),[u,m]=(0,a.J0)(s?.defaultUrl||"https://api.openai.com/v1"),[h,b]=(0,a.J0)(""),[f,x]=(0,a.J0)(!1),g=e=>{c(e.id),p(e.name),m(e.defaultUrl)};if((0,a.vJ)(()=>{!l.find(e=>e.id===o)&&l[0]&&g(l[0])},[l,o]),!t)return null;let v=async e=>{if(e.preventDefault(),d.trim()&&0!==l.length&&!f){x(!0);try{let e=l.find(e=>e.id===o),t=Date.now(),i={id:`provider-${t}`,name:d.trim(),slug:d.toLowerCase().replace(/[^a-z0-9]/g,"-")||`provider-${t}`,icon:e?.icon||"custom",status:"connected",configuredIn:"auth credentials",baseUrl:u.trim(),apiKey:h.trim()||"sk-custom-••••••••••••••••••••••••",models:[]},a=await eV(u.trim(),h.trim()||void 0,i.slug,!0);a.ok&&a.models?(i.models=a.models,r(i,{fetchedCount:a.models.length})):r(i,{fetchedCount:-1}),n()}finally{x(!1)}}};return(0,i.FD)(tu,{onClose:n,header:(0,i.FD)("div",{className:"flex items-center gap-2",children:[(0,i.Y)(tc.A,{size:16,className:"text-ink/70"}),(0,i.Y)("h3",{className:"text-sm font-semibold text-ink",children:"Add Model Provider"})]}),form:{onSubmit:v,className:"p-5 space-y-4"},footer:(0,i.FD)("div",{className:"pt-2 flex items-center justify-end gap-2 border-t border-ink/10",children:[(0,i.Y)("button",{type:"button",onClick:n,className:"px-3.5 py-1.5 rounded-md border border-ink/20 text-xs font-medium text-ink hover:bg-ink/5 transition-colors cursor-pointer",children:"Cancel"}),(0,i.Y)("button",{type:"submit",disabled:f||0===l.length,className:"px-3.5 py-1.5 rounded-md bg-ink text-canvas text-xs font-medium hover:opacity-90 transition-opacity cursor-pointer disabled:opacity-50 flex items-center gap-1.5",children:f?(0,i.FD)(i.FK,{children:[(0,i.Y)(td.A,{size:14,className:"animate-pulse"}),(0,i.Y)("span",{children:"Fetching models..."})]}):(0,i.FD)(i.FK,{children:[(0,i.Y)(D.A,{size:14}),(0,i.Y)("span",{children:"Connect Provider"})]})})]}),children:[(0,i.FD)("div",{children:[(0,i.Y)("label",{className:"block text-xs font-semibold text-ink mb-1.5",children:"Provider Preset"}),(0,i.FD)("div",{className:"grid grid-cols-2 gap-2 max-h-36 scrollbar-overlay-container scrollbar-overlay-static pr-1",children:[0===l.length&&(0,i.Y)("p",{className:"col-span-2 px-2 py-3 text-xs text-ink/50",children:"All known provider types are already connected."}),l.map(e=>{let t=e.id===o;return(0,i.FD)("button",{type:"button",onClick:()=>g(e),className:`flex items-center gap-2 p-2 rounded-lg border text-left text-xs transition-colors cursor-pointer ${t?"border-ink/50 bg-ink/5 font-semibold text-ink shadow-2xs":"border-ink/15 hover:border-ink/30 text-ink/70"}`,children:[(0,i.Y)(e3,{icon:e.icon,size:14}),(0,i.Y)("span",{className:"truncate",children:e.name})]},e.id)})]})]}),(0,i.FD)("div",{children:[(0,i.Y)("label",{className:"block text-xs font-semibold text-ink mb-1",children:"Display Name"}),(0,i.Y)("input",{type:"text",required:!0,value:d,onChange:e=>p(e.currentTarget.value),placeholder:"e.g. My Provider",className:"w-full bg-paper border border-ink/20 rounded-md px-3 py-1.5 text-xs text-ink outline-none focus:border-ink/60"})]}),(0,i.FD)("div",{children:[(0,i.Y)("label",{className:"block text-xs font-semibold text-ink mb-1",children:"API Base URL"}),(0,i.FD)("div",{className:"relative flex items-center",children:[(0,i.Y)(em.A,{size:13,className:"absolute left-2.5 text-ink/40 pointer-events-none"}),(0,i.Y)("input",{type:"text",required:!0,value:u,onChange:e=>m(e.currentTarget.value),placeholder:"https://api.domain.com/v1",className:"w-full bg-paper border border-ink/20 rounded-md pl-8 pr-3 py-1.5 text-xs text-ink outline-none focus:border-ink/60 font-mono"})]})]}),(0,i.FD)("div",{children:[(0,i.Y)("label",{className:"block text-xs font-semibold text-ink mb-1",children:"API Key (stored securely)"}),(0,i.FD)("div",{className:"relative flex items-center",children:[(0,i.Y)(tp.A,{size:13,className:"absolute left-2.5 text-ink/40 pointer-events-none"}),(0,i.Y)("input",{type:"password",value:h,onChange:e=>b(e.currentTarget.value),placeholder:"sk-••••••••••••••••",className:"w-full bg-paper border border-ink/20 rounded-md pl-8 pr-3 py-1.5 text-xs text-ink outline-none focus:border-ink/60 font-mono"})]})]})]})}var th=n("mX");function tb(e){let{isOpen:t,provider:n,isFetchingModels:r,onClose:l,onReconnect:s,onFetchModels:o}=e,[c,d]=(0,a.J0)(n.apiKey||"sk-••••••••••••••••••••••••"),[p,u]=(0,a.J0)(n.baseUrl||"https://api.openai.com/v1"),[m,h]=(0,a.J0)(!1),[b,f]=(0,a.J0)(null);if(!t)return null;let x={apiKey:c.includes("••••")?void 0:c,baseUrl:p},g=async()=>{h(!0),f(null);let e=await eV(p,x.apiKey);h(!1),f(e.ok?"success":"failed")},v=async e=>{e.preventDefault(),s({apiKey:c,baseUrl:p,status:"connected"}),await o(x),l()};return(0,i.FD)(tu,{onClose:l,header:(0,i.FD)("div",{className:"flex items-center gap-2.5",children:[(0,i.Y)(e3,{icon:n.icon,size:18}),(0,i.FD)("div",{children:[(0,i.Y)("h3",{className:"text-sm font-semibold text-ink",children:"Authentication & Credentials"}),(0,i.Y)("p",{className:"text-[11px] text-ink/50 font-mono",children:n.slug})]})]}),form:{onSubmit:v,className:"p-5 space-y-4"},footer:(0,i.FD)("div",{className:"pt-3 flex items-center justify-end gap-2 border-t border-ink/10",children:[(0,i.Y)("button",{type:"button",onClick:l,className:"px-3.5 py-1.5 rounded-md border border-ink/20 text-xs font-medium text-ink hover:bg-ink/5 transition-colors cursor-pointer",children:"Cancel"}),(0,i.FD)("button",{type:"submit",disabled:r,className:"px-3.5 py-1.5 rounded-md bg-ink text-canvas text-xs font-medium hover:opacity-90 transition-opacity cursor-pointer disabled:opacity-50 flex items-center gap-1.5",children:[(0,i.Y)(U.A,{size:13,className:r?"animate-spin":""}),(0,i.Y)("span",{children:r?"Fetching models...":"Save & Reconnect"})]})]}),children:[(0,i.FD)("div",{children:[(0,i.Y)("label",{className:"block text-xs font-semibold text-ink mb-1",children:"Endpoint URL"}),(0,i.FD)("div",{className:"relative flex items-center",children:[(0,i.Y)(em.A,{size:13,className:"absolute left-2.5 text-ink/40 pointer-events-none"}),(0,i.Y)("input",{type:"text",value:p,onChange:e=>u(e.currentTarget.value),className:"w-full bg-paper border border-ink/20 rounded-md pl-8 pr-3 py-1.5 text-xs text-ink outline-none focus:border-ink/60 font-mono"})]})]}),(0,i.FD)("div",{children:[(0,i.Y)("label",{className:"block text-xs font-semibold text-ink mb-1",children:"API Key / Auth Token"}),(0,i.FD)("div",{className:"relative flex items-center",children:[(0,i.Y)(tp.A,{size:13,className:"absolute left-2.5 text-ink/40 pointer-events-none"}),(0,i.Y)("input",{type:"text",value:c,onChange:e=>d(e.currentTarget.value),className:"w-full bg-paper border border-ink/20 rounded-md pl-8 pr-3 py-1.5 text-xs text-ink outline-none focus:border-ink/60 font-mono"})]})]}),(0,i.FD)("div",{className:"flex items-center justify-between pt-1",children:[(0,i.FD)("button",{type:"button",disabled:m||r,onClick:g,className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-md border border-ink/20 hover:border-ink/40 text-xs font-medium text-ink transition-colors cursor-pointer bg-ink/5 disabled:opacity-50",children:[(0,i.Y)(U.A,{size:13,className:m?"animate-spin":""}),(0,i.Y)("span",{children:m?"Testing endpoint...":"Test Connection"})]}),"success"===b&&(0,i.FD)("span",{className:"inline-flex items-center gap-1 text-xs text-emerald-500 font-medium",children:[(0,i.Y)(th.A,{size:13}),(0,i.Y)("span",{children:"Models endpoint reachable"})]}),"failed"===b&&(0,i.FD)("span",{className:"inline-flex items-center gap-1 text-xs text-error font-medium",children:[(0,i.Y)(e7.A,{size:13}),(0,i.Y)("span",{children:"Connection failed"})]})]}),(0,i.FD)("div",{className:"flex items-start gap-2 px-3 py-2 rounded-md bg-ink/5 border border-ink/10 text-[11px] text-ink/60",children:[(0,i.Y)(td.A,{size:13,className:"mt-0.5 flex-shrink-0 text-ink/50"}),(0,i.Y)("span",{children:"On save, models are fetched from the endpoint and merged into the list below — existing models are kept, only new ones are added."})]})]})}var tf=n("tR");function tx(e){let{isOpen:t,provider:n,onClose:r,onAuthenticated:l}=e,[s,o]=(0,a.J0)("connecting"),[c,d]=(0,a.J0)(null),[p,u]=(0,a.J0)(null),[m,h]=(0,a.J0)(null),[b,f]=(0,a.J0)(""),[x,g]=(0,a.J0)(null),v=(0,a.li)(null),k=(0,a.li)(l);k.current=l,(0,a.vJ)(()=>{if(!t)return;o("connecting"),d(null),u(null),h(null),g(null),f("");let e=new AbortController,i=t=>{fetch("/api/omp/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),signal:e.signal}).catch(()=>{})};return v.current=i,fetch("/api/omp/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerId:n.slug}),signal:e.signal}).then(async t=>{if(!t.body)throw Error("Streaming not supported");let n=t.body.getReader(),r=new TextDecoder,a="";for(;;){let{done:t,value:l}=await n.read();if(t)break;let s=(a+=r.decode(l,{stream:!0})).split("\n\n");for(let t of(a=s.pop()??"",s)){let n=t.split("\n").find(e=>e.startsWith("data: "));if(n)try{let t=JSON.parse(n.slice(6));if("extension_ui_request"===t.type)o("waiting"),"open_url"===t.method&&t.launchUrl?(d(t.launchUrl),window.open(t.launchUrl,"_blank","noopener")):"input"===t.method?u(t):"notify"===t.method?(h(t.title??""),t.title&&i({id:t.id,accepted:!0})):i({id:t.id,cancelled:!0});else if("login_result"===t.type){o(t.success?"success":"failed"),t.success||g(t.error??"Login failed"),t.success&&k.current(),e.abort();return}}catch{}}}}).catch(t=>{e.signal.aborted||(o("failed"),g(t instanceof Error?t.message:String(t)))}),()=>{e.abort(),v.current=null}},[t,n.slug]);let y=e=>{p&&(v.current?.(e?{id:p.id,cancelled:!0}:{id:p.id,value:b}),u(null),o("connecting"))};return t?(0,i.Y)(tu,{onClose:r,header:(0,i.FD)("div",{className:"flex items-center gap-2.5",children:[(0,i.Y)(e3,{icon:n.icon,size:18}),(0,i.FD)("div",{children:[(0,i.FD)("h3",{className:"text-sm font-semibold text-ink",children:["Sign in to ",n.name]}),(0,i.Y)("p",{className:"text-[11px] text-ink/50 font-mono",children:n.slug})]})]}),footer:(0,i.Y)("div",{className:"px-5 py-3 border-t border-ink/10 flex justify-end",children:(0,i.Y)("button",{type:"button",onClick:r,className:"px-3.5 py-1.5 rounded-md border border-ink/20 text-xs font-medium text-ink hover:bg-ink/5 transition-colors cursor-pointer",children:"success"===s?"Done":"Close"})}),children:(0,i.FD)("div",{className:"p-5 space-y-4",children:["connecting"===s&&(0,i.FD)("div",{className:"flex items-center gap-2.5 text-xs text-ink/70",children:[(0,i.Y)(tf.A,{size:14,className:"animate-spin"}),"Starting login flow..."]}),"waiting"===s&&(0,i.FD)("div",{className:"space-y-4",children:[c&&(0,i.FD)("div",{className:"space-y-2",children:[(0,i.FD)("div",{className:"flex items-center gap-2 text-xs font-semibold text-ink",children:[(0,i.Y)(em.A,{size:13,className:"text-ink/50"})," OAuth browser"]}),(0,i.Y)("p",{className:"text-xs text-ink/60",children:"Complete the sign-in in the opened browser tab."}),(0,i.Y)("button",{type:"button",onClick:()=>window.open(c,"_blank","noopener"),className:"text-xs text-ink underline underline-offset-2 break-all text-left",children:c})]}),p&&(0,i.FD)("div",{className:"space-y-2",children:[(0,i.FD)("div",{className:"flex items-center gap-2 text-xs font-semibold text-ink",children:[(0,i.Y)(tp.A,{size:13,className:"text-ink/50"})," ",p.title??"Credential"]}),(0,i.Y)("input",{type:"text",autoFocus:!0,value:b,onChange:e=>f(e.currentTarget.value),onKeyDown:e=>"Enter"===e.key&&y(!1),placeholder:p.placeholder??"Paste your API key",className:"w-full bg-paper border border-ink/20 rounded-md px-3 py-1.5 text-xs text-ink outline-none focus:border-ink/60 font-mono"}),(0,i.FD)("div",{className:"flex justify-end gap-2",children:[(0,i.Y)("button",{type:"button",onClick:()=>y(!0),className:"px-3 py-1.5 rounded-md border border-ink/20 text-xs text-ink hover:bg-ink/5 transition-colors cursor-pointer",children:"Cancel"}),(0,i.Y)("button",{type:"button",onClick:()=>y(!1),className:"px-3.5 py-1.5 rounded-md bg-ink text-canvas text-xs font-medium hover:opacity-90 transition-opacity cursor-pointer",children:"Submit"})]})]}),m&&(0,i.Y)("p",{className:"text-xs text-ink/60",children:m}),!c&&!p&&!m&&(0,i.Y)("p",{className:"text-xs text-ink/50",children:"Waiting for the provider flow..."})]}),"success"===s&&(0,i.FD)("div",{className:"flex items-center gap-2 text-xs text-emerald-500 font-medium",children:[(0,i.Y)(th.A,{size:14})," Signed in. Credentials stored by omp."]}),"failed"===s&&(0,i.FD)("div",{className:"flex items-start gap-2 text-xs text-error font-medium",children:[(0,i.Y)(e7.A,{size:14,className:"mt-0.5 shrink-0"}),(0,i.Y)("span",{children:x??"Login failed"})]})]})}):null}function tg(e){let{isOpen:t,model:n,onClose:r,onSaveModelConfig:l}=e;if(!t||!n)return null;let[s,o]=(0,a.J0)(n.temperature??.7),[c,d]=(0,a.J0)(n.maxTokens??384e3),[p,u]=(0,a.J0)(n.topP??.95),[m,h]=(0,a.J0)(n.reasoningEffort??"medium");return(0,i.FD)(tu,{onClose:r,header:(0,i.FD)("div",{className:"flex items-center gap-2",children:[(0,i.Y)(y.A,{size:16,className:"text-ink/70"}),(0,i.FD)("div",{children:[(0,i.Y)("h3",{className:"text-sm font-semibold text-ink",children:"Model Configuration"}),(0,i.Y)("p",{className:"text-[11px] text-ink/50 truncate max-w-[280px]",children:n.name})]})]}),form:{onSubmit:e=>{e.preventDefault(),l(n.id,{temperature:s,maxTokens:c,topP:p,reasoningEffort:m}),r()},className:"p-5 space-y-4"},footer:(0,i.FD)("div",{className:"pt-2 flex items-center justify-end gap-2 border-t border-ink/10",children:[(0,i.Y)("button",{type:"button",onClick:r,className:"px-3.5 py-1.5 rounded-md border border-ink/20 text-xs font-medium text-ink hover:bg-ink/5 transition-colors cursor-pointer",children:"Cancel"}),(0,i.FD)("button",{type:"submit",className:"px-3.5 py-1.5 rounded-md bg-ink text-canvas text-xs font-medium hover:opacity-90 transition-opacity cursor-pointer flex items-center gap-1.5",children:[(0,i.Y)(D.A,{size:14}),(0,i.Y)("span",{children:"Save Parameters"})]})]}),children:[(0,i.FD)("div",{children:[(0,i.FD)("div",{className:"flex items-center justify-between mb-1 text-xs",children:[(0,i.Y)("span",{className:"font-semibold text-ink",children:"Sampling Temperature"}),(0,i.Y)("span",{className:"font-mono text-ink/70 font-semibold",children:s.toFixed(2)})]}),(0,i.Y)("input",{type:"range",min:"0.0",max:"2.0",step:"0.05",value:s,onChange:e=>o(parseFloat(e.currentTarget.value)),className:"w-full accent-ink cursor-pointer"}),(0,i.Y)("p",{className:"text-[10px] text-ink/40 mt-0.5",children:"Controls randomness: lower is more deterministic, higher is more creative."})]}),(0,i.FD)("div",{children:[(0,i.FD)("div",{className:"flex items-center justify-between mb-1 text-xs",children:[(0,i.Y)("span",{className:"font-semibold text-ink",children:"Top P (Nucleus Sampling)"}),(0,i.Y)("span",{className:"font-mono text-ink/70 font-semibold",children:p.toFixed(2)})]}),(0,i.Y)("input",{type:"range",min:"0.1",max:"1.0",step:"0.05",value:p,onChange:e=>u(parseFloat(e.currentTarget.value)),className:"w-full accent-ink cursor-pointer"})]}),(0,i.FD)("div",{children:[(0,i.Y)("label",{className:"block text-xs font-semibold text-ink mb-1",children:"Max Output Tokens"}),(0,i.Y)("input",{type:"number",min:1024,max:1e6,step:1024,value:c,onChange:e=>d(parseInt(e.currentTarget.value,10)||4096),className:"w-full bg-paper border border-ink/20 rounded-md px-3 py-1.5 text-xs text-ink outline-none focus:border-ink/60 font-mono"})]}),n.hasReasoning&&(0,i.FD)("div",{children:[(0,i.Y)("label",{className:"block text-xs font-semibold text-ink mb-1.5",children:"Reasoning Effort"}),(0,i.Y)("div",{className:"grid grid-cols-3 gap-2",children:["low","medium","high"].map(e=>(0,i.Y)("button",{type:"button",onClick:()=>h(e),className:`py-1.5 rounded-md text-xs font-medium border text-center transition-colors cursor-pointer capitalize ${m===e?"border-ink/50 bg-ink/10 text-ink":"border-ink/15 text-ink/60 hover:border-ink/30"}`,children:e},e))})]})]})}var tv=n("B");function tk(e){let{isOpen:t,model:n,onClose:r}=e;if(!t||!n)return null;let a=[{title:"Tool & Function Calling",desc:"Allows autonomous agents to invoke CLI scripts, read files, and manipulate workspace files.",enabled:n.hasTools,icon:w.A},{title:"Multimodal Vision",desc:"Analyzes visual screenshots, terminal diffs, diagrams, and image uploads directly.",enabled:n.hasVision,icon:tn.A},{title:"Extended Reasoning & Thinking Blocks",desc:"Provides deep chain-of-thought scratchpad tokens before outputting code patches.",enabled:!!n.hasReasoning,icon:j.A},{title:"Structured Output (JSON Schema)",desc:"Forces strict conformance to specified JSON schemas for deterministic tool execution.",enabled:!0,icon:tv.A},{title:"Streaming Inference",desc:"Delivers real-time incremental token chunks to the chat timeline with zero latency.",enabled:!0,icon:eS.A}];return(0,i.Y)(tu,{onClose:r,header:(0,i.FD)("div",{className:"flex items-center gap-2",children:[(0,i.Y)(te.A,{size:16,className:"text-ink/70"}),(0,i.FD)("div",{children:[(0,i.Y)("h3",{className:"text-sm font-semibold text-ink",children:"Model Capabilities & Tools"}),(0,i.Y)("p",{className:"text-[11px] text-ink/50 truncate max-w-[280px]",children:n.name})]})]}),footer:(0,i.Y)("div",{className:"px-5 py-3 border-t border-ink/10 flex justify-end",children:(0,i.Y)("button",{type:"button",onClick:r,className:"px-4 py-1.5 rounded-md bg-ink text-canvas text-xs font-medium hover:opacity-90 transition-opacity cursor-pointer",children:"Close"})}),children:(0,i.Y)("div",{className:"p-5 space-y-3",children:a.map(e=>{let t=e.icon;return(0,i.FD)("div",{className:"flex items-start gap-3 p-2.5 rounded-lg bg-ink/5 border border-ink/10",children:[(0,i.Y)("div",{className:"p-1.5 rounded bg-ink/10 text-ink mt-0.5",children:(0,i.Y)(t,{size:14})}),(0,i.FD)("div",{className:"flex-1 min-w-0",children:[(0,i.FD)("div",{className:"flex items-center justify-between",children:[(0,i.Y)("span",{className:"text-xs font-semibold text-ink",children:e.title}),e.enabled?(0,i.FD)("span",{className:"inline-flex items-center gap-1 text-[10px] text-emerald-500 font-semibold uppercase tracking-wider",children:[(0,i.Y)(D.A,{size:11,strokeWidth:2.5}),"Supported"]}):(0,i.Y)("span",{className:"text-[10px] text-ink/40 font-medium uppercase tracking-wider",children:"Not supported"})]}),(0,i.Y)("p",{className:"text-[11px] text-ink/60 mt-0.5 leading-relaxed",children:e.desc})]})]},e.title)})})})}function ty(e){let{autoOpenAdd:t=!1,onAddModalClose:n}=e,{connectedProviders:r,availablePresetProviders:l,selectedProvider:s,currentProject:o,setCurrentProject:c,isFetchingModels:d,toasts:p,dismissToast:u,isAddModalOpen:m,setIsAddModalOpen:h,isReconnectModalOpen:b,setIsReconnectModalOpen:f,isLoginModalOpen:x,setIsLoginModalOpen:g,configModel:v,setConfigModel:k,capabilitiesModel:y,setCapabilitiesModel:w,setSelectedProviderId:N,handleAddProvider:Y,handleReconnect:D,handleFetchModels:A,handleFetchModelsFromList:F,handleOmpAuthSuccess:C,handleToggleDisconnect:S,handleToggleProviderDisabled:T,handleHideAll:M,handleShowAll:z,handleToggleModelVisibility:P,handleSaveModelConfig:L}=function(){let{autoOpenAdd:e=!1,onAddModalClose:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[n,i]=(0,a.J0)([]),[r,l]=(0,a.J0)(eK),[s,o]=(0,a.J0)("provider-deepseek"),[c,d]=(0,a.J0)("ompchamber"),[p,u]=(0,a.J0)(!1),{toasts:m,pushToast:h,dismissToast:b}=(0,e0.Y)(),[f,x]=(0,a.J0)(e),[g,v]=(0,a.J0)(!1),[k,y]=(0,a.J0)(!1),[w,N]=(0,a.J0)(null),[Y,D]=(0,a.J0)(null);(0,a.vJ)(()=>{e&&x(!0)},[e]),(0,a.vJ)(()=>{let e=!0;return fetch("/api/settings/providers").then(e=>e.json()).then(t=>{if(e){if(t?.providers&&Array.isArray(t.providers)){i(t.providers);let e=t.providers.filter(e=>"connected"===e.status);o(e.length>0?e[0].id:"")}t?.presetProviders&&l(t.presetProviders)}}).catch(e=>console.error("Failed to load providers from API:",e)),()=>{e=!1}},[]);let A=(0,a.Kr)(()=>n.filter(e=>"connected"===e.status||!0===e.disabled),[n]),F=(0,a.Kr)(()=>{let e,t;return e=new Set(n.filter(e=>"connected"===e.status).map(e=>e.slug.trim().toLowerCase())),t=new Set,[...r,...n.filter(e=>"connected"!==e.status).map(e=>({id:e.slug,name:e.name,slug:e.slug,icon:e.icon,defaultUrl:e.baseUrl||"https://"}))].filter(n=>{let i=n.slug.trim().toLowerCase();return!(e.has(i)||t.has(i))&&(t.add(i),!0)})},[n,r]),C=A.find(e=>e.id===s)||A[0],S=async e=>{i(e);try{let t=await eX({providers:e});t&&i(t)}catch(e){console.error("Failed to save providers via API:",e),h("Failed to save provider settings.","error")}},T=async(e,t)=>{try{let n=await eX(t?{enableProvider:e}:{disableProvider:e});return n&&i(n),n}catch(e){return console.error("Failed to update provider connection:",e),h("Failed to update the provider connection.","error"),null}},M=async(e,i)=>{await S([...n,e]);let r=await T(e.slug,!0),a=r?.find(t=>t.slug.trim().toLowerCase()===e.slug.trim().toLowerCase());o(a?.id||e.id),x(!1),t?.(),i.fetchedCount>0?h(`Fetched ${i.fetchedCount} new model${1===i.fetchedCount?"":"s"} from the provider.`,"success"):-1===i.fetchedCount&&h("Auto-fetch models failed — provider added with default models.","error"),eQ(e.name,e.models)},z=async e=>{C&&(await S(n.map(t=>t.id===C.id?{...t,...e,status:"connected"}:t)),"connected"!==C.status&&await T(C.slug,!0))},P=async e=>{if(!C||p)return;let t=e.baseUrl||C.baseUrl;if(!t)return void h("Base URL is required to fetch models.","error");u(!0);try{var n;let i=await eV(t,e.apiKey||C.apiKey,C.slug,!0);if(!i.ok||!i.models)return void h(i.error||"Failed to fetch models from the provider.","error");let r=(n=C.models,`${C.name} ${C.slug} ${C.baseUrl||""}`.toLowerCase().includes("kenari")?n.filter(e=>{let t=e.name.trim().toLowerCase();return!(eZ.test(e.id)&&("kenari default model"===t||"kenari fast / flash"===t))}):n),a=C.models.length-r.length,{merged:l,addedCount:s}=function(e,t){let n=new Set(e.map(e=>e.id)),i=[];for(let e of t)!e.id||n.has(e.id)||(n.add(e.id),i.push({...e}));return{merged:[...e,...i],added:i,addedCount:i.length}}(r,i.models);if((s>0||a>0)&&await z({models:l}),i.omp?.written&&eq(),s>0?h(`Fetched ${s} new model${1===s?"":"s"} from the provider.`,"success"):a>0?h("Removed legacy fallback models from the provider.","success"):h("No new models found — all fetched models already exist.","success"),i.omp?.written){let e=[];i.omp.addedCount>0&&e.push(`${i.omp.addedCount} new model${1===i.omp.addedCount?"":"s"} registered`),i.omp.backfilledCount>0&&e.push(`${i.omp.backfilledCount} model${1===i.omp.backfilledCount?"":"s"} enriched`),h(`omp models.yml updated${e.length>0?`: ${e.join(", ")}`:""}.`,"success")}else i.omp&&!i.omp.written&&i.omp.reason&&h(`omp models.yml not updated: ${i.omp.reason}`,"error")}finally{u(!1)}},L=async()=>{C&&await P({apiKey:C.apiKey,baseUrl:C.baseUrl})},j=async()=>{if(!C)return;let e="connected"===C.status;e&&o(A.find(e=>e.id!==C.id)?.id||""),await T(C.slug,!e)&&h(e?`${C.name} disconnected — its models are no longer offered in the chat picker.`:`${C.name} reconnected.`,"success")},R=e=>{C&&S(n.map(t=>t.id===C.id?{...t,models:e(t.models)}:t))},I=async()=>{if(!C)return;let e=!0!==C.disabled;await T(C.slug,!e)&&h(e?`${C.name} disabled — it no longer appears in the model list.`:`${C.name} enabled — its models are offered again.`,"success")};return{providers:n,connectedProviders:A,availablePresetProviders:F,selectedProvider:C,currentProject:c,setCurrentProject:d,isFetchingModels:p,toasts:m,pushToast:h,dismissToast:b,isAddModalOpen:f,setIsAddModalOpen:x,isReconnectModalOpen:g,setIsReconnectModalOpen:v,isLoginModalOpen:k,setIsLoginModalOpen:y,configModel:w,setConfigModel:N,capabilitiesModel:Y,setCapabilitiesModel:D,setSelectedProviderId:o,handleAddProvider:M,handleReconnect:z,handleFetchModels:P,handleFetchModelsFromList:L,handleOmpAuthSuccess:()=>{C&&(S(n.map(e=>e.id===C.id?{...e,status:"connected"}:e)),T(C.slug,!0))},handleToggleDisconnect:j,handleToggleProviderDisabled:I,handleHideAll:()=>R(e=>e.map(e=>({...e,isVisible:!1}))),handleShowAll:()=>R(e=>e.map(e=>({...e,isVisible:!0}))),handleToggleModelVisibility:e=>R(t=>t.map(t=>t.id===e?{...t,isVisible:!t.isVisible}:t)),handleSaveModelConfig:(e,t)=>R(n=>n.map(n=>n.id===e?{...n,...t}:n))}}({autoOpenAdd:t,onAddModalClose:n});return(0,i.FD)("div",{className:"w-full h-full flex flex-col md:flex-row overflow-hidden bg-paper text-ink",children:[(0,i.Y)(e4,{providers:r,selectedProviderId:s?.id||"",onSelectProvider:N,onOpenAddModal:()=>h(!0),currentProject:o,onSelectProject:c}),(0,i.Y)("div",{className:"flex-1 scrollbar-overlay-container scrollbar-overlay-static p-6 md:p-8 space-y-6",children:s?(0,i.FD)(i.FK,{children:[(0,i.Y)(e6,{provider:s}),(0,i.Y)(e9,{provider:s,onOpenReconnectModal:()=>{s.id.startsWith("omp-auth-")?g(!0):f(!0)},onToggleDisconnect:S,onToggleDisabled:T}),(0,i.Y)(to,{models:s.models,onToggleModelVisibility:P,onHideAll:M,onShowAll:z,onFetchModels:F,canFetchModels:!!s.baseUrl,isFetchingModels:d,onOpenModelConfig:e=>k(e),onOpenModelCapabilities:e=>w(e)})]}):(0,i.Y)("div",{className:"py-12 text-center text-xs text-ink/40",children:"Select a provider from the sidebar to view connection details"})}),(0,i.Y)(eU.y,{toasts:p,onDismiss:u}),(0,i.Y)(tm,{isOpen:m,onClose:()=>{h(!1),n?.()},onAddProvider:Y,presets:l}),s&&(0,i.Y)(tb,{isOpen:b,provider:s,isFetchingModels:d,onClose:()=>f(!1),onReconnect:D,onFetchModels:A}),s&&(0,i.Y)(tx,{isOpen:x,provider:s,onClose:()=>g(!1),onAuthenticated:C}),(0,i.Y)(tg,{isOpen:!!v,model:v,onClose:()=>k(null),onSaveModelConfig:L}),(0,i.Y)(tk,{isOpen:!!y,model:y,onClose:()=>w(null)})]})}let tw=[{id:"ompchamber",name:"ompchamber",label:"ompchamber"},{id:"workspace-edge",name:"workspace-edge",label:"workspace-edge"},{id:"global",name:"global config",label:"Global (All Projects)"}],tN=(e,t)=>t,tY=e=>{let{selectedProject:t,onChangeProject:n,options:r=tw,getTriggerLabel:l=tN,variant:s="default"}=e,[o,c]=(0,a.J0)(!1),d=(0,a.li)(null);(0,eM.W)(d,()=>c(!1));let p=l(r,t),u=r.map(e=>{let r=e.value??e.id,a=t===r;return(0,i.Y)("button",{type:"button",onClick:()=>{n(r),c(!1)},className:"compact"===s?`w-full text-left px-3 py-1.5 text-xs flex items-center justify-between hover:bg-ink/5 transition-colors cursor-pointer ${a?"text-ink font-semibold bg-ink/5":"text-ink/70"}`:`w-full px-3 py-1.5 text-left text-xs flex items-center justify-between hover:bg-ink/5 transition-colors cursor-pointer ${a?"font-semibold text-ink bg-ink/5":"text-ink/80"}`,children:"compact"===s?(0,i.FD)(i.FK,{children:[(0,i.Y)("span",{className:"truncate",children:e.label}),a&&(0,i.Y)(D.A,{size:12,className:"text-ink flex-shrink-0"})]}):(0,i.FD)("div",{className:"flex items-center gap-2 truncate",children:[(0,i.Y)(es.A,{size:13,className:"text-ink/60"}),(0,i.Y)("span",{className:"truncate",children:e.name})]})},e.id)});return"compact"===s?(0,i.FD)("div",{className:"p-2.5 border-b border-ink/10 relative",ref:d,children:[(0,i.FD)("button",{type:"button",onClick:()=>c(!o),className:"w-full flex items-center justify-between px-2.5 py-1.5 rounded-lg border border-ink/20 hover:border-ink/40 bg-paper text-xs text-ink transition-colors cursor-pointer",children:[(0,i.FD)("div",{className:"flex items-center gap-2 truncate",children:[(0,i.Y)(es.A,{size:14,className:"text-ink/60 flex-shrink-0"}),(0,i.Y)("span",{className:"truncate font-medium",children:p})]}),(0,i.Y)(eT.A,{size:14,className:"text-ink/50 flex-shrink-0"})]}),o&&(0,i.FD)(i.FK,{children:[(0,i.Y)("div",{className:"fixed inset-0 z-20",onClick:()=>c(!1)}),(0,i.Y)("div",{className:"absolute left-2.5 right-2.5 top-12 z-30 bg-paper border border-ink/15 rounded-lg shadow-lg py-1 animate-in fade-in zoom-in-95 duration-100",children:u})]})]}):(0,i.FD)("div",{className:"p-3 border-b border-ink/10 relative",ref:d,children:[(0,i.FD)("button",{type:"button",onClick:()=>c(!o),className:"w-full flex items-center justify-between gap-2 px-3 py-1.5 rounded-lg border border-ink/20 hover:border-ink/40 bg-paper text-ink text-xs font-medium transition-colors cursor-pointer shadow-2xs",children:[(0,i.FD)("div",{className:"flex items-center gap-2 truncate",children:[(0,i.Y)(es.A,{size:14,className:"text-ink/60 flex-shrink-0"}),(0,i.Y)("span",{className:"truncate",children:p})]}),(0,i.Y)(eT.A,{size:14,className:"text-ink/50 flex-shrink-0"})]}),o&&(0,i.Y)("div",{className:"absolute top-12 left-3 right-3 bg-paper border border-ink/20 rounded-lg shadow-lg z-30 py-1 divide-y divide-ink/5 animate-in fade-in zoom-in-95 duration-100",children:u})]})},tD=e=>{let{items:t,selectedId:n,onSelect:r,onAddNew:a,addTitle:l,builtInLabel:s,customLabel:o,formatName:c,nameClassName:d,renderIcon:p,selectedProject:u,onChangeProject:m}=e,h=t.filter(e=>e.isBuiltIn),b=t.filter(e=>!e.isBuiltIn),f=e=>{let t=e.id===n;return(0,i.FD)("button",{type:"button",onClick:()=>r(e.id),className:`w-full text-left px-2.5 py-2 rounded-lg transition-colors cursor-pointer flex flex-col gap-0.5 group ${t?"bg-ink/10 text-ink font-medium shadow-2xs":"text-ink/80 hover:bg-ink/5 hover:text-ink"}`,children:[(0,i.FD)("div",{className:"flex items-center justify-between gap-1.5",children:[(0,i.FD)("div",{className:"flex items-center gap-1.5 min-w-0",children:[p(!!e.isBuiltIn),(0,i.Y)("span",{className:d,children:c(e.name)})]}),(0,i.Y)("span",{className:"text-[10px] font-mono uppercase px-1.5 py-0.5 rounded bg-ink/10 text-ink/70 font-medium",children:e.scope})]}),(0,i.Y)("p",{className:"text-[11px] text-ink/60 line-clamp-1 leading-snug pl-5",children:e.description})]},e.id)};return(0,i.FD)("div",{className:"w-56 sm:w-64 border-r border-ink/10 h-full flex flex-col bg-paper/50 flex-shrink-0 select-none",children:[(0,i.Y)(tY,{selectedProject:u,onChangeProject:m}),(0,i.FD)("div",{className:"px-3.5 py-2.5 border-b border-ink/10 flex items-center justify-between",children:[(0,i.FD)("span",{className:"text-xs font-semibold text-ink",children:["Total ",t.length]}),(0,i.Y)("button",{type:"button",onClick:a,title:l,className:"p-1 rounded text-ink/60 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer",children:(0,i.Y)(g.A,{size:15,strokeWidth:2.2})})]}),(0,i.FD)("div",{className:"flex-1 scrollbar-overlay-container scrollbar-overlay-static p-1.5 space-y-3 text-xs",children:[(0,i.FD)("div",{children:[(0,i.Y)("div",{className:"px-2.5 pt-1.5 pb-1 text-[10px] font-bold text-ink/50 uppercase tracking-wider",children:s}),(0,i.Y)("div",{className:"space-y-0.5",children:h.map(f)})]}),(0,i.FD)("div",{children:[(0,i.FD)("div",{className:"px-2.5 pt-1.5 pb-1 text-[10px] font-bold text-ink/50 uppercase tracking-wider flex items-center justify-between",children:[(0,i.Y)("span",{children:o}),(0,i.Y)("span",{className:"text-[10px] font-normal",children:b.length})]}),(0,i.Y)("div",{className:"space-y-0.5",children:b.map(f)})]})]})]})},tA=e=>{let{agents:t,selectedAgentId:n,onSelectAgent:r,onAddNewAgent:a,selectedProject:l,onChangeProject:s}=e;return(0,i.Y)(tD,{items:t,selectedId:n,onSelect:r,onAddNew:a,addTitle:"Create new agent",builtInLabel:"Built-in Agents",customLabel:"Custom Agents",formatName:e=>e,nameClassName:"font-semibold text-xs text-ink truncate",selectedProject:l,onChangeProject:s,renderIcon:e=>(0,i.FD)("div",{className:"relative",children:[(0,i.Y)(I.A,{className:`w-3.5 h-3.5 ${e?"text-ink/80":"text-ink/60"} flex-shrink-0`}),e&&(0,i.Y)("span",{className:"absolute -top-0.5 -right-0.5 w-1.5 h-1.5 rounded-full bg-ink"})]})})};var tF=n("Tw"),tC=n("DV"),tS=n("b0");let tT=["Not selected","claude-3-7-sonnet-20250219","claude-3-5-sonnet-20241022","claude-3-5-haiku-20241022","gpt-4o","gpt-4o-mini","o3-mini","gemini-2.5-pro-preview-03-25","gemini-2.5-flash","deepseek-chat-v3","deepseek-reasoner-r1"],tM=e=>{let{agent:t,isNew:n=!1,onSave:r,onDelete:l}=e,[s,o]=(0,a.J0)(t),[c,d]=(0,a.J0)(!1),[p,u]=(0,a.J0)(!1);(0,a.vJ)(()=>{o(t),d(!1)},[t]);let m=e=>{o(t=>{let n=Math.max(0,Math.min(2,parseFloat(((t.temperature??.7)+e).toFixed(2))));return{...t,temperature:n}})},h=e=>{o(t=>{let n=Math.max(0,Math.min(1,parseFloat(((t.topP??.95)+e).toFixed(2))));return{...t,topP:n}})};return(0,i.FD)("form",{onSubmit:e=>{e.preventDefault(),r(s),d(!0),setTimeout(()=>d(!1),2e3)},className:"flex-1 flex flex-col h-full scrollbar-overlay-container scrollbar-overlay-static bg-paper text-ink p-6 md:p-8 space-y-6",children:[(0,i.FD)("div",{className:"space-y-3",children:[(0,i.FD)("div",{className:"flex items-center justify-between",children:[(0,i.Y)("h2",{className:"text-xs font-bold uppercase tracking-wider text-ink",children:"Identity & Role"}),s.isBuiltIn&&(0,i.Y)("span",{className:"text-[10px] font-mono px-2 py-0.5 rounded-md bg-ink/5 border border-ink/10 text-ink/60",children:"Built-in System Agent (Read-only System Core)"})]}),(0,i.FD)("div",{className:"flex items-center gap-3",children:[(0,i.FD)("div",{className:"flex-1",children:[(0,i.Y)("label",{className:"block text-xs font-semibold text-ink/80 mb-1.5",children:"Agent Name"}),(0,i.FD)("div",{className:"flex items-center border border-ink/20 hover:border-ink/40 focus-within:border-ink rounded-lg bg-paper transition-colors",children:[(0,i.Y)("span",{className:"px-3 py-2 font-mono text-xs text-ink/40 border-r border-ink/15 select-none",children:"@"}),(0,i.Y)("input",{type:"text",value:s.name,onChange:e=>o({...s,name:e.currentTarget.value}),required:!0,placeholder:"agent-name",disabled:s.isBuiltIn,className:"w-full text-xs font-mono px-3 py-2 bg-transparent focus:outline-none disabled:opacity-60 text-ink"})]})]}),(0,i.FD)("div",{className:"w-40",children:[(0,i.Y)("label",{className:"block text-xs font-semibold text-ink/80 mb-1.5",children:"Scope"}),(0,i.FD)("select",{value:s.scope,onChange:e=>o({...s,scope:e.currentTarget.value}),disabled:s.isBuiltIn,className:"w-full text-xs py-2 px-3 rounded-lg border border-ink/20 hover:border-ink/40 bg-paper focus:outline-none focus:border-ink disabled:opacity-60 text-ink transition-colors cursor-pointer",children:[(0,i.Y)("option",{value:"user",children:"user"}),(0,i.Y)("option",{value:"project",children:"project"}),(0,i.Y)("option",{value:"system",children:"system"})]})]})]}),(0,i.FD)("div",{children:[(0,i.Y)("label",{className:"block text-xs font-semibold text-ink/80 mb-1.5",children:"Description"}),(0,i.Y)("textarea",{value:s.description,onChange:e=>o({...s,description:e.currentTarget.value}),placeholder:"What does this agent do?",rows:2,className:"w-full text-xs p-3 rounded-lg border border-ink/20 hover:border-ink/40 bg-paper focus:outline-none focus:border-ink placeholder:text-ink/30 text-ink transition-colors"})]}),(0,i.FD)("div",{children:[(0,i.FD)("div",{className:"flex items-center gap-1.5 mb-1.5",children:[(0,i.Y)("label",{className:"text-xs font-semibold text-ink/80",children:"Mode"}),(0,i.Y)("span",{title:"Defines agent delegation context (primary, subagent, or all)",children:(0,i.Y)(eC.A,{className:"w-3.5 h-3.5 text-ink/40"})})]}),(0,i.Y)("div",{className:"inline-flex rounded-lg border border-ink/15 p-0.5 bg-ink/5",children:["primary","subagent","all"].map(e=>(0,i.Y)("button",{type:"button",onClick:()=>o({...s,mode:e}),className:`px-3 py-1 text-xs rounded-md transition-colors cursor-pointer capitalize ${s.mode===e?"bg-paper text-ink shadow-xs font-semibold":"text-ink/60 hover:text-ink"}`,children:e},e))})]})]}),(0,i.Y)("div",{className:"border-t border-ink/10"}),(0,i.FD)("div",{className:"space-y-3",children:[(0,i.Y)("h2",{className:"text-xs font-bold uppercase tracking-wider text-ink",children:"Model & Parameters"}),(0,i.FD)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,i.FD)("div",{children:[(0,i.Y)("label",{className:"block text-xs font-semibold text-ink/80 mb-1.5",children:"Override Model"}),(0,i.FD)("div",{className:"flex items-center border border-ink/20 hover:border-ink/40 focus-within:border-ink rounded-lg bg-paper transition-colors",children:[(0,i.Y)("span",{className:"px-2.5 text-ink/40",children:(0,i.Y)(tF.A,{className:"w-3.5 h-3.5"})}),(0,i.Y)("select",{value:s.overrideModel||"Not selected",onChange:e=>o({...s,overrideModel:e.currentTarget.value}),className:"w-full text-xs font-mono py-2 pr-3 bg-transparent focus:outline-none cursor-pointer text-ink",children:tT.map(e=>(0,i.Y)("option",{value:e,children:e},e))})]})]}),(0,i.FD)("div",{children:[(0,i.FD)("div",{className:"flex items-center gap-1 mb-1.5",children:[(0,i.Y)("label",{className:"text-xs font-semibold text-ink/80",children:"Thinking Variant"}),(0,i.Y)("span",{title:"Controls chain-of-thought token depth",children:(0,i.Y)(eC.A,{className:"w-3.5 h-3.5 text-ink/40"})})]}),(0,i.Y)("input",{type:"text",value:s.thinkingVariant||"default",onChange:e=>o({...s,thinkingVariant:e.currentTarget.value}),placeholder:"default",className:"w-full text-xs font-mono px-3 py-2 rounded-lg border border-ink/20 hover:border-ink/40 bg-paper focus:outline-none focus:border-ink text-ink transition-colors"})]}),(0,i.FD)("div",{children:[(0,i.FD)("div",{className:"flex items-center gap-1 mb-1.5",children:[(0,i.Y)("label",{className:"text-xs font-semibold text-ink/80",children:"Temperature"}),(0,i.Y)("span",{title:"Higher values make output more random, lower values more deterministic",children:(0,i.Y)(eC.A,{className:"w-3.5 h-3.5 text-ink/40"})})]}),(0,i.FD)("div",{className:"flex items-center border border-ink/20 rounded-lg max-w-[150px] bg-paper overflow-hidden",children:[(0,i.Y)("button",{type:"button",onClick:()=>m(-.05),className:"px-3 py-1.5 text-ink/60 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer",children:(0,i.Y)(tC.A,{className:"w-3.5 h-3.5"})}),(0,i.Y)("span",{className:"flex-1 text-center font-mono text-xs font-medium text-ink",children:null!=s.temperature?s.temperature.toFixed(2):"—"}),(0,i.Y)("button",{type:"button",onClick:()=>m(.05),className:"px-3 py-1.5 text-ink/60 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer",children:(0,i.Y)(g.A,{className:"w-3.5 h-3.5"})})]})]}),(0,i.FD)("div",{children:[(0,i.FD)("div",{className:"flex items-center gap-1 mb-1.5",children:[(0,i.Y)("label",{className:"text-xs font-semibold text-ink/80",children:"Top P"}),(0,i.Y)("span",{title:"Nucleus sampling cutoff",children:(0,i.Y)(eC.A,{className:"w-3.5 h-3.5 text-ink/40"})})]}),(0,i.FD)("div",{className:"flex items-center border border-ink/20 rounded-lg max-w-[150px] bg-paper overflow-hidden",children:[(0,i.Y)("button",{type:"button",onClick:()=>h(-.05),className:"px-3 py-1.5 text-ink/60 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer",children:(0,i.Y)(tC.A,{className:"w-3.5 h-3.5"})}),(0,i.Y)("span",{className:"flex-1 text-center font-mono text-xs font-medium text-ink",children:null!=s.topP?s.topP.toFixed(2):"—"}),(0,i.Y)("button",{type:"button",onClick:()=>h(.05),className:"px-3 py-1.5 text-ink/60 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer",children:(0,i.Y)(g.A,{className:"w-3.5 h-3.5"})})]})]})]})]}),(0,i.Y)("div",{className:"border-t border-ink/10"}),(0,i.FD)("div",{className:"space-y-2 flex-1 flex flex-col",children:[(0,i.FD)("div",{className:"flex items-center justify-between",children:[(0,i.Y)("label",{className:"text-xs font-bold uppercase tracking-wider text-ink",children:"System Prompt"}),(0,i.FD)("button",{type:"button",onClick:()=>{navigator.clipboard.writeText(s.systemPrompt),u(!0),setTimeout(()=>u(!1),1800)},className:"flex items-center gap-1.5 text-xs text-ink/60 hover:text-ink transition-colors cursor-pointer",children:[p?(0,i.Y)(D.A,{className:"w-3.5 h-3.5 text-ink"}):(0,i.Y)(tS.A,{className:"w-3.5 h-3.5"}),(0,i.Y)("span",{children:p?"Copied":"Copy"})]})]}),(0,i.Y)("textarea",{value:s.systemPrompt,onChange:e=>o({...s,systemPrompt:e.currentTarget.value}),rows:7,placeholder:"You are an expert coding assistant...",className:"w-full flex-1 min-h-[140px] text-xs font-mono p-3 rounded-lg border border-ink/20 hover:border-ink/40 bg-ink/5 focus:outline-none focus:border-ink leading-relaxed transition-colors"})]}),(0,i.FD)("div",{className:"pt-3 border-t border-ink/10 flex items-center justify-between",children:[(0,i.Y)("div",{children:!s.isBuiltIn&&!n&&l&&(0,i.FD)("button",{type:"button",onClick:()=>l(s.id),className:"flex items-center gap-1.5 px-3.5 py-2 rounded-lg border border-ink/20 hover:border-error hover:text-error text-ink/70 text-xs font-medium transition-colors cursor-pointer",children:[(0,i.Y)(eD.A,{className:"w-3.5 h-3.5"}),"Delete Agent"]})}),(0,i.FD)("div",{className:"flex items-center gap-3",children:[c&&(0,i.FD)("span",{className:"flex items-center gap-1 text-xs text-ink font-medium",children:[(0,i.Y)(D.A,{className:"w-3.5 h-3.5"}),"Saved successfully"]}),(0,i.Y)("button",{type:"submit",className:"px-4 py-2 rounded-lg bg-ink text-paper text-xs font-medium hover:bg-ink/90 transition-colors shadow-xs cursor-pointer",children:n?"Create Agent":"Save Agent"})]})]})]})},tz="agent",tP="command",tL=new Map,tj=new Map;async function tR(e){let t=await fetch(e);if(!t.ok)throw Error(`GET ${e} failed: ${t.status}`);let n=await t.json();if(!n||"object"!=typeof n)throw Error(`GET ${e} returned malformed JSON`);return n}async function tI(){let e=tL.get(tz);if(e&&e.expiresAt>Date.now())return e.data;let t=tj.get(tz);if(t)return t;let n=(async()=>{try{let e=(await tR("/api/settings/agents")).agents.map(e=>({id:`agent-${e.name}`,name:e.name,description:e.description,kind:"agent",source:"agent",token:`@${e.name}`}));return tL.set(tz,{data:e,expiresAt:Date.now()+3e5}),e}finally{tj.delete(tz)}})();return tj.set(tz,n),n}async function tE(e){let t,n=(t=e??"",`file::${t}`),i=tL.get(n);if(i&&i.expiresAt>Date.now())return i.data;let r=tj.get(n);if(r)return r;let a=(async()=>{try{let t=e?`?root=${encodeURIComponent(e)}`:"",i=await tR(`/api/fs/list${t}`),r=(Array.isArray(i.files)?i.files:[]).map(e=>({id:`file-${e.path}`,name:e.path,description:"",kind:"file",source:"file",token:/\s/.test(e.path)?`@"file:${e.path}"`:`@file:${e.path}`,path:e.path}));return tL.set(n,{data:r,expiresAt:Date.now()+3e5}),r}catch{return[]}finally{tj.delete(n)}})();return tj.set(n,a),a}async function t$(){let e=tL.get(tP);if(e&&e.expiresAt>Date.now())return e.data;let t=tj.get(tP);if(t)return t;let n=(async()=>{try{let[e,t]=await Promise.all([tR("/api/settings/commands"),tR("/api/settings/skills")]),n=function(e,t){let n=[],i=new Set;for(let t of e){let e=t.name.toLowerCase();i.has(e)||(i.add(e),n.push({id:`command-${t.name}`,name:t.name,description:t.description,kind:"command",source:"command",token:`/${t.name}`}))}for(let e of t){let t=e.name.toLowerCase(),r=`skill:${t}`;i.has(t)||i.has(r)||(i.add(r),n.push({id:`skill-${e.name}`,name:e.name,description:e.description,kind:"command",source:"skill",token:`/skill:${e.name}`}))}return n}(e.commands,t.skills);return tL.set(tP,{data:n,expiresAt:Date.now()+3e5}),n}finally{tj.delete(tP)}})();return tj.set(tP,n),n}async function tO(){try{return(await tI()).map(e=>e.name)}catch{return[]}}function tJ(e){if(e){tL.delete(e),tj.delete(e);return}tL.clear(),tj.clear()}function t_(e){let{endpoint:t,listKey:n,query:i,messages:r,cacheKey:l}=e,[s,o]=(0,a.J0)([]),[c,d]=(0,a.J0)(null),[p,u]=(0,a.J0)(!1),[m,h]=(0,a.J0)(!0),b=e.readList??(e=>{let t=e?.[n];return Array.isArray(t)?t:null});(0,a.vJ)(()=>{let n=!0;return fetch(`${t}${i??""}`).then(e=>e.json()).then(t=>{if(!n)return;let i=b(t)??[];o(i),d(t=>e.resolveOnLoad?e.resolveOnLoad(t,i):i.length>0?i[0].id:null)}).catch(e=>console.error(r.load,e)).finally(()=>{n&&h(!1)}),()=>{n=!1}},[t,i]);let f=!1===e.fallbackToFirst?s.find(e=>e.id===c):s.find(e=>e.id===c)??s[0];return{items:s,selectedId:c,selected:f,isCreatingNew:p,isLoading:m,select:e=>{u(!1),d(e)},startCreate:()=>{u(!0),d(null)},save:n=>{let i=p?e.buildNew(n):e.buildUpdate(n,f,c);fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e.buildBody?e.buildBody(i):{[e.bodyKey]:i})}).then(e=>e.json()).then(t=>{if(e.isSaveError?.(t))return;let n=b(t);n?o(n):e.serverListOnly||o(e=>e.some(e=>e.id===i.id)?e.map(e=>e.id===i.id?i:e):[...e,i]);let r=e.resolveOnSave?e.resolveOnSave(i,n):i.id;void 0!==r&&d(r),u(!1),l&&tJ(l)}).catch(e=>console.error(r.save,e))},remove:n=>{let a=e.buildDeleteQuery?e.buildDeleteQuery(n):`?id=${encodeURIComponent(n)}`;fetch(`${t}${a}`,{method:"DELETE"}).then(e=>e.json()).then(r=>{if(!e.isDeleteError?.(r))if(l&&tJ(l),e.deleteFromResponse){let e=b(r)??s.filter(e=>e.id!==n);o(e),c===n&&d(e[0]?.id??null)}else fetch(`${t}${i??""}`).then(e=>e.json()).then(e=>{let t=b(e)??[];o(t),c===n&&d(t[0]?.id||null)})}).catch(e=>console.error(r.delete,e))}}}let tU=()=>{let[e,t]=(0,a.J0)("ompchamber"),{items:n,selectedId:r,selected:l,isCreatingNew:s,isLoading:o,select:c,startCreate:d,save:p,remove:u}=t_({endpoint:"/api/settings/agents",listKey:"agents",bodyKey:"agent",messages:{load:"Failed to load agents from API:",save:"Failed to save agent via API:",delete:"Failed to delete agent via API:"},cacheKey:"agent",buildNew:e=>({...e,id:`agent-${Date.now()}`,isBuiltIn:!1}),buildUpdate:e=>e,isDeleteError:e=>!!e?.error}),m={id:`new-${Date.now()}`,name:"new-agent",description:"",scope:"user",mode:"subagent",overrideModel:"Not selected",thinkingVariant:"default",temperature:null,topP:null,systemPrompt:"You are a specialized assistant...",isBuiltIn:!1};return o?(0,i.Y)(eJ,{children:"Loading agents from database..."}):(0,i.FD)("div",{className:"flex h-full w-full overflow-hidden bg-paper",children:[(0,i.Y)(tA,{agents:n,selectedAgentId:s?null:r,onSelectAgent:c,onAddNewAgent:d,selectedProject:e,onChangeProject:t}),(0,i.Y)("div",{className:"flex-1 h-full overflow-hidden flex flex-col",children:s?(0,i.Y)(tM,{agent:m,isNew:!0,onSave:p}):l?(0,i.Y)(tM,{agent:l,isNew:!1,onSave:p,onDelete:u},l.id):(0,i.Y)("div",{className:"flex-1 flex items-center justify-center text-xs font-mono text-ink/40",children:"Select an agent or click + to create one"})})]})};var tK=n("I"),tB=n("ES"),tW=n("uF");let tH={agents:{title:"Global AGENTS.md",badge:"context file",tooltip:"User context file omp loads when a session starts (~/.omp/agent/AGENTS.md, relocated by PI_CODING_AGENT_DIR). It shadows every other user-level context file, so it is the place for long-lived global rules. Recognizable permission directives are also mirrored into config.yml tools.approval. Saving empty content removes the file.",placeholder:"Type instructions in <mandatory_rules> tags..."},rules:{title:"Global RULES.md",badge:"sticky rule",tooltip:"User sticky rule (~/.omp/agent/RULES.md). Its whole body is re-sent on every request and re-read when a session starts or after /clear and /new, so it keeps its hold in long conversations — keep it to a few hard requirements. Saving empty content removes the file.",placeholder:"One hard requirement per line, e.g. Never commit or push unless asked."}},tq=e=>{let{kind:t,content:n,filePath:r,exists:l,isMock:s,onSave:o,onReset:c}=e,[d,p]=(0,a.J0)(n),[u,m]=(0,a.J0)(!1),[h,b]=(0,a.J0)(!1),[f,x]=(0,a.J0)(!1),[g,v]=(0,a.J0)(null),[k,y]=(0,a.J0)(null);(0,a.vJ)(()=>{p(n)},[n]);let w=tH[t],N=d.split("\n").length,Y=d.length,A=Math.round(Y/4),F=s?"Demo preset — MOCK=true, nothing is written to disk":r?`${r}${l?"":" · not created yet"}`:"Native path unavailable",C=async e=>{b(!0),v(null),y(null);try{let t=await e();if(t.error)return void v(t.error);y(t.note??null),x(!0),setTimeout(()=>x(!1),2e3)}finally{b(!1)}},S=async()=>{!c||window.confirm(`Replace ${r??"the stored content"} with the shipped default rules?`)&&await C(c)},T=e=>{p(t=>`${t.trim()}
|
|
17
|
-
|
|
18
|
-
${e}
|
|
19
|
-
`)};return(0,i.FD)("div",{className:"flex-1 flex flex-col h-full bg-paper text-ink p-6 md:p-8 overflow-hidden",children:[(0,i.FD)("div",{className:"flex items-center justify-between pb-4 border-b border-ink/10",children:[(0,i.FD)("div",{className:"flex items-center gap-2",children:[(0,i.FD)("h2",{className:"text-sm font-bold tracking-tight text-ink flex items-center gap-2",children:[(0,i.Y)("span",{children:w.title}),(0,i.Y)("span",{className:"text-[10px] uppercase tracking-wider px-1.5 py-0.5 rounded border border-ink/15 text-ink/50 font-medium",children:w.badge})]}),(0,i.FD)("div",{className:"group relative",children:[(0,i.Y)(eC.A,{className:"w-4 h-4 text-ink/40 cursor-help"}),(0,i.Y)("div",{className:"absolute left-0 top-6 hidden group-hover:block w-80 p-2.5 rounded-lg bg-ink text-paper text-xs shadow-lg z-20 leading-relaxed pointer-events-none",children:w.tooltip})]})]}),(0,i.FD)("div",{className:"flex items-center gap-2",children:[(0,i.FD)("button",{type:"button",onClick:()=>{navigator.clipboard.writeText(d),m(!0),setTimeout(()=>m(!1),2e3)},title:"Copy to clipboard",className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-lg border border-ink/20 hover:border-ink/40 hover:bg-ink/5 text-ink transition-colors cursor-pointer",children:[u?(0,i.Y)(D.A,{className:"w-3.5 h-3.5 text-ink"}):(0,i.Y)(tS.A,{className:"w-3.5 h-3.5"}),(0,i.Y)("span",{children:u?"Copied":"Copy"})]}),c&&(0,i.FD)("button",{type:"button",onClick:S,disabled:h,title:"Reset to default rules",className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-lg border border-ink/20 hover:border-ink/40 hover:bg-ink/5 text-ink transition-colors cursor-pointer disabled:opacity-50",children:[(0,i.Y)(tK.A,{className:"w-3.5 h-3.5"}),(0,i.Y)("span",{children:"Reset"})]}),(0,i.FD)("button",{type:"button",onClick:()=>C(()=>o(d)),disabled:h,className:"flex items-center gap-1.5 px-4 py-2 text-xs font-medium rounded-lg bg-ink text-paper hover:bg-ink/90 transition-colors shadow-xs cursor-pointer disabled:opacity-50",children:[f?(0,i.Y)(D.A,{className:"w-3.5 h-3.5"}):(0,i.Y)(tB.A,{className:"w-3.5 h-3.5"}),(0,i.Y)("span",{children:h?"Saving…":f?"Saved":"Save Changes"})]})]})]}),(g||k)&&(0,i.Y)("div",{className:`pt-3 text-xs font-mono break-words ${g?"text-error":"text-ink/60"}`,children:g??k}),(0,i.FD)("div",{className:"py-3 flex items-center gap-2 overflow-x-auto text-xs border-b border-ink/10",children:[(0,i.Y)("span",{className:"text-ink/50 uppercase tracking-wider text-[10px] font-bold whitespace-nowrap",children:"Quick Insert:"}),(0,i.FD)("button",{type:"button",onClick:()=>T(`<mandatory_rules>
|
|
20
|
-
ALWAY USE CODEGRAPH (codegraph_codegraph_explore) TOOL MCP FIRST BEFORE OTHER TOOL BUILT-IN.
|
|
21
|
-
</mandatory_rules>`),className:"px-2.5 py-1 text-xs font-mono rounded-md bg-ink/5 hover:bg-ink/10 border border-ink/15 whitespace-nowrap transition-colors flex items-center gap-1.5 text-ink cursor-pointer",children:[(0,i.Y)(tW.A,{className:"w-3.5 h-3.5 text-ink/60"}),"+ CodeGraph Rule"]}),(0,i.FD)("button",{type:"button",onClick:()=>T(`<mandatory_rules>
|
|
22
|
-
IF SUBAGENT NOT DEFINE MODELID, DELEGATE TASK USING INHERIT WITH PARENT MODELID.
|
|
23
|
-
</mandatory_rules>`),className:"px-2.5 py-1 text-xs font-mono rounded-md bg-ink/5 hover:bg-ink/10 border border-ink/15 whitespace-nowrap transition-colors flex items-center gap-1.5 text-ink cursor-pointer",children:[(0,i.Y)(tv.A,{className:"w-3.5 h-3.5 text-ink/60"}),"+ Model Inheritance"]}),(0,i.FD)("button",{type:"button",onClick:()=>T(`<mandatory_rules>
|
|
24
|
-
WHEN COMMIT, ALWAYS USE CONVENTIONAL COMMIT. JANGAN COMMIT SAMPAI AKU MINTA.
|
|
25
|
-
</mandatory_rules>`),className:"px-2.5 py-1 text-xs font-mono rounded-md bg-ink/5 hover:bg-ink/10 border border-ink/15 whitespace-nowrap transition-colors flex items-center gap-1.5 text-ink cursor-pointer",children:[(0,i.Y)(tv.A,{className:"w-3.5 h-3.5 text-ink/60"}),"+ Conventional Commit Guard"]})]}),(0,i.FD)("div",{className:"flex-1 min-h-0 mt-3 rounded-lg border border-ink/20 hover:border-ink/40 bg-ink/5 overflow-hidden flex flex-col font-mono text-xs focus-within:border-ink transition-colors",children:[(0,i.FD)("div",{className:"flex-1 flex overflow-hidden",children:[(0,i.Y)("div",{className:"w-10 py-3 pr-2 select-none text-right font-mono text-xs text-ink/30 border-r border-ink/10 bg-ink/[0.02] overflow-hidden leading-relaxed",children:Array.from({length:Math.max(N,12)}).map((e,t)=>(0,i.Y)("div",{children:t+1},t))}),(0,i.Y)("textarea",{value:d,onChange:e=>p(e.currentTarget.value),spellcheck:!1,className:"flex-1 p-3 bg-transparent text-ink font-mono text-xs leading-relaxed resize-none focus:outline-none overflow-y-auto",placeholder:w.placeholder})]}),(0,i.FD)("div",{className:"p-2.5 border-t border-ink/10 bg-paper flex items-center justify-between gap-4 text-xs font-mono text-ink/60",children:[(0,i.FD)("div",{className:"flex items-center gap-4 shrink-0",children:[(0,i.FD)("span",{children:[N," lines"]}),(0,i.FD)("span",{children:[Y," chars"]}),(0,i.FD)("span",{children:["~",A," tokens"]})]}),(0,i.FD)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,i.Y)("span",{className:`w-2 h-2 rounded-full shrink-0 ${l&&!s?"bg-ink/60":"bg-ink/25"}`}),(0,i.Y)("span",{className:"truncate",title:F,children:F})]})]})]})]})};function tG(e){let[t,n]=(0,a.J0)(""),[i,r]=(0,a.J0)(null),[l,s]=(0,a.J0)(!1),[o,c]=(0,a.J0)(!1),[d,p]=(0,a.J0)(!0),[u,m]=(0,a.J0)(null),h=(0,a.hb)(e=>{"string"==typeof e.rules&&n(e.rules),r("string"==typeof e.path?e.path:null),s(!0===e.exists),c(!0===e.isMock)},[]);(0,a.vJ)(()=>{let t=!0;return m(null),fetch(`/api/settings/behavior?file=${e}`).then(e=>e.json()).then(e=>{if(t){if(e.error)return void m(e.error);h(e)}}).catch(e=>{t&&m(e instanceof Error?e.message:String(e))}).finally(()=>{t&&p(!1)}),()=>{t=!1}},[h,e]);let b=(0,a.hb)(async t=>{try{let n=await fetch("/api/settings/behavior",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...t,file:e})}),i=await n.json();if(i.error)return{error:i.error};if(h(i),i.nativeError)return{note:`Saved, but the approval mapping was skipped: ${i.nativeError}`};if(i.nativeSynced)return{note:"Saved — recognized permission gates were mirrored into config.yml tools.approval."};return{}}catch(e){return{error:e instanceof Error?e.message:String(e)}}},[h,e]);return{content:t,filePath:i,exists:l,isMock:o,isLoading:d,error:u,save:e=>b({rules:e}),reset:()=>b({action:"reset"})}}let tV=[{kind:"agents",label:"AGENTS.md",hint:"context file"},{kind:"rules",label:"RULES.md",hint:"sticky rule"}],tQ=()=>{let[e,t]=(0,a.J0)("agents"),n=tG("agents"),r=tG("rules"),l="agents"===e?n:r,s=tV.find(t=>t.kind===e)??tV[0];return(0,i.FD)("div",{className:"h-full w-full overflow-hidden flex flex-col bg-paper",children:[(0,i.Y)("div",{className:"flex items-center gap-1.5 px-6 md:px-8 pt-5",children:tV.map(n=>(0,i.FD)("button",{type:"button",onClick:()=>t(n.kind),className:`px-3 py-1.5 text-xs font-mono rounded-lg border transition-colors cursor-pointer ${n.kind===e?"border-ink bg-ink text-paper":"border-ink/20 text-ink/60 hover:border-ink/40 hover:bg-ink/5"}`,children:[n.label,(0,i.Y)("span",{className:"ml-2 opacity-60",children:n.hint})]},n.kind))}),l.error&&(0,i.FD)("div",{className:"mx-6 md:mx-8 mt-3 px-3 py-2 text-xs font-mono text-error bg-error/5 border border-error/30 rounded-lg",children:["Failed to load ",l.filePath??s.label,": ",l.error]}),l.isLoading?(0,i.FD)(eJ,{variant:"fill",children:["Loading ",s.label," from ",l.filePath??"the preset store","..."]}):(0,i.Y)(tq,{kind:e,content:l.content,filePath:l.filePath,exists:l.exists,isMock:l.isMock,onSave:l.save,onReset:"agents"===e?l.reset:void 0},e)]})},tZ=e=>{let{commands:t,selectedCommandId:n,onSelectCommand:r,onAddNewCommand:a,selectedProject:l,onChangeProject:s}=e;return(0,i.Y)(tD,{items:t,selectedId:n,onSelect:r,onAddNew:a,addTitle:"Create new command",builtInLabel:"Built-in Commands",customLabel:"Custom Commands",formatName:e=>`/${e}`,nameClassName:"font-mono font-semibold text-xs text-ink truncate",selectedProject:l,onChangeProject:s,renderIcon:e=>(0,i.Y)(w.A,{className:`w-3.5 h-3.5 ${e?"text-ink/70":"text-ink/60"} flex-shrink-0`})})},tX=["Not selected","claude-3-7-sonnet-20250219","claude-3-5-sonnet-20241022","claude-3-5-haiku-20241022","gpt-4o","gpt-4o-mini","gemini-2.5-pro-preview-03-25","deepseek-chat-v3"],t0=e=>{let{command:t,isNew:n=!1,onSave:r,onDelete:l}=e,[s,o]=(0,a.J0)(t),[c,d]=(0,a.J0)(!1),[p,u]=(0,a.J0)(!1),[m,h]=(0,a.J0)([]);(0,a.vJ)(()=>{fetch("/api/settings/agents").then(e=>e.json()).then(e=>{e?.agents&&h(e.agents)}).catch(console.error)},[]),(0,a.vJ)(()=>{o(t),d(!1)},[t]);let b=e=>{o(t=>({...t,template:t.template?`${t.template} ${e}`:e}))};return(0,i.FD)("form",{onSubmit:e=>{e.preventDefault(),r(s),d(!0),setTimeout(()=>d(!1),2e3)},className:"flex-1 flex flex-col h-full scrollbar-overlay-container scrollbar-overlay-static bg-paper text-ink p-6 md:p-8 space-y-6",children:[(0,i.FD)("div",{className:"space-y-3",children:[(0,i.FD)("div",{className:"flex items-center justify-between",children:[(0,i.Y)("h2",{className:"text-xs font-bold uppercase tracking-wider text-ink",children:"Identity"}),s.isBuiltIn&&(0,i.Y)("span",{className:"text-[10px] font-mono px-2 py-0.5 rounded-md bg-ink/5 border border-ink/10 text-ink/60",children:"Built-in System Command"})]}),(0,i.FD)("div",{className:"flex items-center gap-3",children:[(0,i.FD)("div",{className:"flex-1",children:[(0,i.Y)("label",{className:"block text-xs font-semibold text-ink/80 mb-1.5",children:"Command Name"}),(0,i.FD)("div",{className:"flex items-center border border-ink/20 hover:border-ink/40 focus-within:border-ink rounded-lg bg-paper transition-colors",children:[(0,i.Y)("span",{className:"px-3 py-2 font-mono text-xs text-ink/40 border-r border-ink/15 select-none",children:"/"}),(0,i.Y)("input",{type:"text",value:s.name,onChange:e=>o({...s,name:e.currentTarget.value.replace(/^\/+/,"")}),required:!0,placeholder:"command-name",disabled:s.isBuiltIn,className:"w-full text-xs font-mono px-3 py-2 bg-transparent focus:outline-none disabled:opacity-60 text-ink"})]})]}),(0,i.FD)("div",{className:"w-40",children:[(0,i.Y)("label",{className:"block text-xs font-semibold text-ink/80 mb-1.5",children:"Scope"}),(0,i.FD)("select",{value:s.scope,onChange:e=>o({...s,scope:e.currentTarget.value}),disabled:s.isBuiltIn,className:"w-full text-xs py-2 px-3 rounded-lg border border-ink/20 hover:border-ink/40 bg-paper focus:outline-none focus:border-ink disabled:opacity-60 text-ink transition-colors cursor-pointer",children:[(0,i.Y)("option",{value:"user",children:"user"}),(0,i.Y)("option",{value:"project",children:"project"}),(0,i.Y)("option",{value:"system",children:"system"})]})]})]}),(0,i.FD)("div",{children:[(0,i.Y)("label",{className:"block text-xs font-semibold text-ink/80 mb-1.5",children:"Description"}),(0,i.Y)("textarea",{value:s.description,onChange:e=>o({...s,description:e.currentTarget.value}),placeholder:"What does this command do?",rows:2,className:"w-full text-xs p-3 rounded-lg border border-ink/20 hover:border-ink/40 bg-paper focus:outline-none focus:border-ink placeholder:text-ink/30 text-ink transition-colors"})]})]}),(0,i.Y)("div",{className:"border-t border-ink/10"}),(0,i.FD)("div",{className:"space-y-3",children:[(0,i.Y)("h2",{className:"text-xs font-bold uppercase tracking-wider text-ink",children:"Execution Context"}),(0,i.FD)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,i.FD)("div",{children:[(0,i.Y)("label",{className:"block text-xs font-semibold text-ink/80 mb-1.5",children:"Override Agent"}),(0,i.FD)("div",{className:"flex items-center border border-ink/20 hover:border-ink/40 focus-within:border-ink rounded-lg bg-paper transition-colors",children:[(0,i.Y)("span",{className:"px-2.5 text-ink/40",children:(0,i.Y)(I.A,{className:"w-3.5 h-3.5"})}),(0,i.FD)("select",{value:s.overrideAgent||"Not selected",onChange:e=>o({...s,overrideAgent:e.currentTarget.value}),className:"w-full text-xs py-2 pr-3 bg-transparent focus:outline-none cursor-pointer text-ink",children:[(0,i.Y)("option",{value:"Not selected",children:"Not selected"}),m.map(e=>(0,i.FD)("option",{value:e.name,children:["@",e.name]},e.id))]})]})]}),(0,i.FD)("div",{children:[(0,i.Y)("label",{className:"block text-xs font-semibold text-ink/80 mb-1.5",children:"Override Model"}),(0,i.FD)("div",{className:"flex items-center border border-ink/20 hover:border-ink/40 focus-within:border-ink rounded-lg bg-paper transition-colors",children:[(0,i.Y)("span",{className:"px-2.5 text-ink/40",children:(0,i.Y)(tF.A,{className:"w-3.5 h-3.5"})}),(0,i.Y)("select",{value:s.overrideModel||"Not selected",onChange:e=>o({...s,overrideModel:e.currentTarget.value}),className:"w-full text-xs font-mono py-2 pr-3 bg-transparent focus:outline-none cursor-pointer text-ink",children:tX.map(e=>(0,i.Y)("option",{value:e,children:e},e))})]})]})]})]}),(0,i.Y)("div",{className:"border-t border-ink/10"}),(0,i.FD)("div",{className:"space-y-2 flex-1 flex flex-col",children:[(0,i.FD)("div",{className:"flex items-center justify-between",children:[(0,i.FD)("div",{children:[(0,i.Y)("label",{className:"text-xs font-bold uppercase tracking-wider text-ink",children:"Command Template"}),(0,i.FD)("p",{className:"text-[11px] text-ink/60 mt-0.5",children:["Use ",(0,i.Y)("code",{className:"text-ink font-semibold font-mono",children:"$ARGUMENTS"}),", ",(0,i.Y)("code",{className:"text-ink font-semibold font-mono",children:"!`shell`"}),", or ",(0,i.Y)("code",{className:"text-ink font-semibold font-mono",children:"@filename"}),"."]})]}),(0,i.Y)("div",{className:"flex items-center gap-2",children:(0,i.FD)("button",{type:"button",onClick:()=>{navigator.clipboard.writeText(s.template),u(!0),setTimeout(()=>u(!1),1800)},className:"flex items-center gap-1.5 text-xs text-ink/60 hover:text-ink transition-colors cursor-pointer",children:[p?(0,i.Y)(D.A,{className:"w-3.5 h-3.5 text-ink"}):(0,i.Y)(tS.A,{className:"w-3.5 h-3.5"}),(0,i.Y)("span",{children:p?"Copied":"Copy"})]})})]}),(0,i.FD)("div",{className:"flex items-center gap-2 py-1",children:[(0,i.Y)("button",{type:"button",onClick:()=>b("$ARGUMENTS"),className:"px-2.5 py-1 text-xs font-mono rounded-md bg-ink/5 hover:bg-ink/10 border border-ink/15 text-ink transition-colors cursor-pointer",children:"+$ARGUMENTS"}),(0,i.Y)("button",{type:"button",onClick:()=>b("!`bun test`"),className:"px-2.5 py-1 text-xs font-mono rounded-md bg-ink/5 hover:bg-ink/10 border border-ink/15 text-ink transition-colors cursor-pointer",children:"+!shell"}),(0,i.Y)("button",{type:"button",onClick:()=>b("@src/App.tsx"),className:"px-2.5 py-1 text-xs font-mono rounded-md bg-ink/5 hover:bg-ink/10 border border-ink/15 text-ink transition-colors cursor-pointer",children:"+@filename"})]}),(0,i.Y)("textarea",{value:s.template,onChange:e=>o({...s,template:e.currentTarget.value}),rows:7,placeholder:"Enter command template instructions...",className:"w-full flex-1 min-h-[140px] text-xs font-mono p-3 rounded-lg border border-ink/20 hover:border-ink/40 bg-ink/5 focus:outline-none focus:border-ink leading-relaxed transition-colors"})]}),(0,i.FD)("div",{className:"pt-3 border-t border-ink/10 flex items-center justify-between",children:[(0,i.Y)("div",{children:!s.isBuiltIn&&!n&&l&&(0,i.FD)("button",{type:"button",onClick:()=>l(s.id),className:"flex items-center gap-1.5 px-3.5 py-2 rounded-lg border border-ink/20 hover:border-error hover:text-error text-ink/70 text-xs font-medium transition-colors cursor-pointer",children:[(0,i.Y)(eD.A,{className:"w-3.5 h-3.5"}),"Delete Command"]})}),(0,i.FD)("div",{className:"flex items-center gap-3",children:[c&&(0,i.FD)("span",{className:"flex items-center gap-1 text-xs text-ink font-medium",children:[(0,i.Y)(D.A,{className:"w-3.5 h-3.5"}),"Saved successfully"]}),(0,i.Y)("button",{type:"submit",className:"px-4 py-2 rounded-lg bg-ink text-paper text-xs font-medium hover:bg-ink/90 transition-colors shadow-xs cursor-pointer",children:n?"Create Command":"Save Command"})]})]})]})},t1=()=>{let[e,t]=(0,a.J0)("ompchamber"),{items:n,selectedId:r,selected:l,isCreatingNew:s,isLoading:o,select:c,startCreate:d,save:p,remove:u}=t_({endpoint:"/api/settings/commands",listKey:"commands",bodyKey:"command",messages:{load:"Failed to load commands from API:",save:"Failed to save command via API:",delete:"Failed to delete command via API:"},cacheKey:"command",buildNew:e=>({...e,id:`cmd-${Date.now()}`,isBuiltIn:!1}),buildUpdate:e=>e,isDeleteError:e=>!!e?.error}),m={id:`new-${Date.now()}`,name:"new-command",description:"",scope:"user",overrideAgent:"Not selected",overrideModel:"Not selected",template:"Execute task: $ARGUMENTS",isBuiltIn:!1};return o?(0,i.Y)(eJ,{children:"Loading commands from database..."}):(0,i.FD)("div",{className:"flex h-full w-full overflow-hidden bg-paper",children:[(0,i.Y)(tZ,{commands:n,selectedCommandId:s?null:r,onSelectCommand:c,onAddNewCommand:d,selectedProject:e,onChangeProject:t}),(0,i.Y)("div",{className:"flex-1 h-full overflow-hidden flex flex-col",children:s?(0,i.Y)(t0,{command:m,isNew:!0,onSave:p}):l?(0,i.Y)(t0,{command:l,isNew:!1,onSave:p,onDelete:u},l.id):(0,i.Y)("div",{className:"flex-1 flex items-center justify-center text-xs font-mono text-ink/40",children:"Select a command or click + to create one"})})]})},t2=e=>{let{servers:t,projects:n,selectedServerId:r,onSelectServer:a,onAddNewServer:l,selectedProject:s,onChangeProject:o}=e,c=n.find(e=>e.path===s)?.name??"Global (all projects)";return(0,i.FD)("div",{className:"w-56 sm:w-64 border-r border-ink/10 h-full flex flex-col bg-paper/50 flex-shrink-0 select-none",children:[(0,i.Y)(tY,{selectedProject:s,onChangeProject:o,options:n.map(e=>({id:e.id,name:e.name,label:e.name,value:e.path})),getTriggerLabel:()=>c}),(0,i.FD)("div",{className:"px-3.5 py-2.5 border-b border-ink/10 flex items-center justify-between",children:[(0,i.FD)("span",{className:"text-xs font-semibold text-ink",children:["Total ",t.length]}),(0,i.Y)("button",{type:"button",onClick:l,title:"Add MCP Server",className:"p-1 rounded text-ink/60 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer",children:(0,i.Y)(g.A,{size:15,strokeWidth:2.2})})]}),(0,i.Y)("div",{className:"flex-1 scrollbar-overlay-container scrollbar-overlay-static p-1.5 space-y-3 text-xs",children:(0,i.FD)("div",{children:[(0,i.FD)("div",{className:"px-2.5 pt-1.5 pb-1 text-[10px] font-bold text-ink/50 uppercase tracking-wider flex items-center justify-between",children:[(0,i.Y)("span",{children:"User Servers"}),(0,i.Y)("span",{className:"text-[10px] font-normal",children:t.length})]}),(0,i.Y)("div",{className:"space-y-0.5",children:t.map(e=>{let t=e.id===r,n="command"===e.reachType,l=n?e.commandArgs.join(" "):e.linkUrl||"No URL configured";return(0,i.FD)("button",{type:"button",onClick:()=>a(e.id),className:`w-full text-left px-2.5 py-2 rounded-lg transition-colors cursor-pointer flex flex-col gap-0.5 group ${t?"bg-ink/10 text-ink font-medium shadow-2xs":"text-ink/80 hover:bg-ink/5 hover:text-ink"}`,children:[(0,i.FD)("div",{className:"flex items-center justify-between gap-1.5",children:[(0,i.FD)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,i.Y)("span",{className:`w-2 h-2 rounded-full flex-shrink-0 ${e.enabled?"bg-ink":"bg-ink/20"}`,title:e.enabled?"Enabled":"Disabled"}),(0,i.Y)("span",{className:"font-semibold text-xs text-ink truncate",children:e.name})]}),(0,i.Y)("div",{className:"flex items-center gap-1 text-ink/40",children:n?(0,i.Y)(w.A,{className:"w-3.5 h-3.5"}):(0,i.Y)(em.A,{className:"w-3.5 h-3.5"})})]}),(0,i.Y)("p",{className:"text-[11px] font-mono text-ink/60 line-clamp-1 leading-snug pl-4",children:l})]},e.id)})})]})})]})};var t5=n("c");function t3(e){let{server:t}=e,[n,r]=(0,a.J0)(!1),[l,s]=(0,a.J0)(null),o=async()=>{r(!0),s(null);try{let e=await fetch("/api/settings/mcp-test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({server:t})}),n=await e.json();s(n)}catch(e){s({ok:!1,transport:t.reachType,durationMs:0,error:e instanceof Error?e.message:"Request failed"})}finally{r(!1)}};return(0,i.FD)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,i.FD)("button",{type:"button",onClick:o,disabled:n,className:"flex items-center gap-1.5 px-3.5 py-2 rounded-lg border border-ink/20 hover:border-ink/40 text-xs font-medium text-ink hover:bg-ink/5 transition-colors disabled:opacity-50 cursor-pointer",children:[(0,i.Y)(t5.A,{className:`w-3.5 h-3.5 ${n?"animate-spin":""}`}),n?"Testing...":"Test Connection"]}),l&&!n&&(l.ok?(0,i.FD)("span",{className:"flex items-center gap-1.5 text-xs text-ink font-medium min-w-0",children:[(0,i.Y)(D.A,{className:"w-3.5 h-3.5 shrink-0"}),(0,i.FD)("span",{className:"truncate",children:[l.serverInfo?.name??t.name,l.serverInfo?.version?` v${l.serverInfo.version}`:""]}),l.protocolVersion&&(0,i.FD)("span",{className:"text-ink/50 shrink-0",children:["· ",l.protocolVersion]}),"number"==typeof l.toolCount&&(0,i.FD)("span",{className:"text-ink/50 shrink-0",children:["· ",l.toolCount," tools"]}),(0,i.FD)("span",{className:"text-ink/50 shrink-0",children:["· ",l.durationMs,"ms"]})]}):(0,i.FD)("span",{className:"flex items-center gap-1 text-xs text-error font-medium min-w-0",title:l.error??"Connection failed",children:[(0,i.Y)(e7.A,{className:"w-3.5 h-3.5 shrink-0"}),(0,i.Y)("span",{className:"truncate max-w-[280px]",children:l.error??"Connection failed"})]}))]})}function t4(e){return e.split("\n").map(e=>e.trim()).filter(Boolean)}let t6=e=>{let{server:t,isNew:n=!1,onSave:r,onDelete:l,onOpenImportModal:s}=e,[o,c]=(0,a.J0)(t),[d,p]=(0,a.J0)(""),[u,m]=(0,a.J0)(!1);(0,a.vJ)(()=>{c(t),p(t.commandArgs.join("\n")),m(!1)},[t]);let h=(e,t,n)=>{c(i=>({...i,envVars:i.envVars.map(i=>i.id===e?{...i,key:t,value:n}:i)}))},b={...o,commandArgs:t4(d)};return(0,i.FD)("form",{onSubmit:e=>{e.preventDefault();let t=t4(d);r({...o,commandArgs:t}),m(!0),setTimeout(()=>m(!1),2e3)},className:"flex-1 flex flex-col h-full scrollbar-overlay-container scrollbar-overlay-static bg-paper text-ink p-6 md:p-8 space-y-6",children:[(0,i.FD)("div",{className:"flex items-center justify-between pb-4 border-b border-ink/10",children:[(0,i.Y)("div",{children:(0,i.Y)("h2",{className:"text-sm font-bold tracking-tight text-ink",children:n?"Configure a new MCP server":`Edit MCP Server: ${o.name}`})}),(0,i.FD)("button",{type:"button",onClick:s,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-lg border border-ink/20 hover:border-ink/40 hover:bg-ink/5 transition-colors cursor-pointer",children:[(0,i.Y)(tW.A,{className:"w-3.5 h-3.5 text-ink/70"}),(0,i.Y)("span",{children:"Import from JSON snippet"})]})]}),(0,i.FD)("div",{className:"space-y-4",children:[(0,i.FD)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,i.FD)("div",{children:[(0,i.Y)("label",{className:"block text-xs font-semibold text-ink/80 mb-1.5",children:"Server Name"}),(0,i.Y)("input",{type:"text",value:o.name,onChange:e=>c({...o,name:e.currentTarget.value}),required:!0,placeholder:"new-mcp-server",className:"w-full text-xs font-mono px-3 py-2 rounded-lg border border-ink/20 hover:border-ink/40 bg-paper focus:outline-none focus:border-ink text-ink transition-colors"})]}),(0,i.FD)("div",{children:[(0,i.Y)("label",{className:"block text-xs font-semibold text-ink/80 mb-1.5",children:"Scope"}),(0,i.FD)("select",{value:o.scope,onChange:e=>c({...o,scope:e.currentTarget.value}),className:"w-full text-xs py-2 px-3 rounded-lg border border-ink/20 hover:border-ink/40 bg-paper focus:outline-none focus:border-ink cursor-pointer text-ink transition-colors",children:[(0,i.Y)("option",{value:"every-project",children:"Available in every project"}),(0,i.Y)("option",{value:"this-project",children:"This project only"})]})]})]}),(0,i.FD)("div",{className:"flex items-center gap-2 pt-1",children:[(0,i.Y)("input",{type:"checkbox",id:"enable-mcp",checked:o.enabled,onChange:e=>c({...o,enabled:e.currentTarget.checked}),className:"w-4 h-4 rounded border-ink/30 text-ink focus:ring-0 cursor-pointer"}),(0,i.Y)("label",{htmlFor:"enable-mcp",className:"text-xs font-medium text-ink cursor-pointer select-none",children:"Enable Server"})]})]}),(0,i.Y)("div",{className:"border-t border-ink/10"}),(0,i.FD)("div",{className:"space-y-3",children:[(0,i.FD)("div",{children:[(0,i.Y)("h3",{className:"text-xs font-bold uppercase tracking-wider text-ink",children:"How to reach it"}),(0,i.Y)("p",{className:"text-[11px] text-ink/60 mt-0.5",children:"Paste the command that starts it, or the link to a hosted server."})]}),(0,i.FD)("div",{className:"inline-flex rounded-lg border border-ink/20 p-0.5 bg-ink/5",children:[(0,i.FD)("button",{type:"button",onClick:()=>c({...o,reachType:"command"}),className:`flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-md transition-colors cursor-pointer ${"command"===o.reachType?"bg-paper text-ink shadow-2xs font-semibold":"text-ink/60 hover:text-ink"}`,children:[(0,i.Y)(w.A,{className:"w-3.5 h-3.5"}),"Command"]}),(0,i.FD)("button",{type:"button",onClick:()=>c({...o,reachType:"link"}),className:`flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-md transition-colors cursor-pointer ${"link"===o.reachType?"bg-paper text-ink shadow-2xs font-semibold":"text-ink/60 hover:text-ink"}`,children:[(0,i.Y)(em.A,{className:"w-3.5 h-3.5"}),"Link"]})]}),"command"===o.reachType?(0,i.FD)("div",{children:[(0,i.Y)("textarea",{value:d,onChange:e=>p(e.currentTarget.value),rows:4,placeholder:`bunx
|
|
26
|
-
@modelcontextprotocol/server-postgres
|
|
27
|
-
postgresql://user:pass@host/db`,className:"w-full text-xs font-mono p-3 rounded-lg border border-ink/20 hover:border-ink/40 bg-ink/5 focus:outline-none focus:border-ink resize-none leading-relaxed text-ink transition-colors"}),(0,i.Y)("p",{className:"text-[11px] text-ink/50 mt-1",children:"Runs on this machine. Paste a whole command and it is split into one argument per line."})]}):(0,i.FD)("div",{children:[(0,i.Y)("input",{type:"url",value:o.linkUrl||"",onChange:e=>c({...o,linkUrl:e.currentTarget.value}),placeholder:"https://needmcp.com/mcp",className:"w-full text-xs font-mono px-3 py-2 rounded-lg border border-ink/20 hover:border-ink/40 bg-ink/5 focus:outline-none focus:border-ink text-ink transition-colors"}),(0,i.Y)("p",{className:"text-[11px] text-ink/50 mt-1",children:"Connect to a hosted MCP SSE or HTTP endpoint."})]})]}),(0,i.Y)("div",{className:"border-t border-ink/10"}),(0,i.FD)("div",{className:"space-y-3",children:[(0,i.FD)("div",{className:"flex items-center justify-between",children:[(0,i.FD)("div",{children:[(0,i.Y)("h3",{className:"text-xs font-bold uppercase tracking-wider text-ink",children:"Environment Variables"}),(0,i.Y)("p",{className:"text-[11px] text-ink/60 mt-0.5",children:"Values the server needs, such as an API key."})]}),(0,i.FD)("button",{type:"button",onClick:()=>{let e={id:`env-${Date.now()}`,key:"",value:""};c(t=>({...t,envVars:[...t.envVars,e]}))},className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-lg border border-ink/20 hover:border-ink/40 hover:bg-ink/5 text-ink transition-colors cursor-pointer",children:[(0,i.Y)(g.A,{className:"w-3.5 h-3.5"}),(0,i.Y)("span",{children:"Add variable"})]})]}),0===o.envVars.length?(0,i.Y)("div",{className:"p-4 rounded-lg border border-dashed border-ink/20 text-center text-xs text-ink/50",children:"No environment variables configured."}):(0,i.Y)("div",{className:"space-y-2",children:o.envVars.map(e=>(0,i.FD)("div",{className:"flex items-center gap-2",children:[(0,i.Y)("input",{type:"text",value:e.key,onChange:t=>h(e.id,t.currentTarget.value,e.value),placeholder:"KEY",className:"w-1/3 text-xs font-mono px-3 py-1.5 rounded-lg border border-ink/20 hover:border-ink/40 bg-paper focus:outline-none focus:border-ink text-ink transition-colors"}),(0,i.Y)("input",{type:"text",value:e.value,onChange:t=>h(e.id,e.key,t.currentTarget.value),placeholder:"VALUE",className:"flex-1 text-xs font-mono px-3 py-1.5 rounded-lg border border-ink/20 hover:border-ink/40 bg-paper focus:outline-none focus:border-ink text-ink transition-colors"}),(0,i.Y)("button",{type:"button",onClick:()=>{var t;return t=e.id,void c(e=>({...e,envVars:e.envVars.filter(e=>e.id!==t)}))},className:"p-1.5 text-ink/40 hover:text-error transition-colors rounded-md cursor-pointer",title:"Remove variable",children:(0,i.Y)(eD.A,{className:"w-4 h-4"})})]},e.id))})]}),(0,i.FD)("div",{className:"pt-3 border-t border-ink/10 flex items-center justify-between",children:[(0,i.FD)("div",{className:"flex items-center gap-2",children:[!n&&l&&(0,i.FD)("button",{type:"button",onClick:()=>l(o.id),className:"flex items-center gap-1.5 px-3.5 py-2 rounded-lg border border-ink/20 hover:border-error hover:text-error text-ink/70 text-xs font-medium transition-colors cursor-pointer",children:[(0,i.Y)(eD.A,{className:"w-3.5 h-3.5"}),"Delete"]}),(0,i.Y)(t3,{server:b})]}),(0,i.FD)("div",{className:"flex items-center gap-3",children:[u&&(0,i.FD)("span",{className:"flex items-center gap-1 text-xs text-ink font-medium",children:[(0,i.Y)(D.A,{className:"w-3.5 h-3.5"}),"Saved successfully"]}),(0,i.Y)("button",{type:"submit",className:"px-4 py-2 rounded-lg bg-ink text-paper text-xs font-medium hover:bg-ink/90 transition-colors shadow-xs cursor-pointer",children:n?"Create Server":"Save Changes"})]})]})]})},t8=`{
|
|
28
|
-
"mcpServers": {
|
|
29
|
-
"postgres-db": {
|
|
30
|
-
"command": "bunx",
|
|
31
|
-
"args": ["-y", "@modelcontextprotocol/server-postgres", "postgresql://user:pass@localhost:5432/db"],
|
|
32
|
-
"env": {
|
|
33
|
-
"DEBUG": "1"
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}`,t7=e=>{let{isOpen:t,onClose:n,onImport:r}=e,[l,s]=(0,a.J0)(t8),[o,c]=(0,a.J0)(null);if(!t)return null;let d=(e,t)=>{let i="string"==typeof t.url&&t.url.length>0,a=[];i||0===(a=[..."string"==typeof t.command?[t.command]:[],...Array.isArray(t.args)?t.args.map(String):[]]).length&&(a=["bunx","@modelcontextprotocol/server-everything"]);let l=[];t.env&&"object"==typeof t.env&&Object.entries(t.env).forEach((e,t)=>{let[n,i]=e;l.push({id:`env-${Date.now()}-${t}`,key:n,value:String(i)})}),r({id:`mcp-${Date.now()}`,name:e,scope:"every-project",enabled:!0,reachType:i?"link":"command",commandArgs:a,linkUrl:i?t.url:void 0,envVars:l,status:"active"}),n()};return(0,i.Y)("div",{className:"fixed inset-0 bg-ink/40 backdrop-blur-[2px] z-50 flex items-center justify-center p-4 animate-in fade-in duration-150",children:(0,i.FD)("div",{className:"w-full max-w-lg rounded-lg border border-ink/20 bg-paper text-ink p-5 shadow-2xl space-y-4",children:[(0,i.FD)("div",{className:"flex items-center justify-between pb-3 border-b border-ink/10",children:[(0,i.FD)("div",{className:"flex items-center gap-2",children:[(0,i.Y)(tW.A,{className:"w-4 h-4 text-ink/70"}),(0,i.Y)("h2",{className:"text-xs font-bold uppercase tracking-wider text-ink",children:"Import MCP Server from JSON"})]}),(0,i.Y)("button",{type:"button",onClick:n,className:"p-1 rounded-md text-ink/50 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer",children:(0,i.Y)(h.A,{className:"w-4 h-4"})})]}),(0,i.Y)("p",{className:"text-xs text-ink/70 leading-relaxed",children:"Paste a configuration block from Claude Desktop, VS Code, or Cursor settings."}),(0,i.Y)("textarea",{value:l,onChange:e=>{s(e.currentTarget.value),c(null)},rows:10,className:"w-full text-xs font-mono p-3 rounded-lg border border-ink/20 hover:border-ink/40 bg-ink/5 focus:outline-none focus:border-ink resize-none leading-relaxed text-ink transition-colors",placeholder:"Paste JSON snippet here..."}),o&&(0,i.FD)("div",{className:"flex items-center gap-2 text-xs text-error p-2.5 rounded-lg bg-error/10 border border-error/20",children:[(0,i.Y)(e7.A,{className:"w-4 h-4 flex-shrink-0"}),(0,i.Y)("span",{className:"font-medium",children:o})]}),(0,i.FD)("div",{className:"pt-3 border-t border-ink/10 flex items-center justify-end gap-2",children:[(0,i.Y)("button",{type:"button",onClick:n,className:"px-3.5 py-2 rounded-lg border border-ink/20 hover:border-ink/40 text-xs font-medium text-ink/80 hover:text-ink transition-colors cursor-pointer",children:"Cancel"}),(0,i.Y)("button",{type:"button",onClick:()=>{c(null);try{let e=JSON.parse(l);if(e.mcpServers&&"object"==typeof e.mcpServers){let t=Object.keys(e.mcpServers);if(0===t.length)throw Error('No servers found inside "mcpServers" object.');let n=t[0],i=e.mcpServers[n];d(n,i);return}let t=e.name||"imported-mcp-server";d(t,e)}catch(e){c(e instanceof Error?e.message:"Invalid JSON format")}},className:"px-4 py-2 rounded-lg bg-ink text-paper text-xs font-medium hover:bg-ink/90 transition-colors shadow-xs cursor-pointer",children:"Import Server"})]})]})})};var t9=n("Xk"),ne=n("Af");let nt=(0,s.q6)(null);function nn(e){let{children:t,initialFolders:n=[]}=e,r=(0,t9.L)(),[l,s]=(0,a.J0)(!1),o=(0,a.li)(!1),c=(0,a.li)(new Set);(0,a.vJ)(()=>{o.current||(o.current=!0,r.load("/api/sessions/list"))},[]),(0,a.vJ)(()=>{r.data&&s(!0)},[r.data]);let d=(0,a.Kr)(()=>()=>{"idle"===r.state&&r.load("/api/sessions/list")},[r]),p=!!r.data?.folders?.some(e=>e.sessions?.some(e=>"stream"===e.streamStatus));(0,ne.n)(d,!p,3e4);let u=(0,a.hb)(e=>{let t=String(e),n=r.data?.folders?.flatMap(e=>e.sessions??[]).find(e=>String(e.id)===t)?.streamStatus;!n||"stream"===n||c.current.has(t)||(c.current.add(t),fetch(`/api/sessions/${encodeURIComponent(t)}/stream-seen`,{method:"POST"}).then(()=>{"idle"===r.state&&r.load("/api/sessions/list")}).catch(()=>{c.current.delete(t)}))},[r]),m=(0,a.Kr)(()=>{let e=r.data,t=c.current;return{folders:(e?.folders??n).map(e=>t.size?{...e,sessions:(e.sessions??[]).map(e=>t.has(String(e.id))?{...e,streamStatus:void 0}:e)}:e),isMock:e?.isMock??!1,initializing:!l,refresh:d,markSeen:u,hasSeen:e=>t.has(String(e))}},[r.data,n,l,d,u]);return(0,i.Y)(nt.Provider,{value:m,children:t})}function ni(){let e=(0,a.NT)(nt);return e||{folders:[],isMock:!1,initializing:!0,refresh:()=>{},markSeen:()=>{},hasSeen:()=>!1}}let nr={id:"global",name:"Global (all projects)",path:""},na=()=>{let{folders:e}=ni(),t=(0,a.Kr)(()=>[nr,...e.flatMap(e=>e.project_path?[{id:String(e.id),name:e.name,path:e.project_path}]:[])],[e]),[n,r]=(0,a.J0)(!1),[l,s]=(0,a.J0)(""),{items:o,selectedId:c,selected:d,isCreatingNew:p,isLoading:u,select:m,startCreate:h,save:b,remove:f}=t_({endpoint:"/api/settings/mcp",listKey:"servers",bodyKey:"server",query:l?`?project=${encodeURIComponent(l)}`:"",messages:{load:"Failed to load MCP servers from API:",save:"Failed to save MCP server via API:",delete:"Failed to delete MCP server via API:"},serverListOnly:!0,deleteFromResponse:!0,buildNew:e=>({...e,id:`mcp-${Date.now()}`}),buildUpdate:e=>e,buildBody:e=>l?{server:e,projectPath:l}:{server:e},buildDeleteQuery:e=>{let t=new URLSearchParams({id:e});return l&&t.set("projectPath",l),`?${t.toString()}`},readList:e=>Array.isArray(e?.servers)?e.servers:null,resolveOnLoad:(e,t)=>e&&t.some(t=>t.id===e)?e:t[0]?.id??null,resolveOnSave:(e,t)=>{if(!t)return;let n=t.find(t=>t.name.toLowerCase()===e.name.toLowerCase());return n?.id??e.id},isSaveError:e=>{let t=e?.error;return!!t&&(console.error("Failed to save MCP server via API:",t),!0)},isDeleteError:e=>{let t=e?.error;return!!t&&(console.error("Failed to delete MCP server via API:",t),!0)}}),x={id:`new-${Date.now()}`,name:"new-mcp-server",scope:"every-project",enabled:!0,reachType:"command",commandArgs:["bunx","@modelcontextprotocol/server-everything"],envVars:[],status:"active"};return u?(0,i.Y)(eJ,{children:"Loading MCP servers from database..."}):(0,i.FD)("div",{className:"flex h-full w-full overflow-hidden bg-paper",children:[(0,i.Y)(t2,{servers:o,projects:t,selectedServerId:p?null:c,onSelectServer:m,onAddNewServer:h,selectedProject:l,onChangeProject:s}),(0,i.Y)("div",{className:"flex-1 h-full overflow-hidden flex flex-col",children:p?(0,i.Y)(t6,{server:x,isNew:!0,onSave:b,onOpenImportModal:()=>r(!0)}):d?(0,i.Y)(t6,{server:d,isNew:!1,onSave:b,onDelete:f,onOpenImportModal:()=>r(!0)},d.id):(0,i.Y)("div",{className:"flex-1 flex items-center justify-center text-xs font-mono text-ink/40",children:"Select an MCP server or click + to configure one"})}),(0,i.Y)(t7,{isOpen:n,onClose:()=>r(!1),onImport:e=>{b(e)}})]})};var nl=n("Nf");function ns(e){let{skills:t,selectedSkillId:n,isCreatingNew:r,onSelectSkill:l,onAddNewSkill:s,selectedProject:o,onSelectProject:c}=e,[d,p]=(0,a.J0)({}),u={},m=[];t.forEach(e=>{e.group?(u[e.group]||(u[e.group]=[]),u[e.group].push(e)):m.push(e)});let h=t.length;return(0,i.FD)("div",{className:"w-56 sm:w-64 border-r border-ink/10 h-full flex flex-col bg-paper/50 flex-shrink-0",children:[(0,i.Y)(tY,{variant:"compact",selectedProject:o,onChangeProject:c,getTriggerLabel:(e,t)=>e.find(e=>e.id===t)?.label||t}),(0,i.FD)("div",{className:"px-3.5 py-2.5 border-b border-ink/10 flex items-center justify-between",children:[(0,i.FD)("span",{className:"text-xs font-semibold text-ink",children:["Total ",h]}),(0,i.Y)("button",{type:"button",onClick:s,title:"Create New Skill",className:"p-1 rounded-md text-ink/60 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer",children:(0,i.Y)(g.A,{size:15,strokeWidth:2.2})})]}),(0,i.FD)("div",{className:"flex-1 scrollbar-overlay-container scrollbar-overlay-static p-1.5 space-y-2",children:[(0,i.Y)("div",{className:"px-2 pt-1 pb-0.5 text-[10px] font-bold text-ink/50 uppercase tracking-wider",children:"USER SKILLS"}),r&&(0,i.Y)("div",{className:"px-2.5 py-1.5 rounded-lg bg-ink/10 text-ink font-medium text-xs shadow-2xs",children:(0,i.Y)("span",{className:"truncate",children:"new-skill"})}),Object.entries(u).map(e=>{let[t,a]=e,s=!!d[t];return(0,i.FD)("div",{className:"space-y-0.5",children:[(0,i.FD)("button",{type:"button",onClick:()=>{p(e=>({...e,[t]:!e[t]}))},className:"w-full flex items-center justify-between px-2 py-1 rounded-md text-xs font-semibold text-ink/80 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer",children:[(0,i.FD)("div",{className:"flex items-center gap-1.5 truncate",children:[s?(0,i.Y)(nl.A,{size:13,className:"text-ink/60"}):(0,i.Y)(eT.A,{size:13,className:"text-ink/60"}),(0,i.Y)("span",{className:"truncate tracking-tight uppercase text-[11px] font-bold text-ink/90",children:t})]}),(0,i.Y)("span",{className:"text-[10px] font-mono text-ink/50 px-1.5 py-0.2 rounded bg-ink/5",children:a.length})]}),!s&&(0,i.Y)("div",{className:"pl-3 space-y-0.5 border-l border-ink/10 ml-2.5",children:a.map(e=>{let t=!r&&n===e.id;return(0,i.Y)("button",{type:"button",onClick:()=>l(e.id),className:`w-full text-left px-2.5 py-1.5 rounded-lg text-xs transition-colors cursor-pointer truncate block ${t?"bg-ink/10 text-ink font-medium shadow-2xs":"text-ink/70 hover:bg-ink/5 hover:text-ink"}`,children:e.name},e.id)})})]},t)}),(0,i.Y)("div",{className:"space-y-0.5 pt-1",children:m.map(e=>{let t=!r&&n===e.id;return(0,i.Y)("button",{type:"button",onClick:()=>l(e.id),className:`w-full text-left px-2.5 py-1.5 rounded-lg text-xs transition-colors cursor-pointer truncate block ${t?"bg-ink/10 text-ink font-medium shadow-2xs":"text-ink/70 hover:bg-ink/5 hover:text-ink"}`,children:e.name},e.id)})})]})]})}var no=n("rD");function nc(e){let{skill:t,isCreatingNew:n,onSave:r,onDelete:l,onOpenCatalog:s}=e,[o,c]=(0,a.J0)(""),[d,p]=(0,a.J0)(""),[u,m]=(0,a.J0)("user"),[h,b]=(0,a.J0)("User / OpenCode"),[f,x]=(0,a.J0)(""),[g,v]=(0,a.J0)(!1),[k,y]=(0,a.J0)(!0);(0,a.vJ)(()=>{n||!t?(c("new-skill"),p(""),m("user"),b("User / OpenCode"),x(`---
|
|
38
|
-
description: ""
|
|
39
|
-
---
|
|
40
|
-
`)):(c(t.name),p(t.description),m(t.location),b(t.locationLabel||"User / OpenCode"),x(t.instructions))},[t,n]);let w=Math.max(f.split("\n").length,6);return(0,i.FD)("div",{className:"flex-1 flex flex-col h-full scrollbar-overlay-container scrollbar-overlay-static bg-paper text-ink p-6 md:p-8 space-y-6",children:[(0,i.FD)("div",{className:"flex items-start justify-between pb-4 border-b border-ink/10 gap-4",children:[(0,i.FD)("div",{children:[(0,i.Y)("h2",{className:"text-sm font-bold tracking-tight text-ink",children:n?"New Skill":o}),(0,i.Y)("p",{className:"text-xs text-ink/60 mt-0.5",children:n?"Configure a new skill":"Configure skill details and prompt rules"})]}),s&&(0,i.FD)("button",{type:"button",onClick:s,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-ink/20 hover:border-ink/40 text-xs font-medium text-ink hover:bg-ink/5 transition-colors cursor-pointer",children:[(0,i.Y)(eS.A,{size:14,className:"text-ink/70"}),(0,i.Y)("span",{children:"Browse Catalog"})]})]}),(0,i.FD)("div",{className:"space-y-4",children:[(0,i.Y)("h3",{className:"text-xs font-bold uppercase tracking-wider text-ink",children:"Basic Information"}),(0,i.FD)("div",{children:[(0,i.FD)("div",{className:"flex items-center gap-1.5 mb-1.5",children:[(0,i.Y)("label",{className:"text-xs font-semibold text-ink/80",children:"Skill Name & Location"}),(0,i.FD)("div",{className:"group relative",children:[(0,i.Y)(eC.A,{size:13,className:"text-ink/40 cursor-help"}),(0,i.Y)("div",{className:"absolute left-0 top-5 hidden group-hover:block w-64 p-2 rounded-lg bg-ink text-paper text-[11px] shadow-lg z-20 pointer-events-none leading-relaxed",children:"Unique identifier and runtime execution scope for this skill."})]})]}),(0,i.FD)("div",{className:"flex flex-col sm:flex-row items-stretch sm:items-center gap-2",children:[(0,i.Y)("input",{type:"text",value:o,onChange:e=>c(e.currentTarget.value),placeholder:"skill-name",className:"flex-1 px-3 py-2 rounded-lg border border-ink/20 hover:border-ink/40 bg-paper focus:outline-none focus:border-ink text-xs font-mono text-ink transition-colors"}),(0,i.FD)("div",{className:"flex items-center gap-1.5 px-3 py-2 rounded-lg border border-ink/20 bg-ink/5 text-xs text-ink/80 flex-shrink-0",children:[(0,i.Y)(no.A,{size:14,className:"text-ink/60"}),(0,i.Y)("span",{children:h})]})]})]}),(0,i.FD)("div",{children:[(0,i.FD)("div",{className:"flex items-center gap-1.5 mb-1.5",children:[(0,i.FD)("label",{className:"text-xs font-semibold text-ink/80",children:["Description ",(0,i.Y)("span",{className:"text-error",children:"*"})]}),(0,i.FD)("div",{className:"group relative",children:[(0,i.Y)(eC.A,{size:13,className:"text-ink/40 cursor-help"}),(0,i.Y)("div",{className:"absolute left-0 top-5 hidden group-hover:block w-64 p-2 rounded-lg bg-ink text-paper text-[11px] shadow-lg z-20 pointer-events-none leading-relaxed",children:"Short description helping autonomous agents decide when to invoke this skill."})]})]}),(0,i.Y)("textarea",{rows:3,value:d,onChange:e=>p(e.currentTarget.value),placeholder:"Brief description of what this skill does...",className:"w-full px-3 py-2 rounded-lg border border-ink/20 hover:border-ink/40 bg-paper focus:outline-none focus:border-ink text-xs text-ink transition-colors resize-none leading-relaxed"})]})]}),(0,i.FD)("div",{className:"space-y-2 pt-2 border-t border-ink/10",children:[(0,i.FD)("div",{className:"flex items-center justify-between",children:[(0,i.Y)("h3",{className:"text-xs font-bold uppercase tracking-wider text-ink",children:"Instructions"}),(0,i.Y)("button",{type:"button",onClick:()=>y(!k),title:k?"Hide Line Numbers":"Show Line Numbers",className:"p-1 rounded-md text-ink/50 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer",children:k?(0,i.Y)(tn.A,{size:15}):(0,i.Y)(ti.A,{size:15})})]}),(0,i.Y)("div",{className:"rounded-lg border border-ink/20 hover:border-ink/40 bg-ink/5 overflow-hidden flex flex-col font-mono text-xs focus-within:border-ink transition-colors",children:(0,i.FD)("div",{className:"flex",children:[k&&(0,i.Y)("div",{className:"w-10 py-3 pr-2 select-none text-right font-mono text-xs text-ink/30 border-r border-ink/10 bg-ink/[0.02] overflow-hidden leading-relaxed",children:Array.from({length:w}).map((e,t)=>(0,i.Y)("div",{children:t+1},t))}),(0,i.Y)("textarea",{rows:Math.max(w,8),value:f,onChange:e=>x(e.currentTarget.value),spellcheck:!1,className:"flex-1 p-3 bg-transparent text-ink font-mono text-xs leading-relaxed resize-none focus:outline-none overflow-y-auto",placeholder:"Type markdown instructions..."})]})})]}),(0,i.FD)("div",{className:"pt-4 border-t border-ink/10 flex items-center justify-between",children:[!n&&t&&l?(0,i.FD)("button",{type:"button",onClick:()=>l(t.id),className:"flex items-center gap-1.5 px-3.5 py-2 rounded-lg border border-ink/20 hover:border-error hover:text-error text-ink/70 text-xs font-medium transition-colors cursor-pointer",children:[(0,i.Y)(eD.A,{size:14}),(0,i.Y)("span",{children:"Delete Skill"})]}):(0,i.Y)("div",{}),(0,i.FD)("button",{type:"button",onClick:()=>{r({name:o.trim()||"unnamed-skill",description:d.trim(),location:u,locationLabel:h,instructions:f}),v(!0),setTimeout(()=>v(!1),2e3)},className:"flex items-center gap-1.5 px-4 py-2 rounded-lg bg-ink text-paper text-xs font-medium hover:bg-ink/90 transition-colors shadow-xs cursor-pointer",children:[g?(0,i.Y)(D.A,{size:14}):(0,i.Y)(tB.A,{size:14}),(0,i.Y)("span",{children:g?"Saved":n?"Create Skill":"Save Changes"})]})]})]})}function nd(e){let{onNavigateToCatalog:t}=e,[n,r]=(0,a.J0)("ompchamber"),{items:l,selectedId:s,selected:o,isCreatingNew:c,isLoading:d,select:p,startCreate:u,save:m,remove:h}=t_({endpoint:"/api/settings/skills",listKey:"skills",bodyKey:"skill",messages:{load:"Failed to load skills from API:",save:"Failed to save skill via API:",delete:"Failed to delete skill via API:"},cacheKey:"command",fallbackToFirst:!1,buildNew:e=>({id:`skill-${Date.now()}`,name:e.name||"new-skill",description:e.description||"",location:e.location||"user",locationLabel:e.locationLabel||"User / OpenCode",instructions:e.instructions||"",project:n}),buildUpdate:(e,t,n)=>({...t||{id:n||`skill-${Date.now()}`},...e}),isDeleteError:e=>!!e?.error});return d?(0,i.Y)(eJ,{children:"Loading skills from database..."}):(0,i.FD)("div",{className:"flex-1 flex flex-col md:flex-row h-full w-full overflow-hidden bg-paper",children:[(0,i.Y)(ns,{skills:l,selectedSkillId:s,isCreatingNew:c,onSelectSkill:p,onAddNewSkill:u,selectedProject:n,onSelectProject:r}),(0,i.Y)(nc,{skill:o??null,isCreatingNew:c,onSave:m,onDelete:h,onOpenCatalog:t})]})}var np=n("HW"),nu=n("vZ"),nm=n("qr"),nh=n("tC");function nb(e){let{isOpen:t,onClose:n,onAddSource:r}=e,[l,s]=(0,a.J0)(""),[o,c]=(0,a.J0)(""),[d,p]=(0,a.J0)(null);return t?(0,i.Y)("div",{className:"fixed inset-0 z-50 bg-ink/40 backdrop-blur-[2px] flex items-center justify-center p-4",onClick:n,children:(0,i.FD)("div",{className:"bg-paper border border-ink/20 rounded-xl max-w-md w-full p-6 shadow-2xl space-y-4 text-ink animate-in fade-in zoom-in-95 duration-150",onClick:e=>e.stopPropagation(),children:[(0,i.FD)("div",{className:"flex items-center justify-between pb-3 border-b border-ink/10",children:[(0,i.FD)("div",{className:"flex items-center gap-2",children:[(0,i.Y)(nu.A,{className:"w-4 h-4 text-ink/70"}),(0,i.Y)("h2",{className:"text-xs font-bold uppercase tracking-wider text-ink",children:"Add Custom Skill Source"})]}),(0,i.Y)("button",{type:"button",onClick:n,className:"p-1 rounded-md text-ink/50 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer",children:(0,i.Y)(h.A,{className:"w-4 h-4"})})]}),(0,i.Y)("p",{className:"text-xs text-ink/70 leading-relaxed",children:"Connect any public or private Git repository containing skill definitions and prompt directives."}),(0,i.FD)("form",{onSubmit:e=>{e.preventDefault();let t=l.trim().replace(/^https?:\/\/github\.com\//,"").replace(/\/$/,"");if(!t)return void p("Please provide a valid GitHub repository path (e.g. owner/repo).");let i=o.trim()||t.split("/")[1]||t;r({id:`custom-${Date.now()}`,name:i,repo:t,stars:"1.2K",updatedAt:"Just now",skillCount:3,isCustom:!0}),s(""),c(""),p(null),n()},className:"space-y-4",children:[(0,i.FD)("div",{children:[(0,i.Y)("label",{className:"block text-xs font-semibold text-ink/80 mb-1.5",children:"Source Name"}),(0,i.Y)("input",{type:"text",value:o,onChange:e=>c(e.currentTarget.value),placeholder:"e.g. Acme Internal Skills",className:"w-full px-3 py-2 rounded-lg border border-ink/20 hover:border-ink/40 bg-paper focus:outline-none focus:border-ink text-xs text-ink transition-colors"})]}),(0,i.FD)("div",{children:[(0,i.FD)("label",{className:"block text-xs font-semibold text-ink/80 mb-1.5",children:["Git Repository ",(0,i.Y)("span",{className:"text-error",children:"*"})]}),(0,i.Y)("input",{type:"text",value:l,onChange:e=>{s(e.currentTarget.value),p(null)},placeholder:"e.g. owner/skills-repo or https://github.com/...",className:"w-full px-3 py-2 rounded-lg border border-ink/20 hover:border-ink/40 bg-paper focus:outline-none focus:border-ink text-xs font-mono text-ink transition-colors"})]}),d&&(0,i.FD)("div",{className:"flex items-center gap-2 text-xs text-error p-2.5 rounded-lg bg-error/10 border border-error/20",children:[(0,i.Y)(e7.A,{className:"w-4 h-4 flex-shrink-0"}),(0,i.Y)("span",{className:"font-medium",children:d})]}),(0,i.FD)("div",{className:"pt-3 border-t border-ink/10 flex items-center justify-end gap-2",children:[(0,i.Y)("button",{type:"button",onClick:n,className:"px-3.5 py-2 rounded-lg border border-ink/20 hover:border-ink/40 text-xs font-medium text-ink/80 hover:text-ink transition-colors cursor-pointer",children:"Cancel"}),(0,i.FD)("button",{type:"submit",className:"flex items-center gap-1.5 px-4 py-2 rounded-lg bg-ink text-paper text-xs font-medium hover:bg-ink/90 transition-colors shadow-xs cursor-pointer",children:[(0,i.Y)(g.A,{size:14}),(0,i.Y)("span",{children:"Add Source"})]})]})]})]})}):null}function nf(){let{sources:e,catalogSkills:t,userSkills:n,setSources:r,setUserSkills:l,reload:s}=function(){let[e,t]=(0,a.J0)([]),[n,i]=(0,a.J0)([]),[r,l]=(0,a.J0)([]),s=(0,a.hb)(async()=>{let e=await fetch("/api/settings/skills"),n=await e.json();n?.catalogSources&&t(n.catalogSources),n?.catalogSkills&&i(n.catalogSkills),n?.skills&&l(n.skills)},[]);return(0,a.vJ)(()=>{s().catch(console.error)},[s]),{sources:e,catalogSkills:n,userSkills:r,setSources:t,setUserSkills:l,reload:s}}(),[o,c]=(0,a.J0)("anthropic"),[d,p]=(0,a.J0)(""),[u,m]=(0,a.J0)(!1),[h,b]=(0,a.J0)(!1),[f,x]=(0,a.J0)(null),v=new Set(n.map(e=>e?.name).filter(Boolean)),k=e=>{x(e),setTimeout(()=>x(null),2500)},y=t.filter(e=>{let t=!d.trim()||e.name.toLowerCase().includes(d.toLowerCase())||e.description.toLowerCase().includes(d.toLowerCase())||e.repoTag.toLowerCase().includes(d.toLowerCase());return d.trim()?t:e.sourceId===o}),w=e.find(e=>e.id===o)||e[0]||null;return(0,i.FD)("div",{className:"flex-1 flex flex-col h-full w-full scrollbar-overlay-container scrollbar-overlay-static bg-paper text-ink p-6 md:p-8 space-y-6",children:[(0,i.Y)("div",{children:(0,i.Y)("p",{className:"text-xs text-ink/70 leading-relaxed",children:"Install ready-made skills from curated repositories, or add your own source."})}),(0,i.FD)("div",{className:"relative",children:[(0,i.Y)(_.A,{size:15,className:"absolute left-3 top-2.5 text-ink/40 pointer-events-none"}),(0,i.Y)("input",{type:"text",value:d,onChange:e=>p(e.currentTarget.value),placeholder:"Search skills across all sources...",className:"w-full pl-9 pr-4 py-2 rounded-lg border border-ink/20 hover:border-ink/40 bg-paper focus:outline-none focus:border-ink text-xs text-ink transition-colors"})]}),(0,i.FD)("div",{className:"space-y-3",children:[(0,i.Y)("h3",{className:"text-xs font-bold uppercase tracking-wider text-ink",children:"Sources"}),(0,i.FD)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[e.map(e=>{let t=o===e.id&&!d.trim();return(0,i.FD)("div",{onClick:()=>{c(e.id),p("")},className:`p-3.5 rounded-xl border transition-all cursor-pointer select-none relative ${t?"border-ink bg-ink/5 shadow-xs":"border-ink/20 hover:border-ink/40 bg-paper"}`,children:[(0,i.FD)("div",{className:"flex items-center justify-between",children:[(0,i.FD)("div",{className:"flex items-center gap-2",children:[(0,i.Y)("span",{className:"text-xs font-bold text-ink",children:e.name}),(0,i.FD)("span",{className:"text-[10px] text-ink/50 font-mono",children:[e.skillCount," skills"]})]}),(0,i.Y)(U.A,{size:13,className:`text-ink/40 hover:text-ink transition-colors ${u&&t?"animate-spin":""}`})]}),(0,i.Y)("div",{className:"mt-1 font-mono text-[11px] text-ink/60 truncate",children:e.repo}),(0,i.FD)("div",{className:"mt-2.5 flex items-center gap-3 text-[10px] text-ink/50",children:[(0,i.FD)("span",{className:"flex items-center gap-1",children:[(0,i.Y)(np.A,{size:11,className:"text-ink/50"}),(0,i.Y)("span",{children:e.stars})]}),(0,i.Y)("span",{children:e.updatedAt})]})]},e.id)}),(0,i.FD)("div",{onClick:()=>b(!0),className:"p-3.5 rounded-xl border border-dashed border-ink/25 hover:border-ink/50 bg-paper hover:bg-ink/[0.02] transition-all cursor-pointer flex items-center gap-3 select-none",children:[(0,i.Y)("div",{className:"w-8 h-8 rounded-lg border border-ink/20 flex items-center justify-center text-ink/60 flex-shrink-0",children:(0,i.Y)(g.A,{size:16})}),(0,i.FD)("div",{children:[(0,i.Y)("div",{className:"text-xs font-bold text-ink",children:"Add your own source"}),(0,i.Y)("div",{className:"text-[11px] text-ink/60",children:"Any Git repository with skills"})]})]})]})]}),(0,i.FD)("div",{className:"border-t border-ink/10 pt-4",children:[(0,i.FD)("div",{className:"flex items-center justify-between pb-3",children:[(0,i.FD)("div",{className:"flex items-center gap-2",children:[(0,i.Y)("span",{className:"text-xs font-bold uppercase tracking-wider text-ink",children:d.trim()?"Search Results":w?.name?w.name.toUpperCase():"SKILL CATALOG"}),(0,i.FD)("span",{className:"text-xs text-ink/50",children:[y.length," skill(s) found"]})]}),(0,i.Y)("button",{type:"button",onClick:()=>{m(!0),s().then(()=>k("Catalog index synchronized")).catch(console.error).finally(()=>m(!1))},title:"Refresh skills",className:"p-1 rounded-md text-ink/50 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer",children:(0,i.Y)(U.A,{size:14,className:u?"animate-spin":""})})]}),(0,i.Y)("div",{className:"space-y-3",children:0===y.length?(0,i.Y)("div",{className:"text-center py-10 border border-dashed border-ink/15 rounded-xl",children:(0,i.Y)("p",{className:"text-xs text-ink/60",children:"No skills found matching your query."})}):y.map(e=>{let t=v.has(e.name);return(0,i.FD)("div",{className:"p-4 rounded-xl border border-ink/15 hover:border-ink/30 bg-paper transition-all flex flex-col sm:flex-row sm:items-start justify-between gap-3",children:[(0,i.FD)("div",{className:"space-y-1.5 flex-1 min-w-0",children:[(0,i.Y)("div",{className:"flex items-center gap-2",children:(0,i.Y)("span",{className:"text-xs font-bold text-ink tracking-tight font-mono",children:e.name})}),(0,i.Y)("p",{className:"text-xs text-ink/75 leading-relaxed line-clamp-2",children:e.description}),(0,i.FD)("div",{className:"flex items-center gap-1.5 text-[11px] text-ink/50 font-mono pt-1",children:[(0,i.Y)(nu.A,{size:12,className:"flex-shrink-0"}),(0,i.Y)("span",{className:"truncate",children:e.repoTag})]})]}),(0,i.FD)("div",{className:"flex items-center gap-2 flex-shrink-0 self-end sm:self-center",children:[e.githubUrl&&(0,i.Y)("a",{href:e.githubUrl,target:"_blank",rel:"noreferrer",className:"p-1.5 rounded-lg text-ink/50 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer",title:"View repository",children:(0,i.Y)(nm.A,{size:14})}),(0,i.Y)("button",{type:"button",onClick:()=>(e=>{let t=n.find(t=>t.name===e.name);if(t)fetch(`/api/settings/skills?id=${encodeURIComponent(t.id)}`,{method:"DELETE"}).then(e=>e.json()).then(t=>{t?.error||(tJ("command"),fetch("/api/settings/skills").then(e=>e.json()).then(e=>{e?.skills&&l(e.skills)}),k(`Uninstalled skill "${e.name}"`))}).catch(console.error);else{let t={id:`skill-cat-${Date.now()}`,name:e.name,description:e.description,location:"user",locationLabel:"User / OpenCode",instructions:e.instructions||`---
|
|
41
|
-
description: "${e.description}"
|
|
42
|
-
---
|
|
43
|
-
|
|
44
|
-
## Instructions
|
|
45
|
-
Follow standard prompt protocol for ${e.name}.`,project:"ompchamber",isInstalledFromCatalog:!0,catalogSource:e.sourceId};fetch("/api/settings/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({skill:t})}).then(e=>e.json()).then(n=>{n?.skills?l(n.skills):l(e=>[...e,t]),k(`Installed skill "${e.name}"`),tJ("command")}).catch(console.error)}})(e),className:`px-3 py-1.5 rounded-lg text-xs font-medium transition-all flex items-center gap-1.5 cursor-pointer ${t?"border border-ink/20 text-ink/80 hover:border-error hover:text-error hover:bg-error/5":"bg-ink text-paper hover:bg-ink/90 shadow-xs"}`,children:t?(0,i.FD)(i.FK,{children:[(0,i.Y)(D.A,{size:12}),(0,i.Y)("span",{children:"Installed"})]}):(0,i.FD)(i.FK,{children:[(0,i.Y)(nh.A,{size:12}),(0,i.Y)("span",{children:"install"})]})})]})]},e.id)})})]}),(0,i.Y)(nb,{isOpen:h,onClose:()=>b(!1),onAddSource:t=>{let n=[...e,t];r(n),c(t.id),fetch("/api/settings/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({catalogSources:n})}).catch(console.error),k(`Added source "${t.name}"`)}}),f&&(0,i.FD)("div",{className:"fixed bottom-6 right-6 z-50 bg-ink text-paper text-xs font-medium px-4 py-2.5 rounded-lg shadow-lg animate-in fade-in slide-in-from-bottom-2 duration-150 flex items-center gap-2",children:[(0,i.Y)(D.A,{size:14}),(0,i.Y)("span",{children:f})]})]})}function nx(e){let{category:t}=e;return(0,i.FD)("div",{className:"space-y-6 text-ink flex flex-col items-center justify-center py-16",children:[(0,i.FD)("div",{className:"text-sm font-semibold capitalize",children:[t.replace("-"," ")," Settings"]}),(0,i.Y)("div",{className:"text-xs text-ink/60 text-center max-w-sm mt-2",children:"This settings category is currently under construction and will be available soon."})]})}var ng=JSON.parse('{"source":"settings-schema.ts","tabs":[{"id":"appearance","label":"Appearance","groups":["Theme","Composer","Status Line","Display","Images"]},{"id":"model","label":"Model","groups":["Thinking","Sampling","Prompt","Retry & Fallback","Advisor","Prewalk","Vision"]},{"id":"interaction","label":"Interaction","groups":["Input","Approvals","Notifications","Speech","Collab","Magic Keywords","Startup & Updates","Power","Agent","Git"]},{"id":"context","label":"Context","groups":["General","Compaction","Rules (TTSR)","Experimental"]},{"id":"memory","label":"Memory","groups":["General","Auto-Learn","Mnemopi","Hindsight","Sharpshooter"]},{"id":"files","label":"Files","groups":["Editing","Reading","Read Summaries","LSP"]},{"id":"shell","label":"Shell","groups":["Bash","Eval & Runtimes"]},{"id":"tools","label":"Tools","groups":["Available Tools","Todos","Grep & Browser","Computer","GitHub","Output Limits","Execution","Discovery & MCP","Extensions","Developer"]},{"id":"tasks","label":"Tasks","groups":["Modes","Subagents","Isolation","Commands & Skills"]},{"id":"providers","label":"Providers","groups":["Services","Fireworks","Tiny Model","Protocol","Timeouts","Privacy"]}],"entries":{"autoResume":{"ui":{"tab":"interaction","group":"Startup & Updates","label":"Auto Resume","description":"Automatically resume the most recent session in the current directory"},"type":"boolean","default":false},"power.sleepPrevention":{"ui":{"tab":"interaction","group":"Power","label":"Sleep Prevention","description":"Prevent the system sleeping during active sessions. Each level is cumulative — it adds the flags of all lower levels.","options":[{"value":"off","label":"Off","description":"Do not prevent any sleep"},{"value":"idle","label":"Prevent Idle Sleep","description":"Keep the system awake while a session is open (macOS `caffeinate -i`)"},{"value":"display","label":"Prevent Display Sleep","description":"Also keep the display from idle-sleeping (macOS `caffeinate -i -d`)"},{"value":"system","label":"Prevent System Sleep","description":"Also block all system sleep on AC and declare the user active (macOS `caffeinate -i -d -s -u`)"}]},"type":"enum","default":"idle","values":["off","idle","display","system"]},"advisor.enabled":{"ui":{"tab":"model","group":"Advisor","label":"Enable Advisor","description":"Pair a second model (assigned to the \'advisor\' role) that passively reviews each turn and injects notes."},"type":"boolean","default":false},"prewalk.enabled":{"ui":{"tab":"model","group":"Prewalk","label":"Enable Prewalk","description":"Start on the active model, then switch to a fast/cheap model (default the \'smol\' role) at the first edit/write after the plan nudge\'s todo list exists — the strong model plans, commits the todos, and starts the implementation before handing off. Overridable per session with --prewalk / --no-prewalk."},"type":"boolean","default":false},"advisor.syncBacklog":{"ui":{"tab":"model","group":"Advisor","label":"Advisor Sync Backlog","description":"Pause the main agent for up to 30 seconds if the advisor falls behind by this many turns. Off disables catch-up delays.","condition":"advisorEnabled"},"type":"enum","default":"off","values":["off","1","3","5"]},"advisor.immuneTurns":{"ui":{"tab":"model","group":"Advisor","label":"Advisor Immune Turns","description":"After an advisor concern or blocker interrupts, route further concerns/blockers non-interruptingly for this many primary turns.","condition":"advisorEnabled","options":[{"value":"0","label":"0 turns","description":"Allow every concern/blocker to interrupt."},{"value":"1","label":"1 turn","description":""},{"value":"2","label":"2 turns","description":""},{"value":"3","label":"3 turns","description":"Default."},{"value":"4","label":"4 turns","description":""},{"value":"5","label":"5 turns","description":""}]},"type":"number","default":3},"advisor.maxNotesPerUpdate":{"ui":{"tab":"model","group":"Advisor","label":"Advisor Max Notes Per Update","description":"Maximum non-blocker advice notes accepted per advisor prompt update (1–32; UI offers 1–5 quick picks). Blockers are exempt.","condition":"advisorEnabled","options":[{"value":"1","label":"1 note","description":"Anti-flood (strict)."},{"value":"2","label":"2 notes","description":""},{"value":"3","label":"3 notes","description":""},{"value":"4","label":"4 notes","description":"Default."},{"value":"5","label":"5 notes","description":""}]},"type":"number","default":4},"git.enabled":{"ui":{"tab":"interaction","group":"Git","label":"Enable Git Integration","description":"Show git branch, status, and PR information in the TUI and watch repository metadata."},"type":"boolean","default":true},"providers.maxInFlightRequests":{"ui":{"tab":"providers","group":"Services","label":"Max In-Flight Requests","description":"Maximum concurrent LLM requests per provider id (for example \\"openai\\" or \\"anthropic\\"), shared across local OMP processes with this config root. Omitted providers are unlimited."},"type":"record","default":{}},"providers.openai-codex.codeMode":{"ui":{"tab":"providers","group":"Services","label":"Codex Code Mode","description":"Route Codex code_mode_only models (GPT-5.6) through eval. The direct tools are eval, ask, todo, yield, think, checkpoint, and rewind. Use eval cells for other session tools. Mirrors codex-rs Code Mode. \'auto\' follows the model catalog flag."},"type":"enum","default":"off","values":["off","on","auto"]},"providers.openai-codex.codeModeDirectTools":{"ui":{"tab":"providers","group":"Services","label":"Codex Code Mode Direct Tools","description":"Extra direct tools for Codex Code Mode. The standard direct tools are eval, ask, todo, yield, think, checkpoint, and rewind."},"type":"array","default":[]},"modelRoleStorage":{"ui":{"tab":"model","group":"Prompt","label":"Model Role Storage","description":"Where model selector role assignments are saved","options":[{"value":"global","label":"Global","description":"Save role models in the active profile config (current behavior)"},{"value":"project","label":"Per-project","description":"Save project role models in .omp/config.yml; missing project roles use global defaults"}]},"type":"enum","default":"global","values":["global","project"]},"theme.dark":{"ui":{"tab":"appearance","group":"Theme","label":"Dark Theme","description":"Theme used when the terminal has a dark background","options":"runtime"},"type":"string","default":"titanium"},"theme.light":{"ui":{"tab":"appearance","group":"Theme","label":"Light Theme","description":"Theme used when the terminal has a light background","options":"runtime"},"type":"string","default":"light"},"symbolPreset":{"ui":{"tab":"appearance","group":"Theme","label":"Symbol Preset","description":"Glyph set for icons and symbols (Unicode, Nerd Font, or ASCII)","options":[{"value":"unicode","label":"Unicode","description":"Standard symbols (default)"},{"value":"nerd","label":"Nerd Font","description":"Requires Nerd Font"},{"value":"ascii","label":"ASCII","description":"Maximum compatibility"}]},"type":"enum","default":"unicode","values":["unicode","nerd","ascii"]},"colorBlindMode":{"ui":{"tab":"appearance","group":"Theme","label":"Color-Blind Mode","description":"Use blue instead of green for diff additions"},"type":"boolean","default":false},"composer.shape":{"ui":{"tab":"appearance","group":"Composer","label":"Composer Shape","description":"Visual layout of the input editor and status line","options":"runtime"},"type":"string","default":"band"},"statusLine.preset":{"ui":{"tab":"appearance","group":"Status Line","label":"Status Line Preset","description":"Pre-built status line configurations","options":[{"value":"default","label":"Default","description":"Model, path, git, context, tokens, cost"},{"value":"minimal","label":"Minimal","description":"Path and git only"},{"value":"compact","label":"Compact","description":"Model, git, cost, context"},{"value":"full","label":"Full","description":"All segments including time"},{"value":"nerd","label":"Nerd","description":"Maximum info with Nerd Font icons"},{"value":"ascii","label":"ASCII","description":"No special characters"},{"value":"custom","label":"Custom","description":"User-defined segments"}]},"type":"enum","default":"default","values":["default","minimal","compact","full","nerd","ascii","custom"]},"statusLine.separator":{"ui":{"tab":"appearance","group":"Status Line","label":"Status Line Separator","description":"Style of separators between segments","options":[{"value":"powerline","label":"Powerline","description":"Solid arrows (Nerd Font)"},{"value":"powerline-thin","label":"Thin chevron","description":"Thin arrows (Nerd Font)"},{"value":"slash","label":"Slash","description":"Forward slashes"},{"value":"pipe","label":"Pipe","description":"Vertical pipes"},{"value":"block","label":"Block","description":"Solid blocks"},{"value":"none","label":"None","description":"Space only"},{"value":"ascii","label":"ASCII","description":"Greater-than signs"}]},"type":"enum","default":"powerline-thin","values":["powerline","powerline-thin","slash","pipe","block","none","ascii"]},"statusLine.contextLine":{"ui":{"tab":"appearance","group":"Status Line","label":"Context-Reactive Line","description":"How the line between the left and right segments reflects context usage (box composer only)","options":[{"value":"off","label":"Off","description":"Solid accent line, no context feedback"},{"value":"percentage","label":"Percentage","description":"Used portion in accent color, remainder dimmed"},{"value":"annotated","label":"Annotated","description":"Percentage plus ticks at the speculative and auto-compaction boundaries"},{"value":"embedded","label":"Embedded","description":"Annotated line with the context percentage and window embedded in the gauge"}]},"type":"enum","default":"embedded","values":["off","percentage","annotated","embedded"]},"statusLine.sessionAccent":{"ui":{"tab":"appearance","group":"Status Line","label":"Session Accent","description":"Use the session name color for the editor border and status line gap"},"type":"boolean","default":true},"statusLine.transparent":{"ui":{"tab":"appearance","group":"Status Line","label":"Transparent Status Line","description":"Use the terminal\'s default background for the status line instead of the theme\'s `statusLineBg`. Powerline end caps are dropped because they need a contrasting fill to bridge into the surrounding terminal."},"type":"boolean","default":false},"statusLine.compactThinkingLevel":{"ui":{"tab":"appearance","group":"Status Line","label":"Compact Thinking Level","description":"Show the thinking level as a single icon on the model name instead of a separate ` · <level>` suffix."},"type":"boolean","default":true},"tools.artifactSpillThreshold":{"ui":{"tab":"tools","group":"Output Limits","label":"Artifact Spill Threshold (KB)","description":"Tool output above this size is saved as an artifact; tail is kept inline","options":[{"value":"1","label":"1 KB","description":"~250 tokens"},{"value":"2.5","label":"2.5 KB","description":"~625 tokens"},{"value":"5","label":"5 KB","description":"~1.25K tokens"},{"value":"10","label":"10 KB","description":"~2.5K tokens"},{"value":"20","label":"20 KB","description":"~5K tokens"},{"value":"30","label":"30 KB","description":"~7.5K tokens"},{"value":"50","label":"50 KB","description":"Default; ~12.5K tokens"},{"value":"75","label":"75 KB","description":"~19K tokens"},{"value":"100","label":"100 KB","description":"~25K tokens"},{"value":"200","label":"200 KB","description":"~50K tokens"},{"value":"500","label":"500 KB","description":"~125K tokens"},{"value":"1000","label":"1 MB","description":"~250K tokens"}]},"type":"number","default":50},"tools.artifactTailBytes":{"ui":{"tab":"tools","group":"Output Limits","label":"Artifact Tail Size (KB)","description":"Amount of tail content kept inline when output spills to artifact","options":[{"value":"1","label":"1 KB","description":"~250 tokens"},{"value":"2.5","label":"2.5 KB","description":"~625 tokens"},{"value":"5","label":"5 KB","description":"~1.25K tokens"},{"value":"10","label":"10 KB","description":"~2.5K tokens"},{"value":"20","label":"20 KB","description":"Default; ~5K tokens"},{"value":"50","label":"50 KB","description":"~12.5K tokens"},{"value":"100","label":"100 KB","description":"~25K tokens"},{"value":"200","label":"200 KB","description":"~50K tokens"}]},"type":"number","default":20},"tools.artifactHeadBytes":{"ui":{"tab":"tools","group":"Output Limits","label":"Artifact Head Size (KB)","description":"Amount of head content kept inline alongside the tail when output spills to artifact (middle elision). 0 disables — keep tail only.","options":[{"value":"0","label":"0 KB","description":"Disabled; tail-only truncation"},{"value":"1","label":"1 KB","description":"~250 tokens"},{"value":"2.5","label":"2.5 KB","description":"~625 tokens"},{"value":"5","label":"5 KB","description":"~1.25K tokens"},{"value":"10","label":"10 KB","description":"~2.5K tokens"},{"value":"20","label":"20 KB","description":"Default; ~5K tokens"},{"value":"50","label":"50 KB","description":"~12.5K tokens"},{"value":"100","label":"100 KB","description":"~25K tokens"},{"value":"200","label":"200 KB","description":"~50K tokens"}]},"type":"number","default":20},"tools.outputMaxColumns":{"ui":{"tab":"tools","group":"Output Limits","label":"Output Column Cap","description":"Per-line byte cap for streaming tool outputs (bash, python, js eval) and `read`. Lines wider than this are ellipsis-truncated; remaining bytes up to the next newline are dropped. 0 disables.","options":[{"value":"0","label":"Off","description":"No per-line cap"},{"value":"256","label":"256","description":"Tight"},{"value":"512","label":"512","description":""},{"value":"768","label":"768","description":"Default"},{"value":"1024","label":"1024","description":""},{"value":"2048","label":"2048","description":""},{"value":"4096","label":"4096","description":"Loose"}]},"type":"number","default":768},"tools.artifactTailLines":{"ui":{"tab":"tools","group":"Output Limits","label":"Artifact Tail Lines","description":"Maximum lines of tail content kept inline when output spills to artifact","options":[{"value":"50","label":"50 lines","description":"~250 tokens"},{"value":"100","label":"100 lines","description":"~500 tokens"},{"value":"250","label":"250 lines","description":"~1.25K tokens"},{"value":"500","label":"500 lines","description":"Default; ~2.5K tokens"},{"value":"1000","label":"1000 lines","description":"~5K tokens"},{"value":"2000","label":"2000 lines","description":"~10K tokens"},{"value":"5000","label":"5000 lines","description":"~25K tokens"}]},"type":"number","default":500},"statusLine.showHookStatus":{"ui":{"tab":"appearance","group":"Status Line","label":"Show Hook Status","description":"Display hook status messages below the status line"},"type":"boolean","default":true},"terminal.showImages":{"ui":{"tab":"appearance","group":"Images","label":"Show Inline Images","description":"Render images inline in the terminal","condition":"hasImageProtocol"},"type":"boolean","default":true},"images.autoResize":{"ui":{"tab":"appearance","group":"Images","label":"Auto-Resize Images","description":"Resize large images to 2000x2000 max for better model compatibility"},"type":"boolean","default":true},"images.blockImages":{"ui":{"tab":"appearance","group":"Images","label":"Block Images","description":"Prevent images from being sent to LLM providers"},"type":"boolean","default":false},"images.describeForTextModels":{"ui":{"tab":"model","group":"Vision","label":"Describe Images for Text Models","description":"When an image is attached to a model without vision support, save it under local:// and inject a description from a vision-capable model instead of dropping it"},"type":"boolean","default":true},"images.urls.enabled":{"ui":{"tab":"model","group":"Vision","label":"Serve Images as URLs","description":"Publish outgoing images through the configured backend chain and send URL-fetching providers short URLs instead of inline base64. Falls back to inline automatically when every backend or a provider fetch fails"},"type":"boolean","default":false},"images.urls.backends":{"ui":{"tab":"model","group":"Vision","label":"Image URL Backends","description":"Ordered destinations tried when publishing images for provider access","ordered":true,"options":[{"value":"imgur","label":"Imgur","description":"Uploads require either an Imgur access token or client ID."},{"value":"imageshack","label":"ImageShack","description":"The API requires a paid subscription."},{"value":"flickr","label":"Flickr","description":"image-host"},{"value":"chevereto","label":"Chevereto","description":"self-hosted"},{"value":"vgyme","label":"vgy.me","description":"image-host"},{"value":"dropbox","label":"Dropbox","description":"cloud-files"},{"value":"ftp","label":"FTP / FTPS / SFTP","description":"file-transfer"},{"value":"onedrive","label":"OneDrive","description":"cloud-files"},{"value":"google-drive","label":"Google Drive","description":"cloud-files"},{"value":"puush","label":"puush-compatible endpoint","description":"The public service is defunct; a replacement endpoint is required."},{"value":"box","label":"Box","description":"cloud-files"},{"value":"amazon-s3","label":"Amazon S3","description":"s3"},{"value":"google-cloud-storage","label":"Google Cloud Storage","description":"object-storage"},{"value":"azure-storage","label":"Azure Blob Storage","description":"object-storage"},{"value":"backblaze-b2","label":"Backblaze B2","description":"Configure either native B2 application keys or S3-compatible access keys."},{"value":"owncloud","label":"ownCloud / Nextcloud","description":"webdav"},{"value":"mediafire","label":"MediaFire-compatible endpoint","description":"The public API is deprecated; a replacement endpoint is required."},{"value":"sendspace","label":"SendSpace-compatible endpoint","description":"The public discovery API is deprecated; a replacement endpoint is required."},{"value":"localhostr","label":"Hostr-compatible endpoint","description":"The public service is offline; a replacement endpoint is required."},{"value":"lambda","label":"Lambda-compatible endpoint","description":"The public service is offline; a replacement endpoint is required."},{"value":"pomf","label":"Pomf","description":"pomf"},{"value":"uguu","label":"Uguu","description":"Public uploads expire after approximately three hours."},{"value":"seafile","label":"Seafile","description":"cloud-files"},{"value":"s-ul","label":"s-ul","description":"file-host"},{"value":"lobfile","label":"LobFile-compatible endpoint","description":"The public service is offline; a replacement endpoint is required."},{"value":"transfer-sh","label":"transfer.sh-compatible endpoint","description":"The defunct public endpoint is blocked; a self-hosted replacement is required."},{"value":"plik","label":"Plik","description":"self-hosted"},{"value":"shared-folder","label":"Shared folder","description":"filesystem"},{"value":"catbox","label":"Catbox","description":"anonymous-host"},{"value":"litterbox","label":"Litterbox","description":"Uploads are temporary."},{"value":"0x0","label":"0x0.st","description":"Public uploads expire after a retention window determined by file size."},{"value":"tmpfiles","label":"tmpfiles.org","description":"Public uploads are temporary."},{"value":"discord","label":"Discord","description":"messaging"},{"value":"provider-files","label":"Model provider files","description":"Provider file references are API-local rather than public image URLs."},{"value":"direct","label":"Direct public URL","description":"local-serving"},{"value":"cloudflared","label":"Cloudflare quick tunnel","description":"tunnel"},{"value":"ngrok","label":"ngrok","description":"tunnel"},{"value":"tailscale","label":"Tailscale Funnel","description":"tunnel"},{"value":"ssh","label":"SSH reverse tunnel","description":"tunnel"},{"value":"command","label":"Uploader command","description":"external-command"},{"value":"localhost-run","label":"localhost.run","description":"tunnel"},{"value":"pinggy","label":"Pinggy","description":"tunnel"},{"value":"devtunnel","label":"Microsoft dev tunnel","description":"The devtunnel CLI must be logged in locally."},{"value":"zrok","label":"zrok","description":"The local zrok environment must be enabled."},{"value":"bore","label":"bore","description":"tunnel"},{"value":"named-cloudflared","label":"Named Cloudflare Tunnel","description":"tunnel"},{"value":"r2","label":"Cloudflare R2","description":"s3"},{"value":"tigris","label":"Tigris","description":"s3"},{"value":"minio","label":"MinIO","description":"s3"},{"value":"garage","label":"Garage","description":"s3"}]},"type":"array","default":["provider-files","tailscale","cloudflared","litterbox"]},"images.urls.command":{"ui":{"tab":"model","group":"Vision","label":"Image Upload Command","description":"Argv template for the command backend; {file} is the image path, {mime}/{ext} optional. The last URL printed on stdout is used (e.g. pasta -b -f {file})"},"type":"string"},"images.urls.publicBaseUrl":{"ui":{"tab":"model","group":"Vision","label":"Image URL Public Base","description":"Externally reachable base URL fronting the blob server (required for ssh, optional for direct)"},"type":"string"},"images.urls.ttlHours":{"ui":{"tab":"model","group":"Vision","label":"Image URL Lifetime (hours)","description":"Serving window for locally hosted image URLs, measured from the last time a conversation sent them; resuming a conversation re-arms the window at the same link. 0 keeps links alive while the broker runs"},"type":"number","default":72},"images.urls.bindHost":{"ui":{"tab":"model","group":"Vision","label":"Image URL Bind Host","description":"Host the blob server binds to; loopback for tunnels, 0.0.0.0 for direct serving"},"type":"string","default":"127.0.0.1"},"images.urls.sshTarget":{"ui":{"tab":"model","group":"Vision","label":"Image URL SSH Target","description":"user@host destination for the ssh reverse forward"},"type":"string"},"images.urls.sshRemotePort":{"ui":{"tab":"model","group":"Vision","label":"Image URL SSH Remote Port","description":"Remote listen port of the ssh reverse forward that your web server proxies to"},"type":"number","default":8787},"tui.resizeScrollback":{"ui":{"tab":"appearance","group":"Display","label":"Resize Scrollback","description":"How a settled terminal resize refreshes transcript rows retained in terminal scrollback","options":[{"value":"append","label":"Append","description":"Replay the transcript at the new width below retained history"},{"value":"rebuild","label":"Rebuild","description":"Erase all terminal scrollback, then replay one current-width transcript"},{"value":"preserve","label":"Preserve","description":"Repaint only the viewport and keep history wrapped at its old width"}]},"type":"enum","default":"rebuild","values":["append","rebuild","preserve"]},"terminal.showProgress":{"ui":{"tab":"appearance","group":"Display","label":"Native Terminal Progress","description":"Emit OSC 9;4 indeterminate progress while the agent or context maintenance is running"},"type":"boolean","default":false},"tui.textSizing":{"ui":{"tab":"appearance","group":"Display","label":"Large Headings (Kitty)","description":"Render Markdown H1 headings at 2x scale using Kitty\'s OSC 66 text-sizing protocol. Only takes effect on Kitty terminals; ignored everywhere else. Off by default."},"type":"boolean","default":false},"tui.renderMermaid":{"ui":{"tab":"appearance","group":"Display","label":"Render Mermaid Diagrams","description":"Render Mermaid fenced code blocks as ASCII diagrams"},"type":"boolean","default":true},"tui.reactions":{"ui":{"tab":"appearance","group":"Display","label":"Agent Reactions","description":"Invite the agent to react to your message with an emoji badge on its bubble"},"type":"boolean","default":true},"tui.codexResetFireworks":{"ui":{"tab":"appearance","group":"Display","label":"Codex Reset Fireworks","description":"Celebrate unscheduled Codex weekly usage resets and newly banked saved resets with a top-third fireworks overlay that remains until Escape"},"type":"boolean","default":false},"tui.titleState":{"ui":{"tab":"appearance","group":"Display","label":"Terminal Title Run State","description":"Show the agent run state in the terminal title\'s separator — an animated spinner while working (a static \':\' under WSL), \'>\' when it\'s your turn, \'!\' when the agent is waiting on you"},"type":"boolean","default":true},"tui.titleSpinner":{"ui":{"tab":"appearance","group":"Display","label":"Terminal Title Spinner","description":"Glyph set for the working-state spinner in the terminal title — braille sweep, filling moon, single-dot cycle, or ASCII-safe line","options":[{"value":"braille","label":"Braille","description":"Classic ⠋⠙⠹ sweep (default)"},{"value":"pulse","label":"Pulse","description":"Moon filling ○◑● then emptying"},{"value":"dots","label":"Dots","description":"Single braille dots cycling"},{"value":"line","label":"Line","description":"ASCII - \\\\ | / for fonts without braille coverage"}]},"type":"enum","default":"braille","values":["braille","pulse","dots","line"]},"tui.hyperlinks":{"ui":{"tab":"appearance","group":"Display","label":"Terminal Hyperlinks","description":"Wrap paths and URLs in OSC 8 hyperlinks for terminal-native click-to-open (auto: detect support; off: never; always: unconditional)"},"type":"enum","default":"auto","values":["off","auto","always"]},"tui.mouse":{"ui":{"tab":"appearance","group":"Display","label":"Mouse Click-to-Focus","description":"Capture mouse clicks in the main session so live subagent cards and HUD rows focus on click, with a hover highlight on the target. Native text selection becomes Shift+drag and wheel scroll becomes Shift+wheel while on"},"type":"boolean","default":false},"tui.tight":{"ui":{"tab":"appearance","group":"Display","label":"Tight Layout","description":"Remove the 1-character horizontal padding from the left and right of the terminal output"},"type":"boolean","default":false},"display.shimmer":{"ui":{"tab":"appearance","group":"Display","label":"Shimmer","description":"Animation style for working/loading messages","options":[{"value":"classic","label":"Classic","description":"Soft cosine wave sweeping across the text"},{"value":"kitt","label":"KITT Scanner","description":"Knight Rider 1982 red light bouncing left-right"},{"value":"disabled","label":"Disabled","description":"No animation; static muted text"}]},"type":"enum","default":"classic","values":["classic","kitt","disabled"]},"display.pinnedAgents":{"ui":{"tab":"appearance","group":"Display","label":"Pinned Agents","description":"Pinned live-agent jump list above the editor (off hides it; collapsed shows a few rows with an expander; full lists all)","options":[{"value":"off","label":"Off","description":"Hide the pinned jump list"},{"value":"collapsed","label":"Collapsed","description":"Show a few rows with an expander"},{"value":"full","label":"Full","description":"Always list every live agent"}]},"type":"enum","default":"collapsed","values":["off","collapsed","full"]},"display.smoothStreaming":{"ui":{"tab":"appearance","group":"Display","label":"Smooth Streaming","description":"Reveal assistant text and streamed tool input smoothly while chunks arrive"},"type":"boolean","default":true},"display.hideToolActivity":{"ui":{"tab":"appearance","group":"Display","label":"Hide Tool Activity","description":"Hide model-initiated tool calls and results from the transcript"},"type":"boolean","default":false},"display.showTokenUsage":{"ui":{"tab":"appearance","group":"Display","label":"Show Token Usage","description":"Show per-turn token usage on assistant messages"},"type":"boolean","default":false},"display.showTurnTime":{"ui":{"tab":"appearance","group":"Display","label":"Show Turn Time","description":"Show the total prompt-to-yield time (including tool calls) on assistant message usage rows"},"type":"boolean","default":false},"display.cacheMissMarker":{"ui":{"tab":"appearance","group":"Display","label":"Cache Miss Marker","description":"Show a divider after an assistant turn whose request lost (missed) the prompt cache"},"type":"boolean","default":false},"display.collapseCompacted":{"ui":{"tab":"appearance","group":"Display","label":"Collapse Compacted History","description":"Collapse pre-compaction history behind the summary divider on the live transcript; disable to keep the full transcript inline with dividers at each compaction point"},"type":"boolean","default":true},"showHardwareCursor":{"ui":{"tab":"appearance","group":"Display","label":"Show Hardware Cursor","description":"Show terminal cursor for IME support"},"type":"boolean","default":true},"tui.imeSafeCursor":{"ui":{"tab":"appearance","group":"Display","label":"IME-Safe Prompt Layout","description":"Move the prompt\'s bottom border to a separate row so macOS IME preedit cannot displace it"},"type":"boolean","default":false},"defaultThinkingLevel":{"ui":{"tab":"model","group":"Thinking","label":"Thinking Level","description":"Reasoning depth for thinking-capable models","options":[{"value":"auto","label":"auto","description":"Auto-detect per prompt"},{"value":"minimal","label":"min","description":"Very brief reasoning (~1k tokens)"},{"value":"low","label":"low","description":"Light reasoning (~2k tokens)"},{"value":"medium","label":"medium","description":"Moderate reasoning (~8k tokens)"},{"value":"high","label":"high","description":"Deep reasoning (~16k tokens)"},{"value":"xhigh","label":"xhigh","description":"Extended reasoning (~32k tokens)"},{"value":"max","label":"max","description":"Maximum reasoning the model supports"}]},"type":"enum","default":"high","values":["minimal","low","medium","high","xhigh","max","auto"]},"hideThinkingBlock":{"ui":{"tab":"model","group":"Thinking","label":"Hide Thinking Blocks","description":"Hide thinking blocks in assistant responses"},"type":"boolean","default":false},"proseOnlyThinking":{"ui":{"tab":"model","group":"Thinking","label":"Prose Only Thinking","description":"Omit code blocks from thinking summaries and replace them with an ellipsis"},"type":"boolean","default":true},"omitThinking":{"ui":{"tab":"model","group":"Thinking","label":"Omit Thinking summaries","description":"Instruct upstream providers to completely omit thinking summaries from responses (where supported)"},"type":"boolean","default":false},"externalThinking":{"ui":{"tab":"model","group":"Thinking","label":"External Thinking","description":"Private scratchpad; not shown to user. Disables supported GPT, Claude, and Gemini reasoning","warning":"At your own risk: providers have flagged this request shape as abuse, up to account-level enforcement"},"type":"boolean","default":false},"model.loopGuard.enabled":{"ui":{"tab":"model","group":"Thinking","label":"Loop Guard","description":"Enable automatic stream loop detection for model reasoning and prose"},"type":"boolean","default":true},"model.loopGuard.checkAssistantContent":{"ui":{"tab":"model","group":"Thinking","label":"Loop Guard Scan Prose","description":"Apply loop guard to assistant prose messages in addition to thinking logs"},"type":"boolean","default":true},"model.loopGuard.toolCallReminder":{"ui":{"tab":"model","group":"Thinking","label":"Loop Guard Tool-Call Reminder","description":"When a Gemini reasoning stream emits many consecutive planning headers without calling a tool, interrupt it and inject a reminder to issue a tool call (requires Loop Guard)"},"type":"boolean","default":true},"model.toolCallLoopGuard.enabled":{"ui":{"tab":"model","group":"Thinking","label":"Tool-Call Loop Guard","description":"Detect consecutive identical tool calls across turns and inject a corrective steer"},"type":"boolean","default":true},"model.toolCallLoopGuard.threshold":{"ui":{"tab":"model","group":"Thinking","label":"Tool-Call Loop Threshold","description":"Consecutive identical tool calls required before the corrective steer is injected"},"type":"number","default":5},"model.toolCallLoopGuard.exemptTools":{"ui":{"tab":"model","group":"Thinking","label":"Tool-Call Loop Exempt Tools","description":"Tool names that may repeat consecutively without triggering the cross-turn loop guard"},"type":"array","default":["hub"]},"inlineToolDescriptors":{"ui":{"tab":"model","group":"Prompt","label":"Inline Tool Descriptors","description":"Render full tool descriptors in the system prompt and strip top-level/nested descriptions from provider tool schemas so descriptor text is sent once. Auto enables this for Gemini models and disables it otherwise","options":[{"value":"auto","label":"Auto","description":"Inline descriptors for Gemini models; keep them in tool schemas otherwise"},{"value":"on","label":"On","description":"Always inline descriptors in the system prompt"},{"value":"off","label":"Off","description":"Keep descriptors in provider tool schemas only"}]},"type":"enum","default":"auto","values":["auto","on","off"]},"includeModelInPrompt":{"ui":{"tab":"model","group":"Prompt","label":"Include Model in Prompt","description":"Surface the active model identifier in the system prompt so the agent knows which model it is"},"type":"boolean","default":true},"includeWorkspaceTree":{"ui":{"tab":"model","group":"Prompt","label":"Include Workspace Tree","description":"Render the workspace directory tree in the system prompt. WARNING: This can bust prompt caching across sessions when files are modified."},"type":"boolean","default":false},"skillful":{"ui":{"tab":"model","group":"Prompt","label":"List Skills in Prompt","description":"List available skills in the system prompt; disable to save context and toggle per-session with /skillful"},"type":"boolean","default":true},"workspace.additionalDirectories":{"ui":{"tab":"context","group":"General","label":"Additional Workspace Dirs","description":"Extra workspace directories added to every session as additional roots (multi-root workspace). Managed live via /add-dir and /remove-dir. Paths resolve relative to cwd; absolute paths recommended. The agent is told these roots exist and can read/grep/glob them."},"type":"array","default":[]},"personality":{"ui":{"tab":"model","group":"Prompt","label":"Personality","description":"Communication style rendered into the system prompt\'s personality block","options":[{"value":"default","label":"Default","description":"Terse, evidence-first engineer; dense, action-oriented replies"},{"value":"friendly","label":"Friendly","description":"Warm, encouraging collaborator focused on momentum and morale"},{"value":"pragmatic","label":"Pragmatic","description":"Direct, efficient engineer focused on clarity and rigor"},{"value":"none","label":"None","description":"Omit the personality block entirely"}]},"type":"enum","default":"default","values":["default","friendly","pragmatic","none"]},"temperature":{"ui":{"tab":"model","group":"Sampling","label":"Temperature","description":"Sampling temperature (0 = deterministic, 1 = creative, -1 = provider default)","options":[{"value":"-1","label":"Default","description":"Use provider default"},{"value":"0","label":"0","description":"Deterministic"},{"value":"0.2","label":"0.2","description":"Focused"},{"value":"0.5","label":"0.5","description":"Balanced"},{"value":"0.7","label":"0.7","description":"Creative"},{"value":"1","label":"1","description":"Maximum variety"}]},"type":"number","default":-1},"topP":{"ui":{"tab":"model","group":"Sampling","label":"Top P","description":"Nucleus sampling cutoff (0-1, -1 = provider default)","options":[{"value":"-1","label":"Default","description":"Use provider default"},{"value":"0.1","label":"0.1","description":"Very focused"},{"value":"0.3","label":"0.3","description":"Focused"},{"value":"0.5","label":"0.5","description":"Balanced"},{"value":"0.9","label":"0.9","description":"Broad"},{"value":"1","label":"1","description":"No nucleus filtering"}]},"type":"number","default":-1},"topK":{"ui":{"tab":"model","group":"Sampling","label":"Top K","description":"Sample from top-K tokens (-1 = provider default)","options":[{"value":"-1","label":"Default","description":"Use provider default"},{"value":"1","label":"1","description":"Greedy top token"},{"value":"20","label":"20","description":"Focused"},{"value":"40","label":"40","description":"Balanced"},{"value":"100","label":"100","description":"Broad"}]},"type":"number","default":-1},"minP":{"ui":{"tab":"model","group":"Sampling","label":"Min P","description":"Minimum probability threshold (0-1, -1 = provider default)","options":[{"value":"-1","label":"Default","description":"Use provider default"},{"value":"0.01","label":"0.01","description":"Very permissive"},{"value":"0.05","label":"0.05","description":"Balanced"},{"value":"0.1","label":"0.1","description":"Strict"}]},"type":"number","default":-1},"presencePenalty":{"ui":{"tab":"model","group":"Sampling","label":"Presence Penalty","description":"Penalty for introducing already-present tokens (-1 = provider default)","options":[{"value":"-1","label":"Default","description":"Use provider default"},{"value":"0","label":"0","description":"No penalty"},{"value":"0.5","label":"0.5","description":"Mild novelty"},{"value":"1","label":"1","description":"Encourage novelty"},{"value":"2","label":"2","description":"Strong novelty"}]},"type":"number","default":-1},"repetitionPenalty":{"ui":{"tab":"model","group":"Sampling","label":"Repetition Penalty","description":"Penalty for repeated tokens (-1 = provider default)","options":[{"value":"-1","label":"Default","description":"Use provider default"},{"value":"0.8","label":"0.8","description":"Allow repetition"},{"value":"1","label":"1","description":"No penalty"},{"value":"1.1","label":"1.1","description":"Mild penalty"},{"value":"1.2","label":"1.2","description":"Balanced"},{"value":"1.5","label":"1.5","description":"Strong penalty"}]},"type":"number","default":-1},"textVerbosity":{"ui":{"tab":"model","group":"Sampling","label":"Text Verbosity","description":"OpenAI Responses and Codex response verbosity (low, medium, or high)","options":[{"value":"low","label":"Low","description":"Prefer concise responses"},{"value":"medium","label":"Medium","description":"Balance brevity and detail (default)"},{"value":"high","label":"High","description":"Prefer detailed responses"}]},"type":"enum","default":"medium","values":["low","medium","high"]},"tier.openai":{"ui":{"tab":"model","group":"Sampling","label":"Service Tier — OpenAI","description":"Processing tier for OpenAI / OpenAI-Codex requests, and OpenAI-family models routed via OpenRouter (none = omit). Sent as `service_tier`.","options":[{"value":"none","label":"None","description":"Omit service_tier (standard processing)"},{"value":"auto","label":"Auto","description":"Provider default tier selection"},{"value":"default","label":"Default","description":"Standard priority processing"},{"value":"flex","label":"Flex","description":"Lower cost, higher latency when available"},{"value":"scale","label":"Scale","description":"Scale Tier credits when available"},{"value":"priority","label":"Priority","description":"Faster, higher cost (premium request)"}]},"type":"enum","default":"none","values":["none","auto","default","flex","scale","priority"]},"tier.anthropic":{"ui":{"tab":"model","group":"Sampling","label":"Service Tier — Anthropic","description":"Processing tier for Claude requests. `priority` realizes fast mode (`speed: \\"fast\\"`) on supported direct Anthropic models; ignored on Bedrock/Vertex Claude and via OpenRouter.","options":[{"value":"none","label":"None","description":"Standard processing"},{"value":"priority","label":"Priority","description":"Fast mode (`speed: \\"fast\\"`) on supported direct Claude models; ignored on Bedrock/Vertex"}]},"type":"enum","default":"none","values":["none","priority"]},"tier.google":{"ui":{"tab":"model","group":"Sampling","label":"Service Tier — Google","description":"Processing tier for Gemini (Google AI Studio + Vertex) requests, and Google-family models routed via OpenRouter (none = omit). Sent as the top-level `serviceTier` field.","options":[{"value":"none","label":"None","description":"Standard processing"},{"value":"flex","label":"Flex","description":"Lower cost, higher latency (Gemini API + Vertex)"},{"value":"priority","label":"Priority","description":"Faster, higher reliability (Gemini API + Vertex)"}]},"type":"enum","default":"none","values":["none","flex","priority"]},"tier.subagent":{"ui":{"tab":"model","group":"Sampling","label":"Service Tier — Subagent","description":"Service Tier for spawned task/eval subagents. Inherit = match the main agent\'s live per-family tiers (tracks /fast); pick a value to apply it to whichever family the subagent\'s model belongs to.","options":[{"value":"inherit","label":"Inherit","description":"Match the main agent\'s live per-family tiers"},{"value":"none","label":"None","description":"Standard processing"},{"value":"auto","label":"Auto","description":"Provider default tier selection (OpenAI family)"},{"value":"default","label":"Default","description":"Standard priority processing (OpenAI family)"},{"value":"flex","label":"Flex","description":"Flexible capacity tier (OpenAI/Google families)"},{"value":"scale","label":"Scale","description":"Scale Tier credits (OpenAI family)"},{"value":"priority","label":"Priority","description":"Priority on every supported family of the spawned model"}]},"type":"enum","default":"inherit","values":["inherit","none","auto","default","flex","scale","priority"]},"tier.advisor":{"ui":{"tab":"model","group":"Sampling","label":"Service Tier — Advisor","description":"Service Tier for the advisor model. None = standard processing; Inherit = match the main agent\'s live per-family tiers; pick a value to apply it to the advisor model\'s family.","condition":"advisorEnabled","options":[{"value":"inherit","label":"Inherit","description":"Match the main agent\'s live per-family tiers"},{"value":"none","label":"None","description":"Standard processing"},{"value":"auto","label":"Auto","description":"Provider default tier selection (OpenAI family)"},{"value":"default","label":"Default","description":"Standard priority processing (OpenAI family)"},{"value":"flex","label":"Flex","description":"Flexible capacity tier (OpenAI/Google families)"},{"value":"scale","label":"Scale","description":"Scale Tier credits (OpenAI family)"},{"value":"priority","label":"Priority","description":"Priority on every supported family of the spawned model"}]},"type":"enum","default":"none","values":["inherit","none","auto","default","flex","scale","priority"]},"retry.maxRetries":{"ui":{"tab":"model","group":"Retry & Fallback","label":"Retry Attempts","description":"Maximum retry attempts on API errors","options":[{"value":"1","label":"1 retry","description":""},{"value":"2","label":"2 retries","description":""},{"value":"3","label":"3 retries","description":""},{"value":"5","label":"5 retries","description":""},{"value":"10","label":"10 retries","description":""}]},"type":"number","default":10},"retry.maxDelayMs":{"ui":{"tab":"model","group":"Retry & Fallback","label":"Max Retry Delay","description":"Maximum wait between retries, in ms. When the provider asks us to wait longer than this and no credential or model fallback succeeds, the request fails fast instead of sleeping (e.g. 3-hour Anthropic rate-limit windows). 0 disables the ceiling — to let the session auto-resume through provider-stated quota resets."},"type":"number","default":300000},"retry.waitForUsageReset":{"ui":{"tab":"model","group":"Retry & Fallback","label":"Wait For Usage Reset","description":"When a provider reports usage-limit exhaustion with a reset time (5-hour or weekly quota windows on any provider), sleep until the reset instead of failing fast past retry.maxDelayMs. Waits are abortable (Esc) but also hold subagents, so leave off for unattended runs."},"type":"boolean","default":false},"retry.modelFallback":{"ui":{"tab":"model","group":"Retry & Fallback","label":"Retry Model Fallback","description":"Allow retry recovery to switch to configured fallback models"},"type":"boolean","default":true},"retry.usageAwareFallback":{"ui":{"tab":"model","group":"Retry & Fallback","label":"Usage-Aware Fallback","description":"Use reliable coding-plan quota reports to prefer same-provider accounts, then configured fallback models, before a hard usage limit. Ordinary configured API keys are excluded."},"type":"boolean","default":false},"retry.usageReservePct":{"ui":{"tab":"model","group":"Retry & Fallback","label":"Reserve Margin","description":"Treat a coding-plan model as near its limit below this remaining percentage. Unknown or unmapped usage keeps the primary model.","condition":"usageAwareFallbackEnabled","options":[{"value":"5","label":"5%","description":"Act only when nearly exhausted"},{"value":"10","label":"10%","description":"Balanced safety margin"},{"value":"15","label":"15%","description":"Conservative"},{"value":"20","label":"20%","description":"Early protection"},{"value":"25","label":"25%","description":"Very conservative"}]},"type":"number","default":10},"retry.usageReservePolicy":{"ui":{"tab":"model","group":"Retry & Fallback","label":"Reserve Policy","description":"What to do when every same-provider coding-plan account is inside the reserve margin.","condition":"usageAwareFallbackEnabled","options":[{"value":"confirm","label":"Confirm interactively","description":"Keep interactive sessions on the primary until confirmed; background agents auto-fallback"},{"value":"auto","label":"Auto-fallback","description":"Always select the next eligible configured fallback"},{"value":"fail-closed","label":"Fail closed","description":"Do not spend reserve quota or select a fallback"}]},"type":"enum","default":"confirm","values":["confirm","auto","fail-closed"]},"retry.fallbackChains":{"ui":{"tab":"model","group":"Retry & Fallback","label":"Retry Fallback Chains","description":"JSON object mapping model roles, model selectors (\\"provider/model-id\\"), or provider wildcards (\\"provider/*\\") to ordered fallback selectors, e.g. {\\"default\\":[\\"openai/gpt-4o-mini\\"],\\"google-antigravity/*\\":[\\"google/*\\",\\"google-vertex/*\\"]}. Model-oriented keys apply whenever that model/provider is active, regardless of role; a \\"provider/*\\" entry keeps the failing model\'s id and swaps the provider. An id-prefixed wildcard (\\"openrouter/google/*\\") re-prefixes the failing model\'s bare id (google-antigravity/gemini-x -> openrouter/google/gemini-x) and, used as a key, matches only that provider\'s ids under the prefix. A fallback entry may carry an explicit thinking suffix (\\"provider/model:low\\", \\":high\\", \\":max\\", \\":off\\"); a bare entry inherits the failing turn\'s effort, and \\"provider/*\\" entries always inherit."},"type":"record","default":{}},"retry.fallbackRevertPolicy":{"ui":{"tab":"model","group":"Retry & Fallback","label":"Fallback Revert Policy","description":"When to return to the primary model after a fallback","options":[{"value":"cooldown-expiry","label":"Cooldown expiry","description":"Return to the primary model after its suppression window ends"},{"value":"never","label":"Never","description":"Stay on the fallback model until manually changed"}]},"type":"enum","default":"cooldown-expiry","values":["cooldown-expiry","never"]},"providers.anthropic.serverSideFallback":{"ui":{"tab":"model","group":"Retry & Fallback","label":"Anthropic Server-Side Fallback (Fable 5)","description":"When a Claude Fable 5 / Mythos 5 request is blocked by Anthropic\'s safety classifier, retry it on Claude Opus 4.8 server-side (Anthropic `server-side-fallback-2026-06-01` beta). Opt-in — leaving this off preserves the pre-fallback behavior for every request."},"type":"boolean","default":false},"steeringMode":{"ui":{"tab":"interaction","group":"Input","label":"Steering Mode","description":"How to process queued messages while agent is working"},"type":"enum","default":"one-at-a-time","values":["all","one-at-a-time"]},"followUpMode":{"ui":{"tab":"interaction","group":"Input","label":"Follow-Up Mode","description":"How to drain follow-up messages after a turn completes"},"type":"enum","default":"one-at-a-time","values":["all","one-at-a-time"]},"interruptMode":{"ui":{"tab":"interaction","group":"Input","label":"Interrupt Mode","description":"When steering messages interrupt tool execution"},"type":"enum","default":"immediate","values":["immediate","wait"]},"tui.vimMode":{"ui":{"tab":"interaction","group":"Input","label":"Vim Editing Mode","description":"Modal prompt editing. Escape leaves Insert mode; Normal mode has hjkl, 0, $, ^, w, b, e, gg, G, counts, x/D/C, dd/yy, p and u; operators take motions or text objects (diw, ca(, dap); v/V start a Visual selection that y copies and d deletes"},"type":"boolean","default":false},"tui.vimModeDisplay":{"ui":{"tab":"interaction","group":"Input","label":"Vim Mode Indicator","description":"How the current Vim mode appears in the status line","condition":"vimModeEnabled","options":[{"value":"text","label":"Text","description":"Full mode name — NORMAL, INSERT, VISUAL, V-LINE"},{"value":"icon","label":"Icon","description":"Single compact glyph per mode"},{"value":"none","label":"Hidden","description":"Do not show the mode in the status line"}]},"type":"enum","default":"text","values":["text","icon","none"]},"loop.mode":{"ui":{"tab":"interaction","group":"Input","label":"Loop Mode","description":"What happens between /loop iterations before re-submitting the prompt","options":[{"value":"prompt","label":"Prompt","description":"Re-submit the prompt as a follow-up message (current behavior)"},{"value":"compact","label":"Compact","description":"Compact the session context, then re-submit the prompt"},{"value":"reset","label":"Reset","description":"Start a new session, then re-submit the prompt"}]},"type":"enum","default":"prompt","values":["prompt","compact","reset"]},"loop.conditionTimeoutMs":{"ui":{"tab":"interaction","group":"Input","label":"Loop Condition Timeout (ms)","description":"Max wait for a `/loop --while` / `--until` condition command before treating it as broken and stopping the loop. Set to 0 to wait indefinitely","options":[{"value":"0","label":"Unlimited","description":""},{"value":"10000","label":"10 seconds","description":""},{"value":"30000","label":"30 seconds","description":""},{"value":"120000","label":"2 minutes","description":""}]},"type":"number","default":30000},"composer.recallClearedDrafts":{"ui":{"tab":"interaction","group":"Input","label":"Recall Cleared Drafts","description":"Keep drafts cleared with Ctrl+C in local Up/Down history until exit; disabling affects future clears"},"type":"boolean","default":true},"doubleEscapeAction":{"ui":{"tab":"interaction","group":"Input","label":"Double-Escape Action","description":"What pressing Escape twice with an empty editor does: open the transcript rewind selector, open the session tree, or nothing"},"type":"enum","default":"rewind","values":["rewind","tree","none"]},"treeFilterMode":{"ui":{"tab":"interaction","group":"Input","label":"Session Tree Filter","description":"Default filter mode when opening the session tree"},"type":"enum","default":"default","values":["default","no-tools","user-only","labeled-only","all"]},"autocompleteMaxVisible":{"ui":{"tab":"interaction","group":"Input","label":"Autocomplete Items","description":"Max visible items in autocomplete dropdown (3-20)","options":[{"value":"3","label":"3 items","description":""},{"value":"5","label":"5 items","description":""},{"value":"7","label":"7 items","description":""},{"value":"10","label":"10 items","description":""},{"value":"15","label":"15 items","description":""},{"value":"20","label":"20 items","description":""}]},"type":"number","default":10},"spelling.typoDetection":{"ui":{"tab":"interaction","group":"Input","label":"Typo Detection (macOS)","description":"Mark misspelled prompt words with the active macOS dictionaries","condition":"macOS"},"type":"boolean","default":true},"spelling.autocomplete":{"ui":{"tab":"interaction","group":"Input","label":"Word Autocomplete (macOS)","description":"Show macOS dictionary word completions as inline hints accepted with Tab","condition":"macOS"},"type":"boolean","default":true},"spelling.autocorrect":{"ui":{"tab":"interaction","group":"Input","label":"Autocorrect (macOS)","description":"Apply confident macOS spelling corrections after completed words","condition":"macOS"},"type":"boolean","default":false},"emojiAutocomplete":{"ui":{"tab":"interaction","group":"Input","label":"Emoji Autocomplete","description":"Suggest emojis from `:name:` shortcodes and expand text emoticons like `:D` or `:-)`"},"type":"boolean","default":true},"paste.largeMenuThreshold":{"ui":{"tab":"interaction","group":"Input","label":"Large Paste Menu","description":"When a paste reaches this many lines, offer a menu to wrap it in a code block, wrap it in XML tags, or save it to a file. 0 disables the menu (large pastes still collapse to a [Paste] marker).","options":[{"value":"0","label":"Off","description":""},{"value":"100","label":"100 lines","description":""},{"value":"250","label":"250 lines","description":""},{"value":"500","label":"500 lines","description":""},{"value":"1000","label":"1000 lines","description":""}]},"type":"number","default":100},"startup.quiet":{"ui":{"tab":"interaction","group":"Startup & Updates","label":"Quiet Startup","description":"Skip welcome screen and startup status messages"},"type":"boolean","default":false},"startup.showSplash":{"ui":{"tab":"interaction","group":"Startup & Updates","label":"Show Startup Splash","description":"Show the full animated setup splash on normal interactive startup without rerunning setup. Quiet Startup still suppresses it."},"type":"boolean","default":false},"startup.setupWizard":{"ui":{"tab":"interaction","group":"Startup & Updates","label":"Setup Wizard","description":"Show newly added onboarding steps once per setup version"},"type":"boolean","default":true},"startup.checkUpdate":{"ui":{"tab":"interaction","group":"Startup & Updates","label":"Check for Updates","description":"Check for omp updates on startup"},"type":"boolean","default":true},"update.channel":{"ui":{"tab":"interaction","group":"Startup & Updates","label":"Update Channel","description":"Update channel used by omp update and the startup update check","options":[{"value":"stable","label":"Stable","description":""},{"value":"canary","label":"Canary","description":""}]},"type":"enum","default":"stable","values":["stable","canary"]},"marketplace.autoUpdate":{"ui":{"tab":"interaction","group":"Startup & Updates","label":"Marketplace Auto-Update","description":"Check for plugin updates on startup","options":[{"value":"off","label":"Off","description":"Don\'t check for plugin updates"},{"value":"notify","label":"Notify","description":"Check on startup and notify when updates are available"},{"value":"auto","label":"Auto","description":"Check on startup and auto-install updates"}]},"type":"enum","default":"notify","values":["off","notify","auto"]},"startup.changelogMode":{"ui":{"tab":"interaction","group":"Startup & Updates","label":"Startup Changelog","description":"Choose whether update notes start as a summary, full details, or stay hidden","options":[{"value":"summary","label":"Summary","description":"Show release and change counts with a /changelog hint"},{"value":"expanded","label":"Expanded","description":"Show the recent release notes in full"},{"value":"hidden","label":"Hidden","description":"Do not show release notes on startup"}]},"type":"enum","default":"summary","values":["summary","expanded","hidden"]},"magicKeywords.enabled":{"ui":{"tab":"interaction","group":"Magic Keywords","label":"Magic Keywords","description":"Enable hidden notices for standalone ultrathink, orchestrate, and workflowz keywords"},"type":"boolean","default":true},"magicKeywords.ultrathink":{"ui":{"tab":"interaction","group":"Magic Keywords","label":"Ultrathink Keyword","description":"Let standalone ultrathink request maximum automatic thinking and append its hidden notice"},"type":"boolean","default":true},"magicKeywords.orchestrate":{"ui":{"tab":"interaction","group":"Magic Keywords","label":"Orchestrate Keyword","description":"Let standalone orchestrate append its hidden multi-agent orchestration notice"},"type":"boolean","default":true},"magicKeywords.workflow":{"ui":{"tab":"interaction","group":"Magic Keywords","label":"Workflow Keyword","description":"Let standalone workflowz append its hidden eval workflow notice"},"type":"boolean","default":true},"completion.notify":{"ui":{"tab":"interaction","group":"Notifications","label":"Completion Notification","description":"Notify when the agent finishes a turn"},"type":"enum","default":"on","values":["on","off"]},"error.notify":{"ui":{"tab":"interaction","group":"Notifications","label":"Error Notification","description":"Notify when the agent stops with an error"},"type":"enum","default":"off","values":["on","off"]},"ask.timeout":{"ui":{"tab":"interaction","group":"Notifications","label":"Ask Timeout","description":"Auto-select the recommended ask option after this many seconds (0 disables)","options":[{"value":"0","label":"Disabled","description":""},{"value":"15","label":"15 seconds","description":""},{"value":"30","label":"30 seconds","description":""},{"value":"60","label":"60 seconds","description":""},{"value":"120","label":"120 seconds","description":""}]},"type":"number","default":0},"ask.notify":{"ui":{"tab":"interaction","group":"Notifications","label":"Ask Notification","description":"Notify when the ask tool is waiting for input"},"type":"enum","default":"on","values":["on","off"]},"recap.enabled":{"ui":{"tab":"interaction","group":"Notifications","label":"Idle Recap","description":"Generate a brief LLM recap of where things stand after the terminal has been idle"},"type":"boolean","default":true},"recap.idleSeconds":{"ui":{"tab":"interaction","group":"Notifications","label":"Idle Recap Delay","description":"Seconds to wait while idle before showing the recap","options":[{"value":"60","label":"1 minute","description":""},{"value":"120","label":"2 minutes","description":""},{"value":"240","label":"4 minutes","description":""},{"value":"300","label":"5 minutes","description":""},{"value":"600","label":"10 minutes","description":""}]},"type":"number","default":240},"collab.relayUrl":{"ui":{"tab":"interaction","group":"Collab","label":"Relay URL","description":"Relay used by /collab (wss://host[:port])"},"type":"string","default":"wss://my.omp.sh"},"collab.webUrl":{"ui":{"tab":"interaction","group":"Collab","label":"Web UI URL","description":"Browser UI used by /collab links; empty derives from collab.relayUrl; explicit http:// is localhost-only"},"type":"string","default":""},"collab.displayName":{"ui":{"tab":"interaction","group":"Collab","label":"Display Name","description":"Name shown to other collab participants (default: OS username)"},"type":"string","default":""},"collab.autoStart":{"ui":{"tab":"interaction","group":"Collab","label":"Auto Start","description":"Host every interactive session via collab.relayUrl as it starts and publish it to the local registry (omp collab list); rooms rotate on session switch","options":[{"value":"off","label":"Off","description":"Share only when /collab is run"},{"value":"view","label":"View","description":"Auto-host; the registry hands out view-only links (omp collab link --view)"},{"value":"control","label":"Control","description":"Auto-host; the registry hands out control links that can prompt the session"}]},"type":"enum","default":"off","values":["off","view","control"]},"share.serverUrl":{"ui":{"tab":"interaction","group":"Collab","label":"Share Server","description":"Share viewer/upload base used by /share (encrypted blob upload + viewer; links are <base>/<id>#<key>)"},"type":"string","default":"https://my.omp.sh/s"},"share.store":{"ui":{"tab":"interaction","group":"Collab","label":"Share Store","description":"Where /share uploads the encrypted session blob","options":[{"value":"blob","label":"Encrypted Blob","description":"Upload to the share server (no GitHub account needed; avoids gist API rate limits)"},{"value":"gist","label":"GitHub Gist","description":"Push to a secret gist (needs authenticated gh), falling back to the share server"}]},"type":"enum","default":"blob","values":["blob","gist"]},"share.redactSecrets":{"ui":{"tab":"interaction","group":"Collab","label":"Share Secret Redaction","description":"Run the secret obfuscator over /share snapshots before upload (uses the secrets.* config)"},"type":"boolean","default":true},"stt.enabled":{"ui":{"tab":"interaction","group":"Speech","label":"Speech-to-Text","description":"Enable speech-to-text input via microphone"},"type":"boolean","default":false},"stt.modelName":{"ui":{"tab":"interaction","group":"Speech","label":"Speech Model","description":"Local on-device speech model. Parakeet TDT v3 (sherpa-onnx) is the SoTA default; Whisper base/small/large-v3-turbo tiers (transformers.js) trade size for multilingual coverage. Downloaded on first use.","options":[{"value":"fast","label":"Fast (Whisper base)","description":"Whisper base, multilingual. Smallest + fastest; lowest accuracy. Best for low-resource machines."},{"value":"balanced","label":"Balanced (Whisper small)","description":"Whisper small, multilingual. More accurate than Fast, still light on CPU/RAM."},{"value":"turbo","label":"Turbo (Whisper large-v3)","description":"Whisper large-v3-turbo, 99 languages. Widest language coverage; large download, slower."},{"value":"parakeet","label":"Parakeet TDT v3 (SoTA)","description":"NVIDIA Parakeet TDT 0.6B v3, 25 languages. Open ASR Leaderboard leader — best accuracy and far fastest decoding. Default."}]},"type":"enum","default":"parakeet","values":["fast","balanced","turbo","parakeet"]},"stt.submitTrigger":{"ui":{"tab":"interaction","group":"Speech","label":"Speech-to-Text Submit Trigger","description":"Choose when speech dictation automatically submits: Never, Release (2+ words), Release with complete sentence, or When I Say Submit.","options":[{"value":"never","label":"Never","description":"Never automatically submit; insert dictation and remain in editor."},{"value":"release","label":"Release","description":"Submit on release if the utterance has 2+ words to avoid accidental sends."},{"value":"release-complete","label":"Release with complete sentence","description":"Submit on release if the utterance ends with sentence-terminal punctuation (. ? ! etc.)."},{"value":"say-submit","label":"When I Say Submit","description":"Submit if the utterance ends with a word containing \'submit\' (strips that word before submitting)."}]},"type":"enum","default":"never","values":["never","release","release-complete","say-submit"]},"contextPromotion.enabled":{"ui":{"tab":"context","group":"General","label":"Auto-Promote Context","description":"Promote to a larger-context model on context overflow instead of compacting"},"type":"boolean","default":false},"extendedContext":{"ui":{"tab":"context","group":"General","label":"Extended Context","description":"Use larger context windows where supported; may incur premium pricing. Off keeps default or standard-pricing windows"},"type":"boolean","default":false},"compaction.enabled":{"ui":{"tab":"context","group":"Compaction","label":"Auto-Compact","description":"Automatically compact context when it gets too large"},"type":"boolean","default":true},"compaction.experimentalContextManagement":{"ui":{"tab":"context","group":"Compaction","label":"Notes-backed context windows (experimental)","description":"Keep persistent notes and searchable raw history across context windows. Restart to update available tools."},"type":"boolean","default":false},"compaction.midTurnEnabled":{"ui":{"tab":"context","group":"Compaction","label":"Mid-Turn Compaction","description":"Check thresholds at safe mid-turn tool-loop boundaries before the next provider request"},"type":"boolean","default":true},"compaction.methodOrder":{"ui":{"tab":"context","group":"Compaction","label":"Compaction Method Order","description":"Preferred fallback order for automatic context maintenance; unavailable or failed methods advance to the next choice","ordered":true,"options":[{"value":"remote","label":"Server compaction","description":"Use provider-native server compaction (OpenAI Responses compact, Anthropic compaction beta) when the active route supports it"},{"value":"snapcompact","label":"Snapcompact","description":"Archive history onto dense bitmap images the active vision model reads back; no LLM call"},{"value":"handoff","label":"Handoff","description":"Generate a handoff document and continue from it as the compaction summary"},{"value":"soft","label":"Soft compaction","description":"Summarize in place with a compaction model without using server compaction"},{"value":"shake","label":"Shake","description":"Drop recoverable heavy content in place without an LLM call"}]},"type":"array","default":["remote","snapcompact","handoff","shake","soft"]},"compaction.thresholdPercent":{"ui":{"tab":"context","group":"Compaction","label":"Compaction Threshold","description":"Percent threshold for context maintenance; set to Default to use legacy reserve-based behavior","options":[{"value":"default","label":"Default","description":"Legacy reserve-based threshold"},{"value":"10","label":"10%","description":"Extremely early maintenance"},{"value":"20","label":"20%","description":"Very early maintenance"},{"value":"30","label":"30%","description":"Early maintenance"},{"value":"40","label":"40%","description":"Moderately early maintenance"},{"value":"50","label":"50%","description":"Halfway point"},{"value":"60","label":"60%","description":"Moderate context usage"},{"value":"70","label":"70%","description":"Balanced"},{"value":"75","label":"75%","description":"Slightly aggressive"},{"value":"80","label":"80%","description":"Typical threshold"},{"value":"85","label":"85%","description":"Aggressive context usage"},{"value":"90","label":"90%","description":"Very aggressive"},{"value":"95","label":"95%","description":"Near context limit"}]},"type":"number","default":-1},"compaction.thresholdTokens":{"ui":{"tab":"context","group":"Compaction","label":"Compaction Token Limit","description":"Fixed token limit for context maintenance; overrides percentage if set","options":[{"value":"default","label":"Default","description":"Use percentage-based threshold"},{"value":"25000","label":"25K tokens","description":"1/8 of a 200K window"},{"value":"50000","label":"50K tokens","description":"1/4 of a 200K window"},{"value":"100000","label":"100K tokens","description":"1/2 of a 200K window"},{"value":"150000","label":"150K tokens","description":"3/4 of a 200K window"},{"value":"200000","label":"200K tokens","description":"Full standard context window"},{"value":"300000","label":"300K tokens","description":"Large context window"},{"value":"500000","label":"500K tokens","description":"Very large context window"}]},"type":"number","default":-1},"compaction.handoffSaveToDisk":{"ui":{"tab":"context","group":"Compaction","label":"Save Handoff Docs","description":"Save generated handoff documents to markdown files for the auto-handoff flow"},"type":"boolean","default":false},"compaction.remoteStreamingV2Enabled":{"ui":{"tab":"context","group":"Compaction","label":"Remote Compaction V2","description":"Use Responses streaming compaction for compatible remote compaction models"},"type":"boolean","default":true},"compaction.asyncEnabled":{"ui":{"tab":"context","group":"Compaction","label":"Async Compaction","description":"Speculatively summarize in the background as context nears the compaction threshold, then splice the ready result in when the threshold is crossed"},"type":"boolean","default":true},"compaction.idleEnabled":{"ui":{"tab":"context","group":"Compaction","label":"Idle Compaction","description":"Compact context while idle when token count exceeds threshold"},"type":"boolean","default":false},"compaction.idleThresholdTokens":{"ui":{"tab":"context","group":"Compaction","label":"Idle Compaction Threshold","description":"Token count above which idle compaction triggers","options":[{"value":"100000","label":"100K tokens","description":""},{"value":"200000","label":"200K tokens","description":""},{"value":"300000","label":"300K tokens","description":""},{"value":"400000","label":"400K tokens","description":""},{"value":"500000","label":"500K tokens","description":""},{"value":"600000","label":"600K tokens","description":""},{"value":"700000","label":"700K tokens","description":""},{"value":"800000","label":"800K tokens","description":""},{"value":"900000","label":"900K tokens","description":""}]},"type":"number","default":200000},"compaction.idleTimeoutSeconds":{"ui":{"tab":"context","group":"Compaction","label":"Idle Compaction Delay","description":"Seconds to wait while idle before compacting","options":[{"value":"60","label":"1 minute","description":""},{"value":"120","label":"2 minutes","description":""},{"value":"300","label":"5 minutes","description":""},{"value":"600","label":"10 minutes","description":""},{"value":"1800","label":"30 minutes","description":""},{"value":"3600","label":"1 hour","description":""}]},"type":"number","default":300},"compaction.supersedeReads":{"ui":{"tab":"context","group":"Compaction","label":"Supersede Stale Reads","description":"Prune older read results when the same file is read again (cache-aware, runs every turn)"},"type":"boolean","default":true},"compaction.dropUseless":{"ui":{"tab":"context","group":"Compaction","label":"Elide Uneventful Results","description":"Prune tool results flagged contextually useless (no matches, timed-out waits) once consumed (cache-aware)"},"type":"boolean","default":true},"snapcompact.systemPrompt":{"ui":{"tab":"context","group":"Experimental","label":"Snapcompact System Prompt","description":"Experimental: render selected system prompt text as dense PNG image(s) and attach to the first user message (vision models only). Saves tokens; loses prompt caching for imaged text.","options":[{"value":"none","label":"None","description":"Keep the system prompt as text."},{"value":"agents-md","label":"AGENTS.md","description":"Only move loaded context-file instructions to images, when that saves tokens."},{"value":"all","label":"All","description":"Move the full system prompt to images, when that saves tokens."}]},"type":"enum","default":"none","values":["none","agents-md","all"]},"snapcompact.toolResults":{"ui":{"tab":"context","group":"Experimental","label":"Snapcompact Tool Results","description":"Experimental: render large historical tool results as dense PNG image(s) instead of text (vision models only). Saves tokens on accumulated read/search output."},"type":"boolean","default":false},"tools.format":{"ui":{"tab":"context","group":"Experimental","label":"Tool Calling Mode","description":"Controls how tools are exposed to the model. Auto uses provider-native tool calls unless the selected model is marked as not supporting them, then falls back to the GLM owned dialect. Native forces provider-native tools; the other values force the named owned dialect. Applies on session start.","options":[{"value":"auto","label":"Auto","description":"Use native tool calls unless the model is known not to support them."},{"value":"native","label":"Native","description":"Use provider-native tool calls."},{"value":"glm","label":"GLM","description":"Use GLM-style in-band tool calls."},{"value":"hermes","label":"Hermes","description":"Use Hermes-style in-band tool calls."},{"value":"kimi","label":"Kimi","description":"Use Kimi-style in-band tool calls."},{"value":"xml","label":"XML","description":"Use generic XML in-band tool calls."},{"value":"anthropic","label":"Anthropic","description":"Use Anthropic-style in-band tool calls."},{"value":"deepseek","label":"DeepSeek","description":"Use DeepSeek-style in-band tool calls."},{"value":"harmony","label":"Harmony","description":"Use Harmony-style in-band tool calls."},{"value":"qwen3","label":"Qwen3","description":"Use the Qwen3 owned dialect."},{"value":"gemini","label":"Gemini","description":"Use the Gemini owned dialect."},{"value":"gemma","label":"Gemma","description":"Use the Gemma owned dialect."},{"value":"minimax","label":"MiniMax","description":"Use the MiniMax owned dialect."}]},"type":"enum","default":"auto","values":["auto","native","glm","hermes","kimi","xml","anthropic","deepseek","harmony","qwen3","gemini","gemma","minimax"]},"snapcompact.shape":{"ui":{"tab":"context","group":"Experimental","label":"Snapcompact Shape","description":"Frame shape snapcompact prints text with (compaction archive and inline imaging). Auto picks a shape tuned for the current model.","options":[{"value":"auto","label":"Auto","description":"Picks a shape tuned for the current model, falling back to its provider family."},{"value":"8x8r-bw","label":"8x8 repeated, black","description":"unscii square cell, black ink, every line printed twice with the copy on a pale highlight band."},{"value":"8x8r-sent","label":"8x8 repeated, sentence hues","description":"Repeated grid with ink cycling six hues at sentence boundaries."},{"value":"8x8u-bw","label":"8x8, black","description":"Plain unscii square cell, single-printed lines, black ink."},{"value":"8x8u-sent","label":"8x8, sentence hues","description":"Plain unscii square cell with sentence-hue ink."},{"value":"6x6u-bw","label":"6x6 dense, black","description":"unscii squeezed to 6x6 — densest readable cell, fewest frames — in black ink."},{"value":"6x6u-sent","label":"6x6 dense, sentence hues","description":"Densest cell with sentence-hue ink."},{"value":"5x8-bw","label":"5x8 legacy, black","description":"Original X.org 5x8 glyphs on the 2576px frame, black ink."},{"value":"5x8-sent","label":"5x8 legacy, sentence hues","description":"The original snapcompact shape (pre-shape-table sessions rendered this)."},{"value":"6x12-dim","label":"6x12, dimmed stopwords","description":"X.org 6x12 glyphs, black ink, function words dimmed gray."},{"value":"8x13-bw","label":"8x13, black","description":"X.org 8x13 glyphs, black ink."},{"value":"8on16-bw","label":"8x13 on 16px pitch, black","description":"8x13 glyphs on an 8x16 cell (extra leading), black ink."},{"value":"8on22-bw","label":"8x13 on 22px pitch (leading), black","description":"8x13 glyphs on an 8x22 cell — extra line spacing so rows don\'t crowd. Default for OpenAI/Google."},{"value":"11on16-bw","label":"8x13 on 11px advance (tracking), black","description":"8x13 glyphs on an 11x16 cell — extra letter spacing so characters don\'t merge. Default for Anthropic."},{"value":"silver16-bw","label":"Silver 16, CJK","description":"Embedded Silver TrueType font on a 16px grid for CJK and other non-Latin text."},{"value":"doc-8on16-bw","label":"Doc 8on16, black","description":"Two word-wrapped newspaper columns of 8x13 glyphs on a 16px pitch, black ink."},{"value":"doc-8on16-sent","label":"Doc 8on16, sentence hues","description":"Two-column doc layout with sentence-hue ink."},{"value":"doc-8on16-sent-dim","label":"Doc 8on16, sentence hues + dimmed stopwords","description":"Two-column doc layout, sentence-hue ink, function words dimmed gray."}]},"type":"enum","default":"auto","values":["auto","8x8r-bw","8x8r-sent","8x8u-bw","8x8u-sent","6x6u-bw","6x6u-sent","5x8-bw","5x8-sent","6x12-dim","8x13-bw","8on16-bw","8on22-bw","11on16-bw","silver16-bw","doc-8on16-bw","doc-8on16-sent","doc-8on16-sent-dim"]},"branchSummary.enabled":{"ui":{"tab":"context","group":"General","label":"Branch Summaries","description":"Prompt to summarize when leaving a branch"},"type":"boolean","default":false},"memory.backend":{"ui":{"tab":"memory","group":"General","label":"Memory Backend","description":"Off, local summary pipeline, Mnemopi SQLite, Hindsight remote memory, or Sharpshooter","options":[{"value":"off","label":"Off","description":"No memory subsystem runs"},{"value":"local","label":"Local","description":"Local rollout summarisation pipeline (memory_summary.md)"},{"value":"hindsight","label":"Hindsight","description":"Vectorize Hindsight remote memory service"},{"value":"mnemopi","label":"Mnemopi","description":"Local SQLite recall/retain backend with optional embeddings"},{"value":"sharpshooter","label":"Sharpshooter","description":"Friction-gated project decision files (architecture/product/style), consolidated in the background"}]},"type":"enum","default":"off","values":["off","local","hindsight","mnemopi","sharpshooter"]},"sharpshooter.model":{"ui":{"tab":"memory","group":"Sharpshooter","label":"Sharpshooter Model","description":"Model selector for extraction/consolidation, empty = smol role"},"type":"string"},"autolearn.enabled":{"ui":{"tab":"memory","group":"Auto-Learn","label":"Auto-Learn (experimental)","description":"After the agent stops, nudge it to capture lessons to memory and create/enhance isolated managed skills"},"type":"boolean","default":false},"autolearn.autoContinue":{"ui":{"tab":"memory","group":"Auto-Learn","label":"Auto-run capture at stop","description":"When on, auto-run one private capture turn at stop (uses extra tokens). When off, only standing auto-learn guidance remains.","condition":"autolearnActive"},"type":"boolean","default":false},"mnemopi.dbPath":{"ui":{"tab":"memory","group":"Mnemopi","label":"Mnemopi DB Path","description":"Optional SQLite DB path. Defaults to the agent memories directory.","condition":"mnemopiActive"},"type":"string"},"mnemopi.bank":{"ui":{"tab":"memory","group":"Mnemopi","label":"Mnemopi Bank","description":"Optional shared bank base name. Per-project modes derive project-local banks from it.","condition":"mnemopiActive"},"type":"string"},"mnemopi.scoping":{"ui":{"tab":"memory","group":"Mnemopi","label":"Mnemopi Scoping","description":"global = one shared bank; per-project = isolated bank per cwd; per-project-tagged = project-local writes plus global recall visibility","condition":"mnemopiActive","options":[{"value":"global","label":"Global","description":"One shared Mnemopi bank for every project"},{"value":"per-project","label":"Per project","description":"Project-local Mnemopi bank per cwd basename"},{"value":"per-project-tagged","label":"Per project (tagged)","description":"Write to a project-local bank but merge project + shared recall results"}]},"type":"enum","default":"per-project","values":["global","per-project","per-project-tagged"]},"mnemopi.embeddingVariant":{"ui":{"tab":"memory","group":"Mnemopi","label":"Embedding variant","description":"Local embedding model family. en = stronger English model; multilingual = cross-language model. Changing this rebuilds existing memory embeddings on next start.","condition":"mnemopiActive","options":[{"value":"en","label":"English (bge-base-en-v1.5)","description":"BAAI/bge-base-en-v1.5 (768d), English-only"},{"value":"multilingual","label":"Multilingual (multilingual-e5-large)","description":"intfloat/multilingual-e5-large (1024d), cross-language recall"}]},"type":"enum","default":"en","values":["en","multilingual"]},"mnemopi.autoRecall":{"ui":{"tab":"memory","group":"Mnemopi","label":"Mnemopi Auto Recall","description":"Recall local memories into the first turn of each session","condition":"mnemopiActive"},"type":"boolean","default":true},"mnemopi.autoRetain":{"ui":{"tab":"memory","group":"Mnemopi","label":"Mnemopi Auto Retain","description":"Retain completed conversation turns into local Mnemopi memory","condition":"mnemopiActive"},"type":"boolean","default":true},"mnemopi.polyphonicRecall":{"ui":{"tab":"memory","group":"Mnemopi","label":"Mnemopi Polyphonic Recall","description":"Enable 4-voice recall (vector, graph, fact, temporal) fused with reciprocal rank fusion","condition":"mnemopiActive"},"type":"boolean","default":false},"mnemopi.enhancedRecall":{"ui":{"tab":"memory","group":"Mnemopi","label":"Mnemopi Enhanced Recall","description":"Enable the tiered query result cache for repeated and similar recall queries","condition":"mnemopiActive"},"type":"boolean","default":false},"mnemopi.proactiveLinking":{"ui":{"tab":"memory","group":"Mnemopi","label":"Mnemopi Proactive Linking","description":"Ingest new memories into the episodic graph as they are stored, linking them to related entities and memories","condition":"mnemopiActive"},"type":"boolean","default":false},"mnemopi.noEmbeddings":{"ui":{"tab":"memory","group":"Mnemopi","label":"Mnemopi Disable Embeddings","description":"Force deterministic FTS-only recall instead of vector embeddings","condition":"mnemopiActive"},"type":"boolean","default":false},"mnemopi.embeddingModel":{"ui":{"tab":"memory","group":"Mnemopi","label":"Mnemopi Embedding Model","description":"Advanced: explicit embedding model id that overrides the variant. Leave empty to use mnemopi.embeddingVariant.","condition":"mnemopiActive"},"type":"string"},"mnemopi.embeddingApiUrl":{"ui":{"tab":"memory","group":"Mnemopi","label":"Mnemopi Embedding API URL","description":"Optional OpenAI-compatible embedding endpoint passed to Mnemopi","condition":"mnemopiActive"},"type":"string"},"mnemopi.embeddingApiKey":{"ui":{"tab":"memory","group":"Mnemopi","label":"Mnemopi Embedding API Key","description":"Optional embedding API key passed to Mnemopi","condition":"mnemopiActive"},"type":"string","credential":true},"mnemopi.llmMode":{"ui":{"tab":"memory","group":"Mnemopi","label":"Mnemopi LLM Mode","description":"Use no LLM, the online tiny model (the TINY role from /models, else @smol), or a remote OpenAI-compatible endpoint","condition":"mnemopiActive","options":[{"value":"none","label":"None","description":"Disable Mnemopi LLM-backed extraction"},{"value":"smol","label":"Online (tiny)","description":"Use the online tiny model (the TINY role from /models, else @smol)"},{"value":"remote","label":"Remote","description":"Use the Mnemopi remote LLM settings below"}]},"type":"enum","default":"smol","values":["none","smol","remote"]},"mnemopi.llmBaseUrl":{"ui":{"tab":"memory","group":"Mnemopi","label":"Mnemopi LLM Base URL","description":"Optional OpenAI-compatible LLM endpoint for Mnemopi remote mode","condition":"mnemopiActive"},"type":"string"},"mnemopi.llmApiKey":{"ui":{"tab":"memory","group":"Mnemopi","label":"Mnemopi LLM API Key","description":"Optional LLM API key for Mnemopi remote mode","condition":"mnemopiActive"},"type":"string","credential":true},"mnemopi.llmModel":{"ui":{"tab":"memory","group":"Mnemopi","label":"Mnemopi LLM Model","description":"Optional LLM model name for Mnemopi remote mode","condition":"mnemopiActive"},"type":"string"},"hindsight.apiUrl":{"ui":{"tab":"memory","group":"Hindsight","label":"Hindsight API URL","description":"Hindsight server URL (Cloud or self-hosted)","condition":"hindsightActive"},"type":"string","default":"http://localhost:8888"},"hindsight.apiToken":{"ui":{"tab":"memory","group":"Hindsight","label":"Hindsight API Token","description":"Bearer token for authenticated Hindsight servers","condition":"hindsightActive"},"type":"string","credential":true},"hindsight.bankId":{"ui":{"tab":"memory","group":"Hindsight","label":"Hindsight Bank ID","description":"Memory bank identifier (default: project name)","condition":"hindsightActive"},"type":"string"},"hindsight.scoping":{"ui":{"tab":"memory","group":"Hindsight","label":"Hindsight Scoping","description":"global = one shared bank; per-project = isolated bank per cwd; per-project-tagged = shared bank with project tags so global + project memories merge on recall","condition":"hindsightActive","options":[{"value":"global","label":"Global","description":"One shared bank — every project sees the same memories"},{"value":"per-project","label":"Per project","description":"Isolated bank per cwd basename — projects cannot see each other\'s memories"},{"value":"per-project-tagged","label":"Per project (tagged)","description":"Shared bank, retains tagged with project:<cwd>. Recall surfaces project + untagged global memories together"}]},"type":"enum","default":"per-project-tagged","values":["global","per-project","per-project-tagged"]},"hindsight.autoRecall":{"ui":{"tab":"memory","group":"Hindsight","label":"Hindsight Auto Recall","description":"Recall memories on the first turn of each session","condition":"hindsightActive"},"type":"boolean","default":true},"hindsight.autoRetain":{"ui":{"tab":"memory","group":"Hindsight","label":"Hindsight Auto Retain","description":"Retain transcript every N turns and at session boundaries","condition":"hindsightActive"},"type":"boolean","default":true},"hindsight.retainMode":{"ui":{"tab":"memory","group":"Hindsight","label":"Hindsight Retain Mode","description":"full-session = upsert one document per session, last-turn = chunked","condition":"hindsightActive","options":[{"value":"full-session","label":"Full session","description":"Upsert one document per session (recommended)"},{"value":"last-turn","label":"Last turn","description":"Chunked retention sliced by turn boundaries"}]},"type":"enum","default":"full-session","values":["full-session","last-turn"]},"hindsight.mentalModelsEnabled":{"ui":{"tab":"memory","group":"Hindsight","label":"Hindsight Mental Models","description":"Read curated reflect summaries (mental models) into developer instructions at boot. Loads existing models on the bank — does not write. Pair with hindsight.mentalModelAutoSeed to also auto-create the built-in seed set.","condition":"hindsightActive"},"type":"boolean","default":true},"hindsight.mentalModelAutoSeed":{"ui":{"tab":"memory","group":"Hindsight","label":"Hindsight Mental Model Auto-Seed","description":"At session start, create any built-in mental models (project-conventions, project-decisions, user-preferences) that do not yet exist on the bank.","condition":"hindsightActive"},"type":"boolean","default":true},"ttsr.enabled":{"ui":{"tab":"context","group":"Rules (TTSR)","label":"TTSR","description":"Interrupt the agent mid-stream when output matches rule patterns (Time-Traveling Stream Rules)"},"type":"boolean","default":true},"ttsr.contextMode":{"ui":{"tab":"context","group":"Rules (TTSR)","label":"TTSR Context Mode","description":"What to do with partial output when TTSR triggers"},"type":"enum","default":"discard","values":["discard","keep"]},"ttsr.interruptMode":{"ui":{"tab":"context","group":"Rules (TTSR)","label":"TTSR Interrupt Mode","description":"When to interrupt mid-stream vs inject warning after completion","options":[{"value":"always","label":"always","description":"Interrupt on prose and tool streams"},{"value":"prose-only","label":"prose-only","description":"Interrupt only on reply/thinking matches"},{"value":"tool-only","label":"tool-only","description":"Interrupt only on tool-call argument matches"},{"value":"never","label":"never","description":"Never interrupt; inject warning after completion"}]},"type":"enum","default":"always","values":["never","prose-only","tool-only","always"]},"ttsr.repeatMode":{"ui":{"tab":"context","group":"Rules (TTSR)","label":"TTSR Repeat Mode","description":"How rules can repeat: once per session or after a message gap"},"type":"enum","default":"once","values":["once","after-gap"]},"ttsr.repeatGap":{"ui":{"tab":"context","group":"Rules (TTSR)","label":"TTSR Repeat Gap","description":"Messages before a rule can trigger again","options":[{"value":"5","label":"5 messages","description":""},{"value":"10","label":"10 messages","description":""},{"value":"15","label":"15 messages","description":""},{"value":"20","label":"20 messages","description":""},{"value":"30","label":"30 messages","description":""}]},"type":"number","default":10},"ttsr.builtinRules":{"ui":{"tab":"context","group":"Rules (TTSR)","label":"Built-in Rules","description":"Load the default rules shipped with the agent (override individually with ttsr.disabledRules)"},"type":"boolean","default":true},"ttsr.disabledRules":{"ui":{"tab":"context","group":"Rules (TTSR)","label":"Disabled Rules","description":"Rule names to ignore entirely (applies to bundled defaults and your own rules)"},"type":"array","default":[]},"edit.mode":{"ui":{"tab":"files","group":"Editing","label":"Edit Mode","description":"Select the edit tool variant (replace, patch, hashline, or apply_patch)"},"type":"enum","default":"hashline","values":["apply_patch","hashline","patch","replace","sloppy"]},"edit.fuzzyMatch":{"ui":{"tab":"files","group":"Editing","label":"Fuzzy Match","description":"Accept high-confidence fuzzy matches for whitespace differences"},"type":"boolean","default":true},"edit.fuzzyThreshold":{"ui":{"tab":"files","group":"Editing","label":"Fuzzy Match Threshold","description":"Similarity threshold (0-1) for accepting fuzzy matches","options":[{"value":"0.85","label":"0.85","description":"Lenient"},{"value":"0.90","label":"0.90","description":"Moderate"},{"value":"0.95","label":"0.95","description":"Default"},{"value":"0.98","label":"0.98","description":"Strict"}]},"type":"number","default":0.95},"edit.streamingAbort":{"ui":{"tab":"files","group":"Editing","label":"Abort on Failed Preview","description":"Abort streaming edit tool calls when patch preview fails"},"type":"boolean","default":false},"edit.recoverInlineEdits":{"ui":{"tab":"files","group":"Editing","label":"Recover Inline Edit Payloads","description":"Execute edit payloads the model emits as plain text by converting them into edit tool calls"},"type":"boolean","default":true},"edit.blockAutoGenerated":{"ui":{"tab":"files","group":"Editing","label":"Block Auto-Generated Files","description":"Prevent editing of files that appear to be auto-generated (protoc, sqlc, swagger, etc.)"},"type":"boolean","default":true},"edit.enforceSeenLines":{"ui":{"tab":"files","group":"Editing","label":"Enforce Seen-Line Guard","description":"Reject edits anchored on lines a prior read/search never displayed in full"},"type":"boolean","default":false},"edit.blackbox.enabled":{"ui":{"tab":"files","group":"Editing","label":"Record Parse Regressions","description":"Append full before/after source when an edit introduces an AST parse failure"},"type":"boolean","default":false},"edit.autoRepair.enabled":{"ui":{"tab":"files","group":"Editing","label":"Auto-Repair Parse Regressions","description":"When an edit breaks a file\'s AST parse, ask the smol model to fix the broken region (validated by re-parse; falls back to a warning)"},"type":"boolean","default":false},"readLineNumbers":{"ui":{"tab":"files","group":"Reading","label":"Line Numbers","description":"Prepend line numbers to read tool output by default"},"type":"boolean","default":false},"read.defaultLimit":{"ui":{"tab":"files","group":"Reading","label":"Default Read Limit","description":"Default number of lines returned when agent calls read without a limit","options":[{"value":"200","label":"200 lines","description":""},{"value":"300","label":"300 lines","description":""},{"value":"500","label":"500 lines","description":""},{"value":"1000","label":"1000 lines","description":""},{"value":"5000","label":"5000 lines","description":""}]},"type":"number","default":300},"read.renderMarkdown":{"ui":{"tab":"files","group":"Reading","label":"Markdown Previews","description":"Render Markdown read results as formatted terminal Markdown previews instead of raw source"},"type":"boolean","default":false},"read.summarize.enabled":{"ui":{"tab":"files","group":"Read Summaries","label":"Read Summaries","description":"Return structural code summaries when read is called without an explicit selector"},"type":"boolean","default":true},"read.summarize.prose":{"ui":{"tab":"files","group":"Read Summaries","label":"Prose Summaries","description":"Return structural summaries for Markdown and plain text reads"},"type":"boolean","default":false},"read.summarize.minBodyLines":{"ui":{"tab":"files","group":"Read Summaries","label":"Read Summary Body Lines","description":"Minimum multiline body or literal length before read summaries collapse it"},"type":"number","default":4},"read.summarize.minCommentLines":{"ui":{"tab":"files","group":"Read Summaries","label":"Read Summary Comment Lines","description":"Minimum multiline block comment length before read summaries collapse it"},"type":"number","default":6},"read.summarize.minTotalLines":{"ui":{"tab":"files","group":"Read Summaries","label":"Read Summary Minimum File Length","description":"Files with fewer total lines are read verbatim instead of structurally summarized"},"type":"number","default":100},"read.summarize.unfoldUntil":{"ui":{"tab":"files","group":"Read Summaries","label":"Read Summary Unfold Target","description":"BFS-unfold elidable spans until the summary is at least this many visible lines. 0 keeps only the outermost elisions."},"type":"number","default":50},"read.summarize.unfoldLimit":{"ui":{"tab":"files","group":"Read Summaries","label":"Read Summary Unfold Ceiling","description":"Hard ceiling on summary size while BFS-unfolding. An unfold whose revealed lines would exceed this is skipped (that span stays folded) and unfolding continues with the remaining spans."},"type":"number","default":100},"read.toolResultPreview":{"ui":{"tab":"files","group":"Reading","label":"Inline Read Previews","description":"Render read tool results inline in the transcript instead of summary rows"},"type":"boolean","default":false},"lsp.enabled":{"ui":{"tab":"files","group":"LSP","label":"LSP","description":"Enable the lsp tool for code intelligence (definitions, references, diagnostics, rename)"},"type":"boolean","default":true},"lsp.lazy":{"ui":{"tab":"files","group":"LSP","label":"Lazy LSP Startup","description":"Start language servers on first use (lsp tool or editing a matching file type) instead of at session startup"},"type":"boolean","default":true},"lsp.shared":{"ui":{"tab":"files","group":"LSP","label":"Shared Language Servers","description":"Share one language server per project across omp instances via the daemon broker (falls back to private servers when unavailable)"},"type":"boolean","default":true},"lsp.formatOnWrite":{"ui":{"tab":"files","group":"LSP","label":"Format on Write","description":"Automatically format code files using LSP after writing"},"type":"boolean","default":false},"lsp.diagnosticsOnWrite":{"ui":{"tab":"files","group":"LSP","label":"Diagnostics on Write","description":"Return LSP diagnostics after writing code files"},"type":"boolean","default":true},"lsp.diagnosticsOnEdit":{"ui":{"tab":"files","group":"LSP","label":"Diagnostics on Edit","description":"Return LSP diagnostics after editing code files"},"type":"boolean","default":false},"lsp.diagnosticsDeduplicate":{"ui":{"tab":"files","group":"LSP","label":"Deduplicate Diagnostics","description":"Suppress post-edit LSP diagnostics already shown for a file; only surface new or changed ones"},"type":"boolean","default":true},"bash.enabled":{"ui":{"tab":"shell","group":"Bash","label":"Bash","description":"Enable the bash tool for shell command execution"},"type":"boolean","default":true},"bash.allowCompoundCommands":{"ui":{"tab":"shell","group":"Bash","label":"Allow Compound Commands","description":"Evaluate literal && chains per command; unmatched commands use normal bash approval policy and mode"},"type":"boolean","default":false},"bash.autoBackground.enabled":{"ui":{"tab":"shell","group":"Bash","label":"Bash Auto-Background","description":"Automatically background long-running bash commands and deliver the result later"},"type":"boolean","default":true},"bash.patterns":{"ui":{"tab":"shell","group":"Bash","label":"Bash Approval Patterns","description":"Ordered bash command approval rules. Each item has match and approval fields; only \'*\' wildcards are supported."},"type":"array","default":[]},"bashInterceptor.enabled":{"ui":{"tab":"shell","group":"Bash","label":"Bash Interceptor","description":"Block shell commands that have dedicated tools"},"type":"boolean","default":false},"bash.direnv":{"ui":{"tab":"shell","group":"Bash","label":"direnv Auto-Load","description":"Auto-load a repo\'s direnv/devenv `.envrc` into the bash session so devenv tools and env vars are present without manual `direnv exec`. Honors direnv\'s allow list: an `.envrc` you haven\'t `direnv allow`ed is never executed"},"type":"enum","default":"auto","values":["auto","off"]},"bash.direnvLoadTimeoutMs":{"ui":{"tab":"shell","group":"Bash","label":"direnv Load Timeout (ms)","description":"Max wait for the first `direnv export` (a cold devenv shell can be slow); on timeout the session runs without the direnv env"},"type":"number","default":30000},"shellMinimizer.enabled":{"ui":{"tab":"shell","group":"Bash","label":"Shell Minimizer","description":"Compress verbose shell output (git, npm, cargo, etc.) before returning it to the agent"},"type":"boolean","default":true},"shellMinimizer.sourceOutlineLevel":{"ui":{"tab":"shell","group":"Bash","label":"Shell Minimizer Source Outline","description":"Source outline mode for cat/read of source files: default or aggressive"},"type":"enum","default":"default","values":["default","aggressive"]},"eval.py":{"ui":{"tab":"shell","group":"Eval & Runtimes","label":"Python Eval Backend","description":"Allow the eval tool to dispatch Python cells to the IPython kernel"},"type":"boolean","default":true},"eval.js":{"ui":{"tab":"shell","group":"Eval & Runtimes","label":"JavaScript Eval Backend","description":"Allow the eval tool to dispatch JavaScript cells to the in-process runtime"},"type":"boolean","default":true},"eval.tools.enabled":{"ui":{"tab":"shell","group":"Eval & Runtimes","label":"Eval-Defined Tools","description":"Let eval cells define tools (@tool in Python, tool(fn) in JS) that task, agent(), and workpool() subagents can call"},"type":"boolean","default":true},"eval.workpool.freshAgents":{"ui":{"tab":"shell","group":"Eval & Runtimes","label":"Fresh Workpool Agents","description":"Spawn a new subagent for every workpool item instead of reusing workers or batching queued items"},"type":"boolean","default":false},"eval.autoBackground.enabled":{"ui":{"tab":"shell","group":"Eval & Runtimes","label":"Eval Auto-Background","description":"Automatically background long-running eval cells and deliver the result later"},"type":"boolean","default":false},"python.kernelMode":{"ui":{"tab":"shell","group":"Eval & Runtimes","label":"Python Kernel Mode","description":"Keep the IPython kernel alive across eval calls or start fresh each time"},"type":"enum","default":"session","values":["session","per-call"]},"python.interpreter":{"ui":{"tab":"shell","group":"Eval & Runtimes","label":"Python Interpreter","description":"Optional path to an exact Python executable. When set, automatic Python runtime discovery is skipped."},"type":"string","default":""},"tools.approval":{"ui":{"tab":"interaction","group":"Approvals","label":"Tool Approval Policies","description":"Per-tool approval policies. Set to \'allow\' to auto-approve, \'prompt\' to require confirmation, or \'deny\' to block. Overrides are honored in every approval mode."},"type":"record","default":{}},"tools.approvalMode":{"ui":{"tab":"interaction","group":"Approvals","label":"Tool Approval","description":"Default approval behavior for tool calls. \'Always ask\' auto-approves read-only tools only. \'Write\' auto-approves read and workspace-write tools. \'Yolo\' auto-approves all tiers; user policy may still prompt or block.","options":[{"value":"always-ask","label":"Always ask","description":"Auto-approve read-only tools; require confirmation for write and exec tools."},{"value":"write","label":"Write","description":"Auto-approve read-only and write tools; require confirmation for exec tools such as bash, eval, browser, and task."},{"value":"yolo","label":"Yolo","description":"Auto-approve read, write, and exec tools. User policy can still require confirmation or block calls."}]},"type":"enum","default":"yolo","values":["always-ask","write","yolo"]},"todo.enabled":{"ui":{"tab":"tools","group":"Available Tools","label":"Todos","description":"Enable the todo tool for task tracking"},"type":"boolean","default":true},"todo.reminders":{"ui":{"tab":"tools","group":"Todos","label":"Todo Reminders","description":"Remind the agent to complete todos before stopping"},"type":"boolean","default":true},"todo.remindersMax":{"ui":{"tab":"tools","group":"Todos","label":"Todo Reminder Limit","description":"Maximum number of todo reminders before giving up","options":[{"value":"1","label":"1 reminder","description":""},{"value":"2","label":"2 reminders","description":""},{"value":"3","label":"3 reminders","description":""},{"value":"5","label":"5 reminders","description":""}]},"type":"number","default":3},"todo.eager":{"ui":{"tab":"tools","group":"Todos","label":"Create Todos Automatically","description":"How strongly to push automatic todo-list creation after the first message","options":[{"value":"default","label":"Default","description":"Model decides; no automatic todo list"},{"value":"preferred","label":"Preferred","description":"Suggests a todo list on the first message (reminder, not forced)"},{"value":"always","label":"Always","description":"Forces a comprehensive todo list on the first message"}]},"type":"enum","default":"default","values":["default","preferred","always"]},"glob.enabled":{"ui":{"tab":"tools","group":"Available Tools","label":"Glob","description":"Enable the glob tool for glob-based file lookup"},"type":"boolean","default":true},"grep.enabled":{"ui":{"tab":"tools","group":"Available Tools","label":"Grep","description":"Enable the grep tool for regex content search"},"type":"boolean","default":true},"grep.contextBefore":{"ui":{"tab":"tools","group":"Grep & Browser","label":"Grep Context Before","description":"Lines of context before each grep match","options":[{"value":"0","label":"0 lines","description":""},{"value":"1","label":"1 line","description":""},{"value":"2","label":"2 lines","description":""},{"value":"3","label":"3 lines","description":""},{"value":"5","label":"5 lines","description":""}]},"type":"number","default":1},"grep.contextAfter":{"ui":{"tab":"tools","group":"Grep & Browser","label":"Grep Context After","description":"Lines of context after each grep match","options":[{"value":"0","label":"0 lines","description":""},{"value":"1","label":"1 line","description":""},{"value":"2","label":"2 lines","description":""},{"value":"3","label":"3 lines","description":""},{"value":"5","label":"5 lines","description":""},{"value":"10","label":"10 lines","description":""}]},"type":"number","default":3},"astGrep.enabled":{"ui":{"tab":"tools","group":"Available Tools","label":"AST Grep","description":"Enable the ast_grep tool for structural AST search"},"type":"boolean","default":false},"astEdit.enabled":{"ui":{"tab":"tools","group":"Available Tools","label":"AST Edit","description":"Enable the ast_edit tool for structural AST rewrites"},"type":"boolean","default":true},"debug.enabled":{"ui":{"tab":"tools","group":"Available Tools","label":"Debug","description":"Enable the debug tool for DAP-based debugging"},"type":"boolean","default":true},"launch.enabled":{"ui":{"tab":"tools","group":"Available Tools","label":"Launch","description":"Enable the launch tool for supervising shared long-running project processes"},"type":"boolean","default":true},"speechgen.enabled":{"ui":{"tab":"tools","group":"Available Tools","label":"Speech Generation","description":"Enable the tts tool for on-device (Kokoro) or xAI Grok Voice speech-file synthesis"},"type":"boolean","default":false},"generate_image.enabled":{"ui":{"tab":"tools","group":"Available Tools","label":"Generate Image","description":"Enable the generate_image tool (text-to-image generation and editing). Exposed as an xd:// device when tools.xdev is on."},"type":"boolean","default":false},"computer.enabled":{"ui":{"tab":"tools","group":"Available Tools","label":"Computer","description":"Enable the scriptable host-desktop eval prelude (screenshots, input, accessibility)"},"type":"boolean","default":false},"computer.display":{"ui":{"tab":"tools","group":"Computer","label":"Computer Display","description":"Composite all displays or select a native display id"},"type":"string","default":"all"},"computer.maxWidth":{"ui":{"tab":"tools","group":"Computer","label":"Computer Screenshot Width","description":"Maximum composite screenshot width in pixels"},"type":"number","default":3840},"computer.maxHeight":{"ui":{"tab":"tools","group":"Computer","label":"Computer Screenshot Height","description":"Maximum composite screenshot height in pixels"},"type":"number","default":2400},"images.questionTimeoutMs":{"ui":{"tab":"tools","group":"Execution","label":"Image Question Timeout","description":"Per-request timeout for the vision-model call behind read\'s ?q= image questions, in milliseconds. A stalled provider fails fast with a timeout error instead of blocking until manual abort. Set to 0 to disable the timeout.","options":[{"value":"0","label":"Disabled","description":""},{"value":"60000","label":"1 minute","description":""},{"value":"120000","label":"2 minutes","description":""},{"value":"180000","label":"3 minutes","description":""},{"value":"300000","label":"5 minutes","description":""}]},"type":"number","default":300000},"checkpoint.enabled":{"ui":{"tab":"tools","group":"Available Tools","label":"Checkpoint/Rewind","description":"Enable the checkpoint and rewind tools for context checkpointing"},"type":"boolean","default":false},"fetch.enabled":{"ui":{"tab":"tools","group":"Available Tools","label":"Read URLs","description":"Allow the read tool to fetch and process URLs"},"type":"boolean","default":true},"vault.enabled":{"ui":{"tab":"tools","group":"Available Tools","label":"Obsidian Vault","description":"Enable the vault:// internal URL for reading and editing Obsidian vault content via the Obsidian CLI. When disabled, vault:// resolution is refused and the vault:// entry is omitted from the system prompt."},"type":"boolean","default":false},"github.enabled":{"ui":{"tab":"tools","group":"Available Tools","label":"GitHub CLI","description":"Enable the github tool (op-based dispatch for repository, issue, pull request, diff, search, checkout, push, and Actions watch workflows)"},"type":"boolean","default":false},"github.cache.enabled":{"ui":{"tab":"tools","group":"GitHub","label":"GitHub View Cache","description":"Cache rendered issue/PR view output in ~/.omp/cache/github-cache.db so repeated reads are free"},"type":"boolean","default":true},"github.cache.softTtlSec":{"ui":{"tab":"tools","group":"GitHub","label":"GitHub Cache Soft TTL","description":"Within this window, cached issue/PR view rows are returned directly (seconds; default 5 minutes)"},"type":"number","default":300},"github.cache.hardTtlSec":{"ui":{"tab":"tools","group":"GitHub","label":"GitHub Cache Hard TTL","description":"Past the soft TTL the cached row is returned and refreshed in the background; past the hard TTL it is dropped (seconds; default 7 days)"},"type":"number","default":604800},"web_search.enabled":{"ui":{"tab":"tools","group":"Available Tools","label":"Web Search","description":"Enable the web_search tool for live web results"},"type":"boolean","default":true},"security.enabled":{"ui":{"tab":"tools","group":"Available Tools","label":"Security","description":"Enable OMP-native security scan planning, execution, and the read-only security:// resource namespace"},"type":"boolean","default":false},"ask.enabled":{"ui":{"tab":"tools","group":"Available Tools","label":"Ask","description":"Enable the ask tool for interactive user questions"},"type":"boolean","default":true},"browser.enabled":{"ui":{"tab":"tools","group":"Available Tools","label":"Browser","description":"Enable the browser eval prelude for scripted Chromium automation (Puppeteer)"},"type":"boolean","default":true},"browser.cdpUrl":{"ui":{"tab":"tools","group":"Grep & Browser","label":"Browser CDP URL","description":"Default HTTP CDP discovery endpoint (for example http://127.0.0.1:9222) to attach to instead of launching a browser. Explicit app.cdp_url or app.path on the tool call take precedence."},"type":"string"},"browser.relay":{"ui":{"tab":"tools","group":"Grep & Browser","label":"Browser Relay","description":"Drive your own Chrome tabs through the omp browser relay. Install the extension once (`omp browser-relay install`); the relay server auto-starts when the browser prelude needs it. Takes precedence over Browser CDP URL; set PI_BROWSER_RELAY=0 or PI_BROWSER_RELAY=1 to override."},"type":"boolean","default":false},"browser.relayUrl":{"ui":{"tab":"tools","group":"Grep & Browser","label":"Browser Relay URL","description":"omp browser relay endpoint (default http://127.0.0.1:9224)."},"type":"string"},"browser.headless":{"ui":{"tab":"tools","group":"Grep & Browser","label":"Headless Browser","description":"Launch browser in headless mode (disable to show browser UI)"},"type":"boolean","default":true},"browser.cmux":{"ui":{"tab":"tools","group":"Grep & Browser","label":"cmux Browser","description":"Use cmux WKWebView surfaces for browser automation when a cmux socket is available. Set PI_BROWSER_CMUX=0 or PI_BROWSER_CMUX=1 to override."},"type":"boolean","default":true},"browser.freezeOnTurnEnd":{"ui":{"tab":"tools","group":"Grep & Browser","label":"Freeze Browser Tabs On Turn End","description":"Freeze OMP-owned headless browser tabs when a turn settles so animated pages stop burning CPU/GPU while idle. Tabs unfreeze automatically on next use; pass persist:true on open to opt a tab out."},"type":"boolean","default":true},"browser.idleCloseSec":{"ui":{"tab":"tools","group":"Grep & Browser","label":"Browser Idle Close Timeout","description":"Close OMP-owned headless browser tabs idle longer than this many seconds (0 = never; session dispose still reaps). Applies only to OMP-launched headless tabs, never relay/CDP/spawned browsers or other sessions\' tabs.","options":[{"value":"0","label":"Never","description":""},{"value":"900","label":"15 minutes","description":""},{"value":"1800","label":"30 minutes","description":""},{"value":"3600","label":"1 hour","description":""}]},"type":"number","default":1800},"browser.screenshotDir":{"ui":{"tab":"tools","group":"Grep & Browser","label":"Screenshot Directory","description":"Directory to save screenshots. If unset, screenshots go to a temp file. Supports ~. Examples: ~/Downloads, ~/Desktop, /sdcard/Download (Android)"},"type":"string"},"tools.intentTracing":{"ui":{"tab":"tools","group":"Execution","label":"Intent Tracing","description":"Ask the agent to describe the intent of each tool call before executing it"},"type":"boolean","default":true},"tools.abortOnFabricatedResult":{"ui":{"tab":"tools","group":"Execution","label":"Abort On Fabricated Tool Result","description":"With in-band tool calls, stop the model immediately when it starts hallucinating a tool result mid-turn. Disable to let the model finish generating and discard the fabricated continuation instead."},"type":"boolean","default":true},"tools.speculativeExecution.enabled":{"ui":{"tab":"tools","group":"Execution","label":"Experimental Speculative Execution","description":"Enable the discard-safe first slice: validated local reads through direct read calls and nested eval. Network requests, provider completions, and live filesystem writes are not part of this baseline."},"type":"boolean","default":false},"tools.speculativeExecution.maxInFlight":{"ui":{"tab":"tools","group":"Execution","label":"Speculative Execution Concurrency","description":"Maximum number of validated local reads allowed to run before normal dispatch.","options":[{"value":"1","label":"1 operation","description":""},{"value":"2","label":"2 operations","description":""},{"value":"3","label":"3 operations","description":""},{"value":"4","label":"4 operations","description":""}]},"type":"number","default":2},"tools.maxTimeout":{"ui":{"tab":"tools","group":"Execution","label":"Max Tool Timeout","description":"Maximum timeout in seconds the agent can set for any tool (0 = no limit)","options":[{"value":"0","label":"No limit","description":""},{"value":"30","label":"30 seconds","description":""},{"value":"60","label":"60 seconds","description":""},{"value":"120","label":"120 seconds","description":""},{"value":"300","label":"5 minutes","description":""},{"value":"600","label":"10 minutes","description":""}]},"type":"number","default":0},"async.enabled":{"ui":{"tab":"tools","group":"Execution","label":"Async Execution","description":"Enable async bash commands and background task execution"},"type":"boolean","default":true},"irc.timeoutMs":{"ui":{"tab":"tools","group":"Execution","label":"IRC Timeout","description":"Timeout for hub send await:true in milliseconds; 0 disables the timeout","options":[{"value":"0","label":"Disabled","description":""},{"value":"30000","label":"30 seconds","description":""},{"value":"60000","label":"1 minute","description":""},{"value":"120000","label":"2 minutes","description":""},{"value":"300000","label":"5 minutes","description":""}]},"type":"number","default":120000},"tools.xdev":{"ui":{"tab":"tools","group":"Discovery & MCP","label":"xd:// Tools","description":"Mount rarely-used (discoverable) tools under xd:// device URLs driven via read/write instead of shipping their schemas on every request. Sessions whose explicit tool list grants read but omits write mount devices through a device-only write transport (filesystem writes stay rejected). Disable to expose every enabled tool top-level."},"type":"boolean","default":true},"tools.xdevDocs":{"ui":{"tab":"tools","group":"Discovery & MCP","label":"xd:// Prompt Docs","description":"Choose which mounted-device docs and schemas are inlined in the system prompt. Built-ins keeps core tools inline while MCP and extension tools stay on-demand.","options":[{"value":"inline","label":"All Devices","description":"Inline docs and schemas for every mounted device."},{"value":"builtins","label":"Built-ins Only","description":"Inline built-in docs; fetch MCP and extension docs on demand."},{"value":"catalog","label":"Catalog Only","description":"List every device; fetch all docs on demand."}]},"type":"enum","default":"builtins","values":["inline","builtins","catalog"]},"tools.xdevInlineDevices":{"ui":{"tab":"tools","group":"Discovery & MCP","label":"xd:// Inline Devices","description":"When xd:// Prompt Docs is Built-ins Only, inline dynamic devices whose names match these glob patterns (for example mcp__context_mode_*). Catalog Only ignores this setting."},"type":"array","default":[]},"mcp.enableProjectConfig":{"ui":{"tab":"tools","group":"Discovery & MCP","label":"MCP Project Config","description":"Load .mcp.json/mcp.json from project root"},"type":"boolean","default":true},"mcp.renderMarkdownResults":{"ui":{"tab":"tools","group":"Discovery & MCP","label":"MCP Markdown Results","description":"Render non-JSON MCP text results as Markdown in the transcript"},"type":"boolean","default":true},"mcp.notifications":{"ui":{"tab":"tools","group":"Discovery & MCP","label":"MCP Update Injection","description":"Inject MCP resource updates into the agent conversation"},"type":"boolean","default":false},"mcp.notificationDebounceMs":{"ui":{"tab":"tools","group":"Discovery & MCP","label":"MCP Notification Debounce","description":"Debounce window in milliseconds for MCP resource updates before injecting them into the conversation"},"type":"number","default":500},"plan.enabled":{"ui":{"tab":"tasks","group":"Modes","label":"Plan Mode","description":"Enable plan mode for read-only exploration and planning before execution"},"type":"boolean","default":true},"plan.defaultOnStartup":{"ui":{"tab":"tasks","group":"Modes","label":"Start in Plan Mode","description":"Automatically enter plan mode at the start of every new session","condition":"planModeEnabled"},"type":"boolean","default":false},"plan.autosave":{"ui":{"tab":"tasks","group":"Modes","label":"Autosave Plans","description":"Automatically save approved plans to disk when plan mode completes","condition":"planModeEnabled"},"type":"boolean","default":false},"plan.autosaveDir":{"ui":{"tab":"tasks","group":"Modes","label":"Autosave Directory","description":"Directory for autosaved plans. Supports ~, absolute, and cwd-relative paths. Empty uses <project>/.omp/plans/.","condition":"planAutosaveEnabled"},"type":"string"},"goal.enabled":{"ui":{"tab":"tasks","group":"Modes","label":"Goal Mode","description":"Enable per-session goal mode and the hidden goal tool"},"type":"boolean","default":true},"goal.statusInFooter":{"ui":{"tab":"tasks","group":"Modes","label":"Goal Status in Footer","description":"Show token budget alongside the goal indicator in the status line"},"type":"boolean","default":true},"goal.continuationModes":{"ui":{"tab":"tasks","group":"Modes","label":"Goal Continuation Modes","description":"Run modes where active goals may auto-continue between turns"},"type":"array","default":["interactive"]},"title.refreshOnReplan":{"ui":{"tab":"tasks","group":"Modes","label":"Refresh Title on Replan","description":"Refresh generated session titles after todo init replans unless the title was set by the user"},"type":"boolean","default":true},"task.isolation.enabled":{"ui":{"tab":"tasks","group":"Isolation","label":"Isolate Subagents","description":"Run subagents in an isolated copy of the checkout and integrate their changes afterwards"},"type":"boolean","default":false},"isolation.backend":{"ui":{"tab":"tasks","group":"Isolation","label":"Isolation Backend","description":"Backend used for subagent isolation and worktree cloning","options":[{"value":"auto","label":"Auto","description":"Let the PAL pick the best available backend"},{"value":"apfs","label":"APFS","description":"macOS clonefile reflink (APFS)"},{"value":"btrfs","label":"btrfs","description":"btrfs subvolume snapshot"},{"value":"zfs","label":"ZFS","description":"ZFS snapshot + clone"},{"value":"reflink","label":"Reflink","description":"Linux FICLONE per-file reflink"},{"value":"overlayfs","label":"Overlayfs","description":"Linux kernel overlay (or fuse-overlayfs fallback)"},{"value":"projfs","label":"ProjFS","description":"Windows Projected File System"},{"value":"block-clone","label":"Block clone","description":"Windows FSCTL_DUPLICATE_EXTENTS_TO_FILE (NTFS/ReFS)"},{"value":"rcopy","label":"Recursive copy","description":"git worktree if available, otherwise recursive copy"}]},"type":"enum","default":"auto","values":["auto","apfs","btrfs","zfs","reflink","overlayfs","projfs","block-clone","rcopy"]},"worktree.clone":{"ui":{"tab":"tasks","group":"Isolation","label":"Clone Checkout into Worktrees","description":"New worktrees from `github pr_checkout` and `git worktree add` in bash start as a copy-on-write clone of the current checkout so ignored build artifacts (node_modules, target) carry over; falls back to a plain checkout when the filesystem cannot clone"},"type":"boolean","default":true},"worktree.cleanSource":{"ui":{"tab":"tasks","group":"Isolation","label":"Clean Source Checkout on /wt","description":"When creating a worktree with `/wt`, reset tracked changes and remove untracked files from the original checkout after carrying them over"},"type":"boolean","default":false},"task.isolation.apply":{"ui":{"tab":"tasks","group":"Isolation","label":"Apply Isolated Changes","description":"Automatically apply successful isolated task changes to the parent checkout; disable to retain patch or branch artifacts"},"type":"boolean","default":true},"task.isolation.merge":{"ui":{"tab":"tasks","group":"Isolation","label":"Isolation Merge Strategy","description":"How isolated task changes are integrated (patch apply or branch merge)","options":[{"value":"patch","label":"Patch","description":"Combine diffs and git apply"},{"value":"branch","label":"Branch","description":"Commit per task, merge with --no-ff"}]},"type":"enum","default":"patch","values":["patch","branch"]},"task.isolation.commits":{"ui":{"tab":"tasks","group":"Isolation","label":"Isolation Commit Style","description":"Commit message style for nested repo changes (generic or AI-generated)","options":[{"value":"generic","label":"Generic","description":"Static commit message"},{"value":"ai","label":"AI","description":"AI-generated commit message from diff"}]},"type":"enum","default":"generic","values":["generic","ai"]},"worktree.base":{"ui":{"tab":"tasks","group":"Isolation","label":"Worktree Base Directory","description":"Base directory for agent-managed worktrees — task-isolation copies, `github` PR checkouts, and `omp worktree` cleanup all live here. Unset uses ~/.omp/wt. Must be an absolute or ~-relative path; relative paths are ignored. The OMP_WORKTREE_DIR env var overrides this."},"type":"string"},"task.eager":{"ui":{"tab":"tasks","group":"Subagents","label":"Prefer Task Delegation","description":"How strongly to push delegating work to subagents","options":[{"value":"default","label":"Default","description":"Uses the selected model\'s policy; some models require an explicit delegation request"},{"value":"preferred","label":"Preferred","description":"Adds delegation guidance to the system prompt"},{"value":"always","label":"Always","description":"Prompt guidance plus a first-turn delegation reminder"}]},"type":"enum","default":"default","values":["default","preferred","always"]},"task.batch":{"ui":{"tab":"tasks","group":"Subagents","label":"Batch Task Calls","description":"Switch the task tool to its batch shape: one call carries { context, tasks[] } — one subagent per item, with an optional per-item agent (defaulting to the session spawn-policy agent), per-item isolation, and a required shared context prepended to every assignment. With async.enabled=true, each spawn runs as an independent background agent with the normal idle/parked lifecycle; otherwise the call blocks for merged results. Disable to restore the flat single-spawn schema."},"type":"boolean","default":true},"task.enableEffort":{"ui":{"tab":"tasks","group":"Subagents","label":"Per-Task Effort","description":"Expose the optional effort parameter on task spawns, allowing callers to override each subagent\'s thinking level"},"type":"boolean","default":false},"task.maxConcurrency":{"ui":{"tab":"tasks","group":"Subagents","label":"Max Concurrent Tasks","description":"Maximum number of subagents running concurrently","options":[{"value":"0","label":"Unlimited","description":""},{"value":"1","label":"1 task","description":""},{"value":"2","label":"2 tasks","description":""},{"value":"4","label":"4 tasks","description":""},{"value":"8","label":"8 tasks","description":""},{"value":"16","label":"16 tasks","description":""},{"value":"32","label":"32 tasks","description":""},{"value":"64","label":"64 tasks","description":""}]},"type":"number","default":32},"task.enableLsp":{"ui":{"tab":"tasks","group":"Subagents","label":"LSP in Subagents","description":"Allow subagents spawned via the task tool to use the lsp tool. Off by default to keep subagents cheap; enable when LSP-aware delegation is worth the extra tokens."},"type":"boolean","default":false},"task.maxRecursionDepth":{"ui":{"tab":"tasks","group":"Subagents","label":"Max Task Recursion","description":"How many levels deep subagents can spawn their own subagents","options":[{"value":"-1","label":"Unlimited","description":""},{"value":"0","label":"None","description":""},{"value":"1","label":"Single","description":""},{"value":"2","label":"Double","description":""},{"value":"3","label":"Triple","description":""}]},"type":"number","default":2},"task.maxRuntimeMs":{"ui":{"tab":"tasks","group":"Subagents","label":"Max Subagent Runtime","description":"Hard wall-clock limit per subagent (ms). 0 disables it. Defense-in-depth against provider-side stream hangs that escape the inference-layer watchdog; triggers a normal subagent abort with a \'timed out\' reason.","options":[{"value":"0","label":"Unlimited","description":"Default"},{"value":"300000","label":"5 minutes","description":""},{"value":"900000","label":"15 minutes","description":""},{"value":"1800000","label":"30 minutes","description":""},{"value":"3600000","label":"1 hour","description":""}]},"type":"number","default":0},"task.agentIdleTtlMs":{"ui":{"tab":"tasks","group":"Subagents","label":"Agent Idle TTL","description":"How long an idle subagent stays live in memory before being parked to disk (ms). Parked agents are revived automatically when messaged or resumed. 0 keeps idle agents live until exit."},"type":"number","default":420000},"task.softRequestBudget":{"ui":{"tab":"tasks","group":"Subagents","label":"Soft Subagent Request Budget","description":"Soft per-subagent request budget (assistant requests per run). Crossing it injects a wrap-up steering notice (see task.softRequestBudgetNotice); at 1.5x the budget the run is force-stopped and the agent must yield its partial findings. 0 disables the guard. Bundled scout/sonic agents cap out at a lower built-in budget, so a value below that cap still applies to them.","options":[{"value":"0","label":"Disabled","description":""},{"value":"90","label":"90 requests","description":""},{"value":"150","label":"150 requests","description":""},{"value":"200","label":"200 requests","description":"Default"}]},"type":"number","default":200},"task.softRequestBudgetNotice":{"ui":{"tab":"tasks","group":"Subagents","label":"Soft Request Budget Notice","description":"Inject one steering notice when a subagent crosses its soft request budget, asking it to wrap up before the 1.5x forced-yield stop."},"type":"boolean","default":true},"task.maxEffort":{"ui":{"tab":"tasks","group":"Subagents","label":"Maximum Per-Spawn Effort","description":"Maximum reasoning effort allowed for the task tool\'s per-spawn effort hint. Lower values prevent callers from escalating subagents above this ceiling; the default preserves the model\'s full range.","options":[{"value":"minimal","label":"min","description":"Very brief reasoning (~1k tokens)"},{"value":"low","label":"low","description":"Light reasoning (~2k tokens)"},{"value":"medium","label":"medium","description":"Moderate reasoning (~8k tokens)"},{"value":"high","label":"high","description":"Deep reasoning (~16k tokens)"},{"value":"xhigh","label":"xhigh","description":"Extended reasoning (~32k tokens)"},{"value":"max","label":"max","description":"Maximum reasoning the model supports"}]},"type":"enum","default":"max","values":["minimal","low","medium","high","xhigh","max"]},"task.prewalk":{"ui":{"tab":"tasks","group":"Subagents","label":"Generic Task Prewalk","description":"Arm prewalk for the bundled generic `task` subagent: it starts on its resolved model, plans and begins the implementation, then hands off to the \'smol\' role at its first edit/write. Per-agent overrides (task.agentPrewalk, configured from the /agents hub) and user agent `prewalk` frontmatter apply regardless of this toggle."},"type":"boolean","default":false},"tasks.todoClearDelay":{"ui":{"tab":"tools","group":"Todos","label":"Todo Auto-Clear Delay","description":"Delay before completed or abandoned todos are removed from the todo widget","options":[{"value":"0","label":"Instant","description":""},{"value":"60","label":"1 minute","description":"Default"},{"value":"300","label":"5 minutes","description":""},{"value":"900","label":"15 minutes","description":""},{"value":"1800","label":"30 minutes","description":""},{"value":"3600","label":"1 hour","description":""},{"value":"-1","label":"Never","description":""}]},"type":"number","default":60},"task.showResolvedModelBadge":{"ui":{"tab":"appearance","group":"Display","label":"Show Resolved Model Badge","description":"Display the actual model ID used by each subagent in the task widget status line"},"type":"boolean","default":false},"skills.enableSkillCommands":{"ui":{"tab":"tasks","group":"Commands & Skills","label":"Skill Commands","description":"Register skills as /skill:name commands"},"type":"boolean","default":true},"commands.enableClaudeUser":{"ui":{"tab":"tasks","group":"Commands & Skills","label":"Claude User Commands","description":"Load commands from ~/.claude/commands/"},"type":"boolean","default":false},"commands.enableClaudeProject":{"ui":{"tab":"tasks","group":"Commands & Skills","label":"Claude Project Commands","description":"Load commands from .claude/commands/"},"type":"boolean","default":true},"commands.enableOpencodeUser":{"ui":{"tab":"tasks","group":"Commands & Skills","label":"OpenCode User Commands","description":"Load commands from ~/.config/opencode/commands/"},"type":"boolean","default":false},"commands.enableOpencodeProject":{"ui":{"tab":"tasks","group":"Commands & Skills","label":"OpenCode Project Commands","description":"Load commands from .opencode/commands/"},"type":"boolean","default":true},"secrets.enabled":{"ui":{"tab":"providers","group":"Privacy","label":"Hide Secrets","description":"Obfuscate configured secrets and redact credential-shaped tokens before sending to AI providers"},"type":"boolean","default":false},"providers.ollama-cloud.maxConcurrency":{"ui":{"tab":"providers","group":"Services","label":"Ollama Cloud Max Concurrency","description":"Maximum concurrent Ollama Cloud subagent runs per process; 0 disables the provider-specific limit"},"type":"number","default":3},"providers.webSearchOrder":{"ui":{"tab":"providers","group":"Services","label":"Web Search Provider Order","description":"Prioritized providers for the web_search tool; unlisted providers retain their default order afterward","ordered":true,"options":[{"value":"perplexity","label":"Perplexity","description":"Uses auth when configured; explicit selection falls back to anonymous search"},{"value":"gemini","label":"Gemini","description":"Google Search grounding via Gemini (uses google-gemini-cli or google-antigravity OAuth)"},{"value":"anthropic","label":"Anthropic","description":"Claude\'s native web_search tool (uses Anthropic OAuth or ANTHROPIC_API_KEY)"},{"value":"codex","label":"OpenAI","description":"OpenAI\'s native web_search (uses ChatGPT OAuth via /login openai-codex)"},{"value":"xai","label":"xAI","description":"Grok web search via xAI Responses API (uses SuperGrok/X Premium+ OAuth via /login xai-oauth, or XAI_API_KEY)"},{"value":"zai","label":"Z.AI","description":"Calls Z.AI webSearchPrime MCP"},{"value":"exa","label":"Exa","description":"API via /login exa or EXA_API_KEY; explicit keyless fallback via MCP"},{"value":"tinyfish","label":"TinyFish","description":"Requires TINYFISH_API_KEY"},{"value":"jina","label":"Jina","description":"Requires JINA_API_KEY"},{"value":"kagi","label":"Kagi","description":"Requires KAGI_API_KEY and Kagi Search API beta access"},{"value":"tavily","label":"Tavily","description":"Requires TAVILY_API_KEY"},{"value":"firecrawl","label":"Firecrawl","description":"Uses Firecrawl API when FIRECRAWL_API_KEY is set; falls back to keyless mode"},{"value":"brave","label":"Brave","description":"Requires BRAVE_API_KEY"},{"value":"kimi","label":"Kimi","description":"Kimi Code search (requires a Kimi Code Console key via KIMI_SEARCH_API_KEY/MOONSHOT_SEARCH_API_KEY or /login kimi-code; not MOONSHOT_API_KEY)"},{"value":"parallel","label":"Parallel","description":"API via /login parallel or PARALLEL_API_KEY; explicit keyless fallback via MCP"},{"value":"synthetic","label":"Synthetic","description":"Requires SYNTHETIC_API_KEY"},{"value":"ollama","label":"Ollama","description":"Requires OLLAMA_CLOUD_API_KEY"},{"value":"searxng","label":"SearXNG","description":"Requires SEARXNG_ENDPOINT or searxng.endpoint"},{"value":"startpage","label":"Startpage","description":"Credential-free scrape of Startpage (Google-backed) results; may be bot-challenged"},{"value":"duckduckgo","label":"DuckDuckGo","description":"Credential-free best-effort fallback; may be bot-challenged on datacenter/shared-egress IPs"},{"value":"ecosia","label":"Ecosia","description":"Credential-free browser-backed scrape of Ecosia (Google-backed) results"},{"value":"google","label":"Google","description":"Credential-free browser-backed fallback; slower and may be bot-challenged"},{"value":"mojeek","label":"Mojeek","description":"Credential-free browser-backed scrape of Mojeek\'s independent index"},{"value":"public","label":"Public Web","description":"Queries every credential-free engine in parallel and consolidates deduplicated results"}]},"type":"array","default":[]},"providers.webSearchExclude":{"ui":{"tab":"providers","group":"Services","label":"Excluded Web Search Providers","description":"Providers that web_search should never use, even as fallbacks","options":[{"value":"perplexity","label":"Perplexity","description":"Uses auth when configured; explicit selection falls back to anonymous search"},{"value":"gemini","label":"Gemini","description":"Google Search grounding via Gemini (uses google-gemini-cli or google-antigravity OAuth)"},{"value":"anthropic","label":"Anthropic","description":"Claude\'s native web_search tool (uses Anthropic OAuth or ANTHROPIC_API_KEY)"},{"value":"codex","label":"OpenAI","description":"OpenAI\'s native web_search (uses ChatGPT OAuth via /login openai-codex)"},{"value":"xai","label":"xAI","description":"Grok web search via xAI Responses API (uses SuperGrok/X Premium+ OAuth via /login xai-oauth, or XAI_API_KEY)"},{"value":"zai","label":"Z.AI","description":"Calls Z.AI webSearchPrime MCP"},{"value":"exa","label":"Exa","description":"API via /login exa or EXA_API_KEY; explicit keyless fallback via MCP"},{"value":"tinyfish","label":"TinyFish","description":"Requires TINYFISH_API_KEY"},{"value":"jina","label":"Jina","description":"Requires JINA_API_KEY"},{"value":"kagi","label":"Kagi","description":"Requires KAGI_API_KEY and Kagi Search API beta access"},{"value":"tavily","label":"Tavily","description":"Requires TAVILY_API_KEY"},{"value":"firecrawl","label":"Firecrawl","description":"Uses Firecrawl API when FIRECRAWL_API_KEY is set; falls back to keyless mode"},{"value":"brave","label":"Brave","description":"Requires BRAVE_API_KEY"},{"value":"kimi","label":"Kimi","description":"Kimi Code search (requires a Kimi Code Console key via KIMI_SEARCH_API_KEY/MOONSHOT_SEARCH_API_KEY or /login kimi-code; not MOONSHOT_API_KEY)"},{"value":"parallel","label":"Parallel","description":"API via /login parallel or PARALLEL_API_KEY; explicit keyless fallback via MCP"},{"value":"synthetic","label":"Synthetic","description":"Requires SYNTHETIC_API_KEY"},{"value":"ollama","label":"Ollama","description":"Requires OLLAMA_CLOUD_API_KEY"},{"value":"searxng","label":"SearXNG","description":"Requires SEARXNG_ENDPOINT or searxng.endpoint"},{"value":"startpage","label":"Startpage","description":"Credential-free scrape of Startpage (Google-backed) results; may be bot-challenged"},{"value":"duckduckgo","label":"DuckDuckGo","description":"Credential-free best-effort fallback; may be bot-challenged on datacenter/shared-egress IPs"},{"value":"ecosia","label":"Ecosia","description":"Credential-free browser-backed scrape of Ecosia (Google-backed) results"},{"value":"google","label":"Google","description":"Credential-free browser-backed fallback; slower and may be bot-challenged"},{"value":"mojeek","label":"Mojeek","description":"Credential-free browser-backed scrape of Mojeek\'s independent index"},{"value":"public","label":"Public Web","description":"Queries every credential-free engine in parallel and consolidates deduplicated results"}]},"type":"array","default":[]},"providers.webSearchTimeoutSeconds":{"ui":{"tab":"providers","group":"Services","label":"Web Search Timeout","description":"Hard timeout for each provider\'s search transport before web_search advances to the next fallback, in seconds (maximum 300)","options":[{"value":"30","label":"30 seconds","description":""},{"value":"60","label":"1 minute","description":""},{"value":"120","label":"2 minutes","description":""},{"value":"180","label":"3 minutes","description":""},{"value":"300","label":"5 minutes","description":""}]},"type":"number","default":60},"providers.webSearchGeminiModel":{"ui":{"tab":"providers","group":"Services","label":"Gemini web_search model","description":"Model ID for Gemini Google Search grounding. Defaults to gemini-2.5-flash."},"type":"string"},"providers.antigravityEndpoint":{"ui":{"tab":"providers","group":"Services","label":"Antigravity Endpoint Mode","description":"Endpoint routing strategy for google-antigravity providers (chat, search, image, discovery)","options":[{"value":"auto","label":"Auto","description":"Try production endpoint, fail over to sandbox on 5xx/429"},{"value":"production","label":"Production Only","description":"Force production endpoint only"},{"value":"sandbox","label":"Sandbox Only","description":"Force sandbox endpoint only"}]},"type":"enum","default":"auto","values":["auto","production","sandbox"]},"providers.imageOrder":{"ui":{"tab":"providers","group":"Services","label":"Image Provider Order","description":"Prioritized providers for image generation; unlisted providers follow the active session provider and the built-in order","ordered":true,"options":[{"value":"openai","label":"OpenAI","description":"OPENAI_API_KEY (gpt-image-2) or active GPT model; falls back to a connected Codex subscription"},{"value":"openai-codex","label":"OpenAI Codex (ChatGPT)","description":"Uses a connected Codex / ChatGPT subscription — no OPENAI_API_KEY needed"},{"value":"antigravity","label":"Antigravity","description":"Requires google-antigravity OAuth"},{"value":"xai","label":"xAI Grok Imagine","description":"Requires xAI Grok OAuth or XAI_API_KEY"},{"value":"gemini","label":"Gemini","description":"Requires GEMINI_API_KEY"},{"value":"openrouter","label":"OpenRouter","description":"Requires OPENROUTER_API_KEY"},{"value":"deepinfra","label":"DeepInfra","description":"Requires DEEPINFRA_API_KEY"}]},"type":"array","default":[]},"providers.fireworksTier":{"ui":{"tab":"providers","group":"Fireworks","label":"Fireworks Tier","description":"Serving path for Fireworks requests. Priority sends `service_tier: \\"priority\\"` for higher reliability during peak traffic at a higher price; Standard omits it. Fast (`-fast`) models ignore this — Fast is its own serving path.","options":[{"value":"standard","label":"Standard","description":"Default serving path (no service_tier)"},{"value":"priority","label":"Priority","description":"Priority serving path: higher reliability, premium per-token pricing"}]},"type":"enum","default":"standard","values":["standard","priority"]},"live.voice":{"ui":{"tab":"providers","group":"Services","label":"Live Voice","description":"Voice used by Codex-backed realtime voice sessions","options":[{"value":"arbor","label":"Arbor","description":""},{"value":"breeze","label":"Breeze","description":""},{"value":"cove","label":"Cove","description":""},{"value":"ember","label":"Ember","description":""},{"value":"juniper","label":"Juniper","description":""},{"value":"maple","label":"Maple","description":""},{"value":"sol","label":"Sol","description":""},{"value":"spruce","label":"Spruce","description":""},{"value":"vale","label":"Vale","description":""}]},"type":"enum","default":"sol","values":["arbor","breeze","cove","ember","juniper","maple","sol","spruce","vale"]},"providers.tts":{"ui":{"tab":"providers","group":"Services","label":"Text-to-Speech Provider","description":"Backend for the tts tool: local on-device neural TTS (Kokoro-82M), xAI Grok Voice, or DeepInfra speech","options":[{"value":"auto","label":"Auto","description":"Prefer local on-device TTS; route .mp3 output to xAI when credentials exist"},{"value":"local","label":"Local","description":"On-device neural TTS (Kokoro-82M); output is WAV/PCM16"},{"value":"xai","label":"xAI Grok Voice","description":"Requires xAI Grok OAuth or XAI_API_KEY; MP3 or WAV"},{"value":"deepinfra","label":"DeepInfra Speech","description":"Requires DEEPINFRA_API_KEY; MP3 or WAV"}]},"type":"enum","default":"auto","values":["auto","local","xai","deepinfra"]},"tts.localModel":{"ui":{"tab":"providers","group":"Services","label":"Local TTS Model","description":"On-device neural TTS model (Kokoro-82M) used by the local TTS backend","options":[{"value":"kokoro","label":"Kokoro-82M","description":"Kokoro-82M neural TTS — SoTA on-device quality, multi-voice, fully local"}]},"type":"enum","default":"kokoro","values":["kokoro"]},"tts.localVoice":{"ui":{"tab":"providers","group":"Services","label":"Local TTS Voice","description":"Kokoro voice used by the local TTS backend (American/British, female/male)","options":[{"value":"af_heart","label":"Heart (American female)","description":""},{"value":"af_bella","label":"Bella (American female)","description":""},{"value":"af_nicole","label":"Nicole (American female)","description":""},{"value":"af_aoede","label":"Aoede (American female)","description":""},{"value":"af_kore","label":"Kore (American female)","description":""},{"value":"af_sarah","label":"Sarah (American female)","description":""},{"value":"am_michael","label":"Michael (American male)","description":""},{"value":"am_fenrir","label":"Fenrir (American male)","description":""},{"value":"am_puck","label":"Puck (American male)","description":""},{"value":"bf_emma","label":"Emma (British female)","description":""},{"value":"bm_george","label":"George (British male)","description":""},{"value":"bm_fable","label":"Fable (British male)","description":""}]},"type":"enum","default":"af_heart","values":["af_heart","af_bella","af_nicole","af_aoede","af_kore","af_sarah","am_michael","am_fenrir","am_puck","bf_emma","bm_george","bm_fable"]},"speech.enabled":{"ui":{"tab":"providers","group":"Services","label":"Speech Vocalization","description":"Speak the assistant\'s output aloud through the speakers as it streams"},"type":"boolean","default":false},"speech.mode":{"ui":{"tab":"providers","group":"Services","label":"Speech Vocalization Mode","description":"What to speak: all = assistant messages + thinking; assistant = messages only; yield = only the final message at turn end","options":[{"value":"all","label":"All (messages + thinking)","description":""},{"value":"assistant","label":"Assistant messages","description":""},{"value":"yield","label":"Final message only","description":""}]},"type":"enum","default":"assistant","values":["all","assistant","yield"]},"speech.enhanced":{"ui":{"tab":"providers","group":"Services","label":"Enhanced Speech Rewriting","description":"Rewrite assistant output into natural spoken prose with the tiny/smol model before synthesis (describes code, drops links and markdown). Falls back to mechanical cleanup on failure"},"type":"boolean","default":false},"speech.voice":{"ui":{"tab":"providers","group":"Services","label":"Speech Vocalization Voice","description":"Kokoro voice used when speaking the assistant\'s output aloud","options":[{"value":"af_heart","label":"Heart (American female)","description":""},{"value":"af_bella","label":"Bella (American female)","description":""},{"value":"af_nicole","label":"Nicole (American female)","description":""},{"value":"af_aoede","label":"Aoede (American female)","description":""},{"value":"af_kore","label":"Kore (American female)","description":""},{"value":"af_sarah","label":"Sarah (American female)","description":""},{"value":"am_michael","label":"Michael (American male)","description":""},{"value":"am_fenrir","label":"Fenrir (American male)","description":""},{"value":"am_puck","label":"Puck (American male)","description":""},{"value":"bf_emma","label":"Emma (British female)","description":""},{"value":"bm_george","label":"George (British male)","description":""},{"value":"bm_fable","label":"Fable (British male)","description":""}]},"type":"enum","default":"af_heart","values":["af_heart","af_bella","af_nicole","af_aoede","af_kore","af_sarah","am_michael","am_fenrir","am_puck","bf_emma","bm_george","bm_fable"]},"providers.tinyModel":{"ui":{"tab":"providers","group":"Tiny Model","label":"Tiny Model","description":"Session-title model: online (the TINY role from /models, else @smol) by default, or a local on-device model","options":[{"value":"online","label":"Online (TINY role, else @smol)","description":"Online title generation: the TINY model role (set one in /models) when assigned, otherwise the online fallback (commit role, then @smol). No local download or on-device inference."},{"value":"lfm2.5-230m","label":"LFM2.5 230M","description":"Recommended local model; fastest LFM2.5 option, about 214 MB cached."},{"value":"lfm2.5-350m","label":"LFM2.5 350M","description":"Larger LFM2.5 option, about 292 MB cached; tends toward terse titles."},{"value":"falcon-h1-90m","label":"Falcon H1 Tiny 90M","description":"Smallest option, about 147 MB cached; lower fidelity on complex prompts."}]},"type":"enum","default":"online","values":["online","lfm2.5-230m","lfm2.5-350m","falcon-h1-90m"]},"providers.tinyModelDevice":{"ui":{"tab":"providers","group":"Tiny Model","label":"Tiny Model Device","description":"Inference backend for local tiny models (titles + memory): an ONNX execution provider, or `mlx` to download MLX weights and run them through mlx-lm on Apple silicon. Default uses CPU-only ONNX. The PI_TINY_DEVICE env var overrides this.","options":[{"value":"default","label":"Default","description":"CPU-only inference"},{"value":"gpu","label":"GPU","description":"Accelerated provider (WebGPU/Metal, CUDA, or DirectML)"},{"value":"cpu","label":"CPU","description":"CPU-only inference"},{"value":"mlx","label":"MLX","description":"Apple silicon GPU via mlx-lm (Python subprocess; macOS arm64)"},{"value":"metal","label":"Metal","description":"Alias for MLX"},{"value":"webgpu","label":"WebGPU","description":"WebGPU/Metal backend"},{"value":"cuda","label":"CUDA","description":"NVIDIA CUDA (Linux x64)"},{"value":"dml","label":"DirectML","description":"DirectML backend (Windows)"},{"value":"coreml","label":"CoreML","description":"Apple CoreML (opt-in; can fail to load)"},{"value":"auto","label":"Auto","description":"Let ONNX Runtime choose a provider"},{"value":"wasm","label":"WASM","description":"WebAssembly backend"},{"value":"webnn","label":"WebNN","description":"WebNN backend"},{"value":"webnn-gpu","label":"WebNN GPU","description":"WebNN GPU device"},{"value":"webnn-cpu","label":"WebNN CPU","description":"WebNN CPU device"},{"value":"webnn-npu","label":"WebNN NPU","description":"WebNN NPU device"}]},"type":"enum","default":"default","values":["default","gpu","cpu","mlx","metal","webgpu","cuda","dml","coreml","auto","wasm","webnn","webnn-gpu","webnn-cpu","webnn-npu"]},"providers.tinyModelDtype":{"ui":{"tab":"providers","group":"Tiny Model","label":"Tiny Model Precision","description":"ONNX quantization/precision for local tiny models. Default uses each model\'s shipped dtype (q4); lower precision is faster, higher is more faithful. Ignored by the MLX backend (its repos are pre-quantized 4-bit). The PI_TINY_DTYPE env var overrides this.","options":[{"value":"default","label":"Default","description":"Each model\'s shipped dtype (currently q4)"},{"value":"q4","label":"q4","description":"4-bit weights; smallest and fastest"},{"value":"q4f16","label":"q4f16","description":"4-bit weights with fp16 activations"},{"value":"q8","label":"q8","description":"8-bit quantization"},{"value":"fp16","label":"fp16","description":"16-bit float; higher fidelity, larger"},{"value":"fp32","label":"fp32","description":"Full precision; largest and slowest"},{"value":"int8","label":"int8","description":"Signed 8-bit integer"},{"value":"uint8","label":"uint8","description":"Unsigned 8-bit integer"},{"value":"bnb4","label":"bnb4","description":"bitsandbytes 4-bit"},{"value":"q2","label":"q2","description":"2-bit weights"},{"value":"q2f16","label":"q2f16","description":"2-bit weights with fp16 activations"},{"value":"q1","label":"q1","description":"1-bit weights"},{"value":"q1f16","label":"q1f16","description":"1-bit weights with fp16 activations"},{"value":"auto","label":"Auto","description":"Let transformers.js choose per device"}]},"type":"enum","default":"default","values":["default","q4","q4f16","q8","fp16","fp32","int8","uint8","bnb4","q2","q2f16","q1","q1f16","auto"]},"providers.memoryModel":{"ui":{"tab":"memory","group":"General","label":"Memory Model","description":"Mnemopi LLM for fact extraction + consolidation: online (the TINY role from /models, else smol/remote) by default, or a local on-device model","condition":"mnemopiActive","options":[{"value":"online","label":"Online (TINY role, else @smol)","description":"Use the online model: the TINY role from /models when set, otherwise @smol. No local model download or on-device inference."},{"value":"qwen3-1.7b","label":"Qwen3 1.7B","description":"MLX only (providers.tinyModelDevice=mlx): onnxruntime-node cannot run this ONNX export\'s RotaryEmbedding cache updates."},{"value":"llama3.2:3b","label":"Llama 3.2 3B","description":"Larger Llama 3.2 option for local memory/classifier tasks; higher quality potential at higher disk/RAM/latency cost."},{"value":"gemma-3-1b","label":"Gemma 3 1B","description":"Best consolidation/dedup; lighter footprint, but leaks small talk during extraction."},{"value":"qwen2.5-1.5b","label":"Qwen2.5 1.5B","description":"Best extraction granularity (atomic facts); weaker consolidation."},{"value":"lfm2-1.2b","label":"LFM2 1.2B","description":"Fastest load; solid all-rounder, slightly noisier extraction labels."}]},"type":"enum","default":"online","values":["online","qwen3-1.7b","llama3.2:3b","gemma-3-1b","qwen2.5-1.5b","lfm2-1.2b"]},"providers.autoThinkingModel":{"ui":{"tab":"model","group":"Thinking","label":"Auto Thinking Model","description":"Difficulty classifier for the `auto` thinking level: online (the TINY role from /models, else smol) by default, or a local on-device model","condition":"autoThinkingActive","options":[{"value":"online","label":"Online (TINY role, else @smol)","description":"Classify prompt difficulty online with the TINY role model (set one in /models) or @smol; no local download or on-device inference."},{"value":"qwen3-1.7b","label":"Qwen3 1.7B","description":"MLX only (providers.tinyModelDevice=mlx): onnxruntime-node cannot run this ONNX export\'s RotaryEmbedding cache updates."},{"value":"llama3.2:3b","label":"Llama 3.2 3B","description":"Larger Llama 3.2 option for local memory/classifier tasks; higher quality potential at higher disk/RAM/latency cost."},{"value":"gemma-3-1b","label":"Gemma 3 1B","description":"Best consolidation/dedup; lighter footprint, but leaks small talk during extraction."},{"value":"qwen2.5-1.5b","label":"Qwen2.5 1.5B","description":"Best extraction granularity (atomic facts); weaker consolidation."},{"value":"lfm2-1.2b","label":"LFM2 1.2B","description":"Fastest load; solid all-rounder, slightly noisier extraction labels."}]},"type":"enum","default":"online","values":["online","qwen3-1.7b","llama3.2:3b","gemma-3-1b","qwen2.5-1.5b","lfm2-1.2b"]},"providers.autoThinkingMaxEffort":{"ui":{"tab":"model","group":"Thinking","label":"Auto Thinking Ceiling","description":"Highest effort the `auto` classifier may resolve. `xhigh` keeps the classifier one tier below the top, so only an explicit `ultrathink` reaches `max`; `max` lets a turn the classifier judges exceptional bill the top tier on models that expose it.","condition":"autoThinkingActive","options":[{"value":"xhigh","label":"xhigh","description":"Classifier stops at xhigh (default)"},{"value":"max","label":"max","description":"Classifier may resolve max where the model supports it"}]},"type":"enum","default":"xhigh","values":["xhigh","max"]},"features.unexpectedStopDetection":{"ui":{"tab":"interaction","group":"Agent","label":"Unexpected Stops","description":"Automatically recover when the assistant stops without a visible message. Smart also classifies text-only stops with a small model.","options":[{"value":"none","label":"None","description":"Disabled"},{"value":"mechanical","label":"Mechanical","description":"Retry stops with no visible assistant message; tool calls are excluded (default)"},{"value":"smart","label":"Smart","description":"Mechanical + small-model classification of text-only stops"}]},"type":"enum","default":"mechanical","values":["none","mechanical","smart"]},"providers.unexpectedStopModel":{"ui":{"tab":"providers","group":"Tiny Model","label":"Unexpected Stop Model","description":"Classifier for Smart unexpected-stop detection: online (the TINY role from /models, else smol) by default, or a local on-device model.","condition":"unexpectedStopSmart","options":[{"value":"online","label":"Online (TINY role, else @smol)","description":"Use the online model: the TINY role from /models when set, otherwise @smol. No local model download or on-device inference."},{"value":"qwen3-1.7b","label":"Qwen3 1.7B","description":"MLX only (providers.tinyModelDevice=mlx): onnxruntime-node cannot run this ONNX export\'s RotaryEmbedding cache updates."},{"value":"llama3.2:3b","label":"Llama 3.2 3B","description":"Larger Llama 3.2 option for local memory/classifier tasks; higher quality potential at higher disk/RAM/latency cost."},{"value":"gemma-3-1b","label":"Gemma 3 1B","description":"Best consolidation/dedup; lighter footprint, but leaks small talk during extraction."},{"value":"qwen2.5-1.5b","label":"Qwen2.5 1.5B","description":"Best extraction granularity (atomic facts); weaker consolidation."},{"value":"lfm2-1.2b","label":"LFM2 1.2B","description":"Fastest load; solid all-rounder, slightly noisier extraction labels."}]},"type":"enum","default":"online","values":["online","qwen3-1.7b","llama3.2:3b","gemma-3-1b","qwen2.5-1.5b","lfm2-1.2b"]},"providers.kimiApiFormat":{"ui":{"tab":"providers","group":"Protocol","label":"Kimi API Format","description":"API format for Kimi Code provider (auto follows live model metadata)","options":[{"value":"auto","label":"Auto","description":"Use the model\'s server-declared protocol"},{"value":"openai","label":"OpenAI","description":"api.kimi.com"},{"value":"anthropic","label":"Anthropic","description":"api.moonshot.ai"}]},"type":"enum","default":"auto","values":["auto","openai","anthropic"]},"providers.openaiWebsockets":{"ui":{"tab":"providers","group":"Protocol","label":"OpenAI WebSockets","description":"Websocket policy for OpenAI Codex models (auto uses model defaults, on forces, off disables)","options":[{"value":"auto","label":"Auto","description":"Use model/provider default websocket behavior"},{"value":"off","label":"Off","description":"Disable websockets for OpenAI Codex models"},{"value":"on","label":"On","description":"Force websockets for OpenAI Codex models"}]},"type":"enum","default":"auto","values":["auto","off","on"]},"providers.cacheRetention":{"ui":{"tab":"providers","group":"Protocol","label":"Prompt Cache Retention","description":"Prompt-cache retention forwarded to providers that support it (Anthropic, Bedrock, OpenRouter, OpenAI)","options":[{"value":"auto","label":"Auto","description":"Provider default — Anthropic OAuth subscriber sessions default to 1h, API keys use 5m kept warm by idle keep-alive refreshes; PI_CACHE_RETENTION still applies"},{"value":"short","label":"Short (5m)","description":"Cheapest cache writes; Anthropic keeps the entry warm with bounded keep-alive refreshes while idle"},{"value":"long","label":"Long (1h)","description":"1h TTL where the provider supports it; pricier writes, no keep-alive refresh requests"},{"value":"none","label":"Off","description":"Disable prompt caching and cache-affinity routing"}]},"type":"enum","default":"auto","values":["auto","short","long","none"]},"providers.streamFirstEventTimeoutSeconds":{"ui":{"tab":"providers","group":"Timeouts","label":"Stream First Event Timeout","description":"Seconds to wait for the first model stream event; -1 uses provider/env defaults, 0 disables the watchdog","options":[{"value":"-1","label":"Auto","description":"Use provider defaults and PI_* timeout env vars"},{"value":"0","label":"Off","description":"Disable first-event timeout"},{"value":"300","label":"5 minutes","description":""},{"value":"600","label":"10 minutes","description":""},{"value":"1800","label":"30 minutes","description":""}]},"type":"number","default":-1},"providers.streamIdleTimeoutSeconds":{"ui":{"tab":"providers","group":"Timeouts","label":"Stream Idle Timeout","description":"Seconds a model stream may stay silent between events; -1 uses provider/env defaults, 0 disables the watchdog","options":[{"value":"-1","label":"Auto","description":"Use provider defaults and PI_* timeout env vars"},{"value":"0","label":"Off","description":"Disable idle timeout"},{"value":"300","label":"5 minutes","description":""},{"value":"600","label":"10 minutes","description":""},{"value":"1800","label":"30 minutes","description":""}]},"type":"number","default":-1},"providers.openrouterVariant":{"ui":{"tab":"providers","group":"Protocol","label":"OpenRouter Routing","description":"Default routing-variant suffix appended to OpenRouter model IDs (overridden when the selector already names a variant)","options":[{"value":"default","label":"Default","description":"No suffix; use OpenRouter\'s default routing"},{"value":"nitro","label":":nitro","description":"Prioritize throughput / lowest latency"},{"value":"floor","label":":floor","description":"Prioritize cheapest available provider"},{"value":"online","label":":online","description":"Enable OpenRouter\'s web-search plugin"},{"value":"exacto","label":":exacto","description":"Cherry-picked high-quality providers (only defined for select models)"}]},"type":"enum","default":"default","values":["default","nitro","floor","online","exacto"]},"providers.fetch":{"ui":{"tab":"providers","group":"Services","label":"Fetch Provider","description":"Reader backend priority for the fetch/read URL tool","options":[{"value":"auto","label":"Auto","description":"Priority: native > trafilatura > lynx > parallel > firecrawl > jina"},{"value":"native","label":"Native","description":"In-process HTML→Markdown converter (always available)"},{"value":"trafilatura","label":"Trafilatura","description":"Auto-installs via uv/pip"},{"value":"lynx","label":"Lynx","description":"Requires lynx system package"},{"value":"parallel","label":"Parallel","description":"Requires PARALLEL_API_KEY"},{"value":"firecrawl","label":"Firecrawl","description":"Requires FIRECRAWL_API_KEY"},{"value":"jina","label":"Jina","description":"Uses r.jina.ai reader (JINA_API_KEY optional)"}]},"type":"enum","default":"auto","values":["auto","native","trafilatura","lynx","parallel","firecrawl","jina"]},"codexResets.autoRedeem":{"ui":{"tab":"providers","group":"Services","label":"Codex Auto-Redeem Saved Resets","description":"Spend saved Codex rate-limit resets automatically: restore an account blocked by an exhausted 5h or weekly window when a turn is stuck and no other account can take over, and salvage credits that are about to expire. unset asks before the first spend, yes spends without prompting, and no disables both checks.","options":[{"value":"unset","label":"Unset","description":"Check eligibility, then ask before spending the first saved reset."},{"value":"yes","label":"Yes","description":"Spend eligible saved resets without prompting."},{"value":"no","label":"No","description":"Do not run the saved-reset auto-redeem check."}]},"type":"enum","default":"unset","values":["unset","yes","no"]},"codexResets.minBlockedMinutes":{"ui":{"tab":"providers","group":"Services","label":"Codex Auto-Redeem Min Block","description":"Only auto-redeem when the natural unblock — the latest reset among the exhausted 5h/weekly windows — is at least this many minutes away (don\'t spend a scarce credit to save a short wait). Raise it (e.g. 360) to ignore 5h-only blocks."},"type":"number","default":60},"codexResets.keepCredits":{"ui":{"tab":"providers","group":"Services","label":"Codex Auto-Redeem Reserve","description":"Never auto-spend below this many saved resets (0 = the last credit may be spent automatically). Credits about to expire are exempt — a reserved credit that expires preserves nothing."},"type":"number","default":0},"codexResets.salvageHorizonHours":{"ui":{"tab":"providers","group":"Services","label":"Codex Reset Salvage Horizon","description":"Spend a saved Codex reset automatically when it would otherwise expire within this many hours and either chat window (5h or weekly) has meaningful usage to restore (0 disables expiry salvage)."},"type":"number","default":12},"provider.appendOnlyContext":{"ui":{"tab":"providers","group":"Protocol","label":"Append-Only Context","description":"Cache system prompt + tool specs and keep an append-only message log so provider prefix caches (DeepSeek, Xiaomi/SGLang, Anthropic) hit at maximum rate. Auto enables for known prefix-cache providers.","options":[{"value":"auto","label":"Auto","description":"Enable for known prefix-cache providers (recommended)"},{"value":"on","label":"On","description":"Always enable append-only context"},{"value":"off","label":"Off","description":"Disable append-only context"}]},"type":"enum","default":"auto","values":["auto","on","off"]},"exa.enabled":{"ui":{"tab":"providers","group":"Services","label":"Exa","description":"Enable the Exa web search provider"},"type":"boolean","default":true},"exa.searchDelayMs":{"ui":{"tab":"providers","group":"Services","label":"Exa Search Delay","description":"Minimum delay between Exa web search requests in milliseconds; set 0 to disable pacing"},"type":"number","default":1000},"searxng.endpoint":{"ui":{"tab":"providers","group":"Services","label":"SearXNG Endpoint","description":"Base URL of a self-hosted SearXNG instance used for web search"},"type":"string"},"extensionHandlers.toolCallTimeoutMs":{"ui":{"tab":"tools","group":"Extensions","label":"Tool Call Handler Timeout (ms)","description":"Positive finite active-work timeout for extension tool_call handlers; invalid values use 30000ms, and time awaiting OMP-owned dialogs does not count"},"type":"number","default":30000},"dev.autoqa":{"ui":{"tab":"tools","group":"Developer","label":"Auto QA","description":"Automated tool issue reporting (xd://report_issue). On by default; the first report asks for consent, and denying it disables reporting until re-enabled explicitly"},"type":"boolean","default":true},"dev.autoqaPush.endpoint":{"ui":{"tab":"tools","group":"Developer","label":"Auto QA Push Endpoint","description":"Full URL receiving Auto QA JSON reports (default https://qa.omp.sh/v1/grievances)"},"type":"string","default":"https://qa.omp.sh/v1/grievances"}}}');let nv={...ng.entries,"retry.enabled":{type:"boolean",default:!0,ui:{tab:"model",group:"Retry & Fallback",label:"Retry Enabled",description:"Retry transient provider errors (rate limits, outages, quota walls)."}},"retry.baseDelayMs":{type:"number",default:500,ui:{tab:"model",group:"Retry & Fallback",label:"Retry Base Delay (ms)",description:"Initial backoff before the first retry."}},"thinkingBudgets.minimal":{type:"number",default:1024,ui:{tab:"model",group:"Thinking",label:"Minimal Thinking Budget",description:"Token budget for the minimal thinking level."}},"thinkingBudgets.low":{type:"number",default:2048,ui:{tab:"model",group:"Thinking",label:"Low Thinking Budget",description:"Token budget for the low thinking level."}},"thinkingBudgets.medium":{type:"number",default:8192,ui:{tab:"model",group:"Thinking",label:"Medium Thinking Budget",description:"Token budget for the medium thinking level."}},"thinkingBudgets.high":{type:"number",default:16384,ui:{tab:"model",group:"Thinking",label:"High Thinking Budget",description:"Token budget for the high thinking level."}},"thinkingBudgets.xhigh":{type:"number",default:32768,ui:{tab:"model",group:"Thinking",label:"XHigh Thinking Budget",description:"Token budget for the xhigh thinking level."}},"thinkingBudgets.max":{type:"number",default:32768,ui:{tab:"model",group:"Thinking",label:"Max Thinking Budget",description:"Token budget for the max thinking level."}},modelTags:{type:"record",default:{},ui:{tab:"model",group:"Prompt",label:"Model Tags",description:"Custom role/tag metadata; can introduce additional roles. JSON record."}},modelProviderOrder:{type:"array",default:[],ui:{tab:"model",group:"Prompt",label:"Model Provider Order",description:"Preferred provider order when a model id is ambiguous. JSON array."}},cycleOrder:{type:"array",default:["smol","default","slow"],ui:{tab:"model",group:"Prompt",label:"Model Cycle Order",description:"Roles cycled by the model switcher. JSON array."}},enabledModels:{type:"array",default:[],ui:{tab:"model",group:"Prompt",label:"Enabled Models",description:"Allow-list of models; supports path-scoped entries. Empty means all available models. JSON array."}},"task.agentServiceTierOverrides":{type:"record",default:{},ui:{tab:"model",group:"Sampling",label:"Agent Service Tier Overrides",description:"Sparse exact-name service-tier overrides for agents spawned by task/eval dispatch. JSON record."}},"compaction.reserveTokens":{type:"number",ui:{tab:"context",group:"Compaction",label:"Compaction Reserve Tokens",description:"Absolute reserve floor. Unset = larger of 16384 and 15% of the context window."}},"compaction.keepRecentTokens":{type:"number",default:2e4,ui:{tab:"context",group:"Compaction",label:"Keep Recent Tokens",description:"Recent tokens always preserved through compaction."}},"compaction.autoContinue":{type:"boolean",default:!0,ui:{tab:"context",group:"Compaction",label:"Auto-Continue",description:"Continue automatically after compaction."}},"autolearn.minToolCalls":{type:"number",default:5,ui:{tab:"memory",group:"Auto-Learn",label:"Min Tool Calls",description:"Only nudge after a turn that used at least this many tools.",condition:"autolearnActive"}},shellPath:{type:"string",ui:{tab:"shell",group:"Bash",label:"Shell Path",description:"Override the shell binary used by bash."}},"bash.autoBackground.thresholdMs":{type:"number",default:6e4,ui:{tab:"shell",group:"Bash",label:"Auto-Background Threshold (ms)",description:"Threshold before auto-backgrounding long-running commands."}},"task.agentAdvisor":{type:"record",default:{},ui:{tab:"tasks",group:"Subagents",label:"Agent Advisor Overrides",description:'Per-agent subagent advisor: agent name → "on" / "off" / advisor model pattern. JSON record.'}},enabledProviders:{type:"array",default:[],ui:{tab:"providers",group:"Services",label:"Enabled Providers",description:"Foreign user-level discovery sources to load; supports path-scoped entries. JSON array."}},disabledProviders:{type:"array",default:[],ui:{tab:"providers",group:"Services",label:"Disabled Providers",description:"Disabled model/discovery providers; supports path-scoped entries. JSON array."}}};function nk(e,t){return e[t]?.value}let ny=(e,t)=>JSON.stringify(e)===JSON.stringify(t),nw=e=>{let t=e.trim();if(""===t||"-"===t||"+"===t)return null;let n=Number(t);return Number.isFinite(n)?n:null};function nN(e){let{entryKey:t,entry:n,value:r,initialValue:l,onChangeDirty:s,onCommit:o,saving:c,saveError:d}=e,[p,u]=(0,a.J0)(()=>null==r?"":Array.isArray(r)||"object"==typeof r?JSON.stringify(r):String(r)),m=(0,a.li)(!1),b=(0,a.li)(l),f=(0,a.Kr)(()=>Array.isArray(n.ui.options)?n.ui.options:null,[n.ui.options]);(0,a.vJ)(()=>{u(null==r?"":Array.isArray(r)||"object"==typeof r?JSON.stringify(r):String(r)),m.current=!1},[r]);let x=()=>{let e=b.current;u(null==e?"":Array.isArray(e)||"object"==typeof e?JSON.stringify(e):String(e)),m.current=!1,s(t,!1,()=>{})},g=e=>{u("string"==typeof e?e:JSON.stringify(e)),m.current=!1,o(t,e).then(e=>{e?s(t,!1,()=>{}):(u(p),s(t,!0,x))}).catch(()=>{u(p),s(t,!0,x)})},v=()=>{if(m.current){if("number"===n.type){let e=nw(p);return null===e||e===r?void x():void g(e)}if("string"===n.type){let e=p.trim();return e===r?void x():void g(e)}if("array"===n.type){let e=(e=>{let t=e.trim();if(""===t)return[];try{let e=JSON.parse(t);return Array.isArray(e)?e:null}catch{return null}})(p);return null===e||ny(e,r)?void x():void g(e)}if("record"===n.type){let e=(e=>{let t=e.trim();if(""===t)return{};try{let e=JSON.parse(t);return"object"!=typeof e||null===e||Array.isArray(e)?null:e}catch{return null}})(p);if(null===e||ny(e,r))return void x();g(e)}}},k=()=>{let e=m.current;m.current=!0,e||s(t,!0,x)};if("boolean"===n.type){let e=!0===r;return(0,i.Y)("button",{type:"button",role:"switch","aria-checked":e,"aria-label":n.ui.label,onClick:()=>{s(t,!1,()=>{}),g(!e)},disabled:c,className:`relative h-5 w-9 shrink-0 rounded-full transition-colors cursor-pointer ${e?"bg-ink":"bg-ink/15"} ${c?"opacity-50":""}`,children:(0,i.Y)("span",{className:`absolute top-0.5 h-4 w-4 rounded-full bg-paper shadow-sm transition-all ${e?"left-[18px]":"left-0.5"}`})})}if("array"===n.type&&n.ui.ordered&&f){let e=Array.isArray(r)?r.filter(e=>"string"==typeof e):[],t=t=>{g(e.includes(t)?e.filter(e=>e!==t):[...e,t])},n=(t,n)=>{let i=t+n;if(i<0||i>=e.length)return;let r=[...e],[a]=r.splice(t,1);r.splice(i,0,a),g(r)};return(0,i.FD)("div",{className:"flex flex-wrap items-center gap-1.5 justify-end max-w-72",children:[e.map((r,a)=>{let l=f.find(e=>e.value===r);return(0,i.FD)("span",{className:"inline-flex items-center gap-1 rounded-md border border-ink/15 bg-ink/[0.03] px-2 py-0.5 text-[10px] text-ink",children:[a>0&&(0,i.Y)("button",{type:"button","aria-label":`${l?.label??r} left`,onClick:()=>n(a,-1),className:"text-ink/40 hover:text-ink cursor-pointer",disabled:c,children:"←"}),l?.label??r,a<e.length-1&&(0,i.Y)("button",{type:"button","aria-label":`${l?.label??r} right`,onClick:()=>n(a,1),className:"text-ink/40 hover:text-ink cursor-pointer",disabled:c,children:"→"}),(0,i.Y)("button",{type:"button","aria-label":`Remove ${l?.label??r}`,onClick:()=>t(r),className:"text-ink/40 hover:text-error cursor-pointer",disabled:c,children:(0,i.Y)(h.A,{size:10})})]},r)}),0===e.length&&(0,i.Y)("span",{className:"text-[10px] text-ink/40",children:"empty"}),(0,i.FD)("details",{className:"relative",children:[(0,i.Y)("summary",{className:"cursor-pointer rounded-md border border-ink/15 px-2 py-0.5 text-[10px] text-ink/70 hover:text-ink select-none",children:"add…"}),(0,i.FD)("div",{className:"absolute right-0 top-full z-10 mt-1 max-h-44 w-48 overflow-auto rounded-md border border-ink/15 bg-paper p-1 shadow-lg",children:[f.filter(t=>!e.includes(t.value)).map(e=>(0,i.Y)("button",{type:"button",onClick:()=>t(e.value),className:"block w-full rounded px-2 py-1 text-left text-[11px] text-ink/80 hover:bg-ink/5",children:e.label||e.value},e.value)),f.every(t=>e.includes(t.value))&&(0,i.Y)("div",{className:"px-2 py-1 text-[10px] text-ink/40",children:"all selected"})]})]})]})}let y=f??("enum"===n.type&&n.values?n.values.map(e=>({value:e,label:e,description:""})):null);if(y){let e=null==r?"":String(r);return(0,i.Y)("div",{className:"flex items-center gap-2 shrink-0",children:(0,i.FD)("select",{"aria-label":n.ui.label,value:e,onChange:e=>{let t=e.currentTarget.value;if("number"===n.type){let e=nw(t);if(null===e||e===r)return;g(e)}else{if(t===r)return;g(t)}},disabled:c,className:`bg-paper border border-ink/15 rounded-md px-2 py-1 text-ink max-w-56 ${c?"opacity-50":""}`,children:[""===e&&(0,i.Y)("option",{value:"",disabled:!0,children:"select…"}),y.map(e=>(0,i.Y)("option",{value:e.value,children:e.label||e.value},e.value))]})})}return"array"===n.type?(0,i.Y)("input",{"aria-label":n.ui.label,type:"text",value:p,onChange:e=>{u(e.currentTarget.value),k()},onBlur:v,disabled:c,placeholder:'["anthropic","openai"]',className:`w-48 bg-paper border border-ink/15 rounded-md px-2 py-1 text-ink text-right font-mono text-[11px] ${c?"opacity-50":""}`}):"record"===n.type?(0,i.Y)("input",{"aria-label":n.ui.label,type:"text",value:p,onChange:e=>{u(e.currentTarget.value),k()},onBlur:v,disabled:c,placeholder:'{"bash":"prompt"}',className:`w-48 bg-paper border border-ink/15 rounded-md px-2 py-1 text-ink text-right font-mono text-[11px] ${c?"opacity-50":""}`}):"number"===n.type?(0,i.Y)("input",{"aria-label":n.ui.label,type:"text",inputMode:"decimal",value:p,onChange:e=>{u(e.currentTarget.value),k()},onBlur:v,disabled:c,className:`w-28 bg-paper border border-ink/15 rounded-md px-2 py-1 text-ink text-right font-mono text-[11px] ${c?"opacity-50":""}`}):(0,i.Y)("input",{"aria-label":n.ui.label,type:n.credential?"password":"text",value:p,onChange:e=>{u(e.currentTarget.value),k()},onBlur:v,disabled:c,className:`w-48 bg-paper border border-ink/15 rounded-md px-2 py-1 text-ink text-right font-mono text-[11px] ${c?"opacity-50":""} ${d?"border-error":""}`})}function nY(e){let{tabs:t,entries:n,activeTabId:r,onSelectTab:l,searchQuery:s,dirtyKeys:o,savingKeys:c,saveErrors:d,onCommit:p,onReset:u,onDirty:m}=e,h=t.find(e=>e.id===r)??t[0],b=(0,a.Kr)(()=>{var e;let t=s.trim().toLowerCase();return t?Object.entries(nv).filter(e=>{let[n,i]=e;return!t||n.toLowerCase().includes(t)||i.ui.label.toLowerCase().includes(t)||i.ui.description.toLowerCase().includes(t)}).map(e=>{let[t]=e;return t}).slice(0,80):(e=h.id,Object.entries(nv).filter(t=>{let[,n]=t;return n.ui.tab===e})).filter(e=>{let[,t]=e;switch(t.ui.condition){case void 0:case"macOS":case"hasImageProtocol":default:return!0;case"advisorEnabled":return!0===nk(n,"advisor.enabled");case"vimModeEnabled":return!0===nk(n,"tui.vimMode");case"hindsightActive":return"hindsight"===nk(n,"memory.backend");case"mnemopiActive":return"mnemopi"===nk(n,"memory.backend");case"autolearnActive":return!0===nk(n,"autolearn.enabled");case"autoThinkingActive":return"auto"===nk(n,"defaultThinkingLevel");case"usageAwareFallbackEnabled":return!0===nk(n,"retry.usageAwareFallback");case"planModeEnabled":return!0===nk(n,"plan.enabled");case"planAutosaveEnabled":return!0===nk(n,"plan.enabled")&&!0===nk(n,"plan.autosave");case"unexpectedStopSmart":return"smart"===nk(n,"features.unexpectedStopDetection")}}).map(e=>{let[t]=e;return t})},[n,h.id,s]),f=(0,a.Kr)(()=>{if(!s.trim())return[];let e=[],n=new Map;for(let i of b){let r=nv[i],a=t.find(e=>e.id===r?.ui.tab),l=`${r?.ui.tab??"?"}\0${r?.ui.group??""}`,s=n.get(l);s||(s={label:r?.ui.group?`${a?.label??r?.ui.tab} \xb7 ${r.ui.group}`:a?.label??r?.ui.tab??"Other",keys:[]},n.set(l,s),e.push({id:l,...s})),s.keys.push(i)}return e},[b,s,t]);return(0,i.FD)("div",{className:"w-full flex flex-col gap-3 text-xs",children:[(0,i.Y)("div",{className:"flex items-center gap-1 overflow-x-auto pb-1 scrollbar-overlay-container scrollbar-overlay-static",children:t.map(e=>(0,i.Y)("button",{type:"button",onClick:()=>l(e.id),className:`shrink-0 rounded-md px-2.5 py-1 text-[11px] font-medium transition-colors cursor-pointer ${e.id===h.id?"bg-ink/10 text-ink":"text-ink/55 hover:bg-ink/5 hover:text-ink"}`,children:e.label},e.id))}),(0,i.FD)("div",{className:"w-full rounded-lg border border-ink/10 divide-y divide-ink/5",children:[s.trim()?f.map(e=>(0,i.Y)(nD,{keys:e.keys,entries:n,groupLabel:e.label,dirtyKeys:o,savingKeys:c,saveErrors:d,onCommit:p,onReset:u,onDirty:m},e.id)):h.groups.map(e=>{let t=b.filter(t=>nv[t]?.ui.group===e);return 0===t.length?null:(0,i.Y)(nD,{keys:t,entries:n,groupLabel:e,dirtyKeys:o,savingKeys:c,saveErrors:d,onCommit:p,onReset:u,onDirty:m},e)}),0===b.length&&(0,i.Y)("div",{className:"px-3 py-6 text-center text-ink/40",children:s.trim()?"No settings match your search.":"No settings in this tab."})]})]})}function nD(e){let{keys:t,entries:n,groupLabel:r,dirtyKeys:a,savingKeys:l,saveErrors:s,onCommit:o,onReset:c,onDirty:d}=e;return(0,i.FD)("div",{children:[(0,i.Y)("div",{className:"px-3 py-1.5 bg-ink/[0.02] text-[10px] uppercase tracking-wide text-ink/40 font-medium",children:r}),t.map(e=>{let t=nv[e];if(!t?.ui)return null;let r=n[e]?.value,p=a.has(e),u=l.has(e),m=s.has(e);return(0,i.FD)("div",{className:"flex items-center justify-between gap-3 px-3 py-2",children:[(0,i.FD)("div",{className:"min-w-0 flex-1",children:[(0,i.FD)("div",{className:"flex items-center gap-1.5",children:[(0,i.Y)("span",{className:"font-medium text-ink",children:t.ui.label}),(0,i.Y)("span",{className:"font-mono text-[9px] text-ink/30",title:"config key",children:e}),p&&!u&&(0,i.Y)("span",{className:"shrink-0 rounded bg-warning/15 px-1 py-px text-[9px] font-semibold text-warning",children:"unsaved"}),u&&(0,i.Y)("span",{className:"shrink-0 text-[9px] text-ink/40",children:"saving…"}),m&&!u&&(0,i.Y)("span",{className:"shrink-0 rounded bg-error/10 px-1 py-px text-[9px] font-semibold text-error",children:"save failed"})]}),t.ui.description&&(0,i.Y)("div",{className:"text-[10px] text-ink/40 leading-snug",children:t.ui.description}),t.ui.warning&&(0,i.Y)("div",{className:"text-[10px] text-error/80 leading-snug",children:t.ui.warning})]}),(0,i.FD)("div",{className:"flex items-center gap-1.5 shrink-0",children:[(0,i.Y)(nN,{entryKey:e,entry:t,value:r,initialValue:r,onChangeDirty:d,onCommit:o,saving:u,saveError:m}),(0,i.Y)("button",{type:"button","aria-label":`Reset ${t.ui.label}`,title:"Reset to schema default",onClick:()=>c(e),disabled:u,className:`rounded p-1 text-ink/30 hover:text-ink transition-colors cursor-pointer disabled:opacity-40 ${u?"":"hover:bg-ink/5"}`,children:(0,i.Y)(tK.A,{size:11})}),p&&(0,i.Y)(D.A,{size:11,className:"text-ink/30"})]})]},e)})]})}let nA=["default","smol","slow","vision","plan","commit","tiny","task","advisor"];function nF(e){let{modelRoles:t,onSaveRole:n,savedRole:r}=e,[l,s]=(0,a.J0)(()=>({...t}));return(0,i.FD)("div",{className:"pt-2",children:[(0,i.FD)("div",{className:"flex items-center justify-between pb-2",children:[(0,i.FD)("div",{children:[(0,i.Y)("h3",{className:"text-sm font-semibold text-ink",children:"Model Roles"}),(0,i.Y)("p",{className:"text-ink/50 mt-0.5",children:"Role → model selectors from config.yml. Empty removes the role override."})]}),r&&(0,i.FD)("span",{className:"inline-flex items-center gap-1 text-[10px] text-ink/60",children:[(0,i.Y)(D.A,{size:11})," saved"]})]}),(0,i.Y)("div",{className:"rounded-lg border border-ink/10 divide-y divide-ink/5",children:nA.map(e=>(0,i.FD)("div",{className:"flex items-center justify-between gap-3 px-3 py-2.5",children:[(0,i.Y)("div",{className:"font-medium text-ink capitalize",children:e}),(0,i.Y)("input",{"aria-label":`${e} model`,type:"text",value:l[e]??"",onChange:t=>s(n=>({...n,[e]:t.currentTarget.value})),onBlur:i=>((e,i)=>{let r=i.trim();if((t[e]??"")===r)return;let a={...l};r?a[e]=r:delete a[e],s(a),n(e,r)})(e,i.currentTarget.value),placeholder:"provider/model",className:"w-56 bg-paper border border-ink/15 rounded-md px-2 py-1 text-ink text-right font-mono"})]},e))})]})}function nC(e){let{extensions:t,savedExtension:n,onToggle:r}=e;return 0===t.length?null:(0,i.FD)("div",{className:"pt-2",children:[(0,i.FD)("div",{className:"flex items-center justify-between pb-2",children:[(0,i.FD)("div",{children:[(0,i.Y)("h3",{className:"text-sm font-semibold text-ink",children:"Extensions"}),(0,i.Y)("p",{className:"text-ink/50 mt-0.5",children:"TS/JS modules loaded from .omp/extensions. Disable writes to config.yml."})]}),n&&(0,i.FD)("span",{className:"inline-flex items-center gap-1 text-[10px] text-ink/60",children:[(0,i.Y)(D.A,{size:11})," saved"]})]}),(0,i.Y)("div",{className:"rounded-lg border border-ink/10 divide-y divide-ink/5",children:t.map(e=>(0,i.FD)("div",{className:"flex items-center justify-between gap-3 px-3 py-2.5",children:[(0,i.FD)("div",{className:"min-w-0",children:[(0,i.Y)("div",{className:"font-medium text-ink",children:e.name}),(0,i.FD)("div",{className:"text-[10px] text-ink/40 truncate font-mono",children:[e.sourceRoot," · ",e.filePath]})]}),(0,i.FD)("select",{"aria-label":`${e.name} enabled`,value:e.disabled?"false":"true",onChange:()=>r(e),className:"bg-paper border border-ink/15 rounded-md px-2 py-1 text-ink",children:[(0,i.Y)("option",{value:"true",children:"enabled"}),(0,i.Y)("option",{value:"false",children:"disabled"})]})]},e.id))})]})}function nS(e){let[t,n]=(0,a.J0)(null),[r,l]=(0,a.J0)(!1),[s,o]=(0,a.J0)({}),[c,d]=(0,a.J0)({}),[p,u]=(0,a.J0)([]),[m,b]=(0,a.J0)(!0),[f,x]=(0,a.J0)(ng.tabs["0"]?.id??"model"),[g,v]=(0,a.J0)(""),[k,y]=(0,a.J0)(null),[w,N]=(0,a.J0)(new Set),[Y,D]=(0,a.J0)(new Set),[A,F]=(0,a.J0)(new Set),C=(0,a.hb)(()=>{b(!0),Promise.all([fetch("/api/omp/state").then(e=>e.json()),fetch("/api/settings/omp-config").then(e=>e.json()),fetch("/api/model-roles").then(e=>e.json()),fetch("/api/omp/extensions").then(e=>e.json())]).then(e=>{let[t,i,r,a]=e;t.running&&t.state&&n(t.state),l(!!t.running),i.entries&&o(i.entries),r.roles&&"object"==typeof r.roles&&d(r.roles),Array.isArray(a.extensions)&&u(a.extensions)}).catch(e=>console.error("Failed to load omp settings:",e)).finally(()=>b(!1))},[]);(0,a.vJ)(()=>{C()},[C]);let S=e=>{y(e),setTimeout(()=>y(t=>t===e?null:t),2e3)},T=(e,t,n)=>{D(t=>{let n=new Set(t);return n.delete(e),n}),N(t=>{let n=new Set(t);return n.delete(e),n}),t?(F(t=>{let n=new Set(t);return n.delete(e),n}),void 0!==n&&o(t=>({...t,[e]:{...t[e],value:n}})),S(e)):F(t=>new Set(t).add(e))},M=(0,a.hb)(async(e,t)=>{D(t=>new Set(t).add(e)),N(t=>{let n=new Set(t);return n.delete(e),n});try{let n=await fetch("/api/settings/omp-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:e,value:t})}),i=await n.json(),r=!!i.success;return T(e,r,i.value),r}catch(t){return console.error("Failed to save omp config:",t),T(e,!1),!1}},[]),z=(0,a.hb)(async e=>{D(t=>new Set(t).add(e));try{let t=await fetch("/api/settings/omp-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:e,action:"reset"})}),n=await t.json(),i=!!n.success;return T(e,i,n.value),i}catch(t){return console.error("Failed to reset omp config:",t),T(e,!1),!1}},[]),P=(0,a.hb)((e,t)=>{N(n=>{let i=new Set(n);return t?i.add(e):i.delete(e),i})},[]);return m?(0,i.Y)("div",{className:"flex items-center justify-center p-8 text-ink/40 text-xs",children:"Loading OMP settings..."}):(0,i.FD)("div",{className:"w-full space-y-4 text-ink pb-2 text-xs",children:[(0,i.FD)("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 pb-3 border-b border-ink/10",children:[(0,i.FD)("div",{children:[(0,i.Y)("h2",{className:"text-sm font-semibold text-ink",children:"OMP Engine"}),(0,i.Y)("p",{className:"text-ink/50 mt-0.5",children:"Live agent state and the full native config schema from oh-my-pi."})]}),(0,i.FD)("div",{className:"flex items-center gap-2",children:[(0,i.FD)("div",{className:"relative",children:[(0,i.Y)(_.A,{size:12,className:"absolute left-2 top-1/2 -translate-y-1/2 text-ink/40 pointer-events-none"}),(0,i.Y)("input",{"aria-label":"Search settings",type:"text",value:g,onChange:e=>v(e.currentTarget.value),placeholder:"Search settings…",className:"w-44 bg-paper border border-ink/15 rounded-md pl-6 pr-6 py-1 text-ink placeholder:text-ink/40"}),g&&(0,i.Y)("button",{type:"button","aria-label":"Clear search",onClick:()=>v(""),className:"absolute right-1.5 top-1/2 -translate-y-1/2 text-ink/40 hover:text-ink cursor-pointer",children:(0,i.Y)(h.A,{size:11})})]}),(0,i.FD)("button",{type:"button",onClick:C,className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border border-ink/15 text-ink/70 hover:text-ink hover:bg-ink/5 transition-all cursor-pointer",children:[(0,i.Y)(U.A,{size:12})," Refresh"]})]})]}),(0,i.FD)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2",children:[(0,i.FD)("div",{className:"rounded-lg border border-ink/10 bg-ink/[0.03] px-3 py-2",children:[(0,i.Y)("div",{className:"text-[10px] uppercase tracking-wide text-ink/40",children:"Engine"}),(0,i.Y)("div",{className:"font-semibold text-ink mt-0.5",children:r?"Running":"Idle"})]}),(0,i.FD)("div",{className:"rounded-lg border border-ink/10 bg-ink/[0.03] px-3 py-2",children:[(0,i.Y)("div",{className:"text-[10px] uppercase tracking-wide text-ink/40",children:"Model"}),(0,i.Y)("div",{className:"font-semibold text-ink mt-0.5 truncate",children:t?.model?.id??"—"})]}),(0,i.FD)("div",{className:"rounded-lg border border-ink/10 bg-ink/[0.03] px-3 py-2",children:[(0,i.Y)("div",{className:"text-[10px] uppercase tracking-wide text-ink/40",children:"Thinking"}),(0,i.Y)("div",{className:"font-semibold text-ink mt-0.5",children:t?.thinkingLevel??"—"})]}),(0,i.FD)("div",{className:"rounded-lg border border-ink/10 bg-ink/[0.03] px-3 py-2",children:[(0,i.Y)("div",{className:"text-[10px] uppercase tracking-wide text-ink/40",children:"Context"}),(0,i.Y)("div",{className:"font-semibold text-ink mt-0.5",children:t?.contextUsage?.percent!=null?`${t.contextUsage.percent.toFixed(1)}%`:"—"})]})]}),(0,i.FD)("div",{className:"pt-1",children:[(0,i.FD)("div",{className:"flex items-center justify-between pb-2",children:[(0,i.FD)("div",{children:[(0,i.Y)("h3",{className:"text-sm font-semibold text-ink",children:"Config"}),(0,i.FD)("p",{className:"text-ink/50 mt-0.5",children:["Schema-driven settings backed by ",(0,i.Y)("span",{className:"font-mono",children:"omp config"}),".",g.trim()&&" — matching keys only"]})]}),k&&!k.startsWith("role-")&&!k.startsWith("ext-")&&(0,i.FD)("span",{className:"inline-flex items-center gap-1 text-[10px] text-ink/60",children:["saved ",k]})]}),(0,i.Y)(nY,{tabs:ng.tabs,entries:s,activeTabId:f,onSelectTab:x,searchQuery:g,dirtyKeys:w,savingKeys:Y,saveErrors:A,onCommit:M,onReset:z,onDirty:P})]}),(0,i.Y)(nF,{modelRoles:c,onSaveRole:(e,t)=>{let n={...c};t.trim()?n[e]=t.trim():delete n[e],d(n),fetch("/api/model-roles",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({roles:n})}).then(e=>e.json()).then(t=>{t.success&&S(`role-${e}`)}).catch(e=>console.error("Failed to save model roles:",e))},savedRole:k?.startsWith("role-")?k.slice(5):null}),(0,i.Y)(nC,{extensions:p,savedExtension:k?.startsWith("ext-")?k.slice(4):null,onToggle:e=>{fetch("/api/omp/extensions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e.id,disabled:!e.disabled})}).then(e=>e.json()).then(t=>{t.success&&(u(t=>t.map(t=>t.id===e.id?{...t,disabled:!e.disabled}:t)),S(`ext-${e.id}`))}).catch(e=>console.error("Failed to toggle extension:",e))}})]})}var nT=n("nj");function nM(e){let{activeMetrics:t}=e;return(0,i.FD)("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-2.5 items-stretch",children:[(0,i.Y)(nT.h,{value:t.processedTokens,label:"Processed tokens",hint:t.activeRate}),(0,i.Y)(nT.h,{value:t.cachedInput,label:"Cached input",hint:t.cachedPercent}),(0,i.Y)(nT.h,{value:t.uncachedInput,label:"Uncached input",hint:"0 cache writes"}),(0,i.Y)(nT.h,{value:t.outputTokens,label:"Output",hint:t.reasoning}),(0,i.Y)(nT.h,{value:t.cacheSavings,label:"Cache savings",hint:"0.0x the raw token cost",tone:"muted",className:"col-span-2 sm:col-span-1"})]})}let nz={daily:"DAY",weekly:"WEEK",monthly:"MONTH"};function nP(e){let{breakdownTab:t,setBreakdownTab:n,activeBreakdownRows:r,activeMetrics:a,cadence:l}=e;return(0,i.FD)("div",{className:"grid grid-cols-1 xl:grid-cols-3 gap-3",children:[(0,i.FD)("div",{className:"bg-paper border border-ink/15 rounded-lg p-3.5 shadow-xs xl:col-span-2",children:[(0,i.FD)("div",{className:"flex justify-between items-center mb-3",children:[(0,i.Y)("span",{className:"font-semibold text-xs text-ink",children:"Breakdown"}),(0,i.FD)("div",{className:"flex bg-ink/5 rounded p-0.5",children:[(0,i.Y)("button",{onClick:()=>n("model"),className:`px-2 py-0.5 rounded text-[9px] font-bold tracking-wider transition-colors ${"model"===t?"bg-paper shadow-xs text-ink":"text-ink/50 hover:text-ink"}`,children:"MODEL"}),(0,i.Y)("button",{onClick:()=>n("day"),className:`px-2 py-0.5 rounded text-[9px] font-bold tracking-wider transition-colors ${"day"===t?"bg-paper shadow-xs text-ink":"text-ink/50 hover:text-ink"}`,children:nz[l]}),(0,i.Y)("button",{onClick:()=>n("project"),className:`px-2 py-0.5 rounded text-[9px] font-bold tracking-wider transition-colors ${"project"===t?"bg-paper shadow-xs text-ink":"text-ink/50 hover:text-ink"}`,children:"PROJECT"})]})]}),(0,i.Y)("div",{className:"overflow-x-auto",children:(0,i.FD)("table",{className:"w-full text-[11px]",children:[(0,i.Y)("thead",{children:(0,i.FD)("tr",{className:"text-ink/40 border-b border-ink/10",children:[(0,i.Y)("th",{className:"font-medium text-left pb-2 capitalize",children:"day"===t?nz[l].toLowerCase():t}),(0,i.Y)("th",{className:"font-medium text-right pb-2",children:"Cost"}),(0,i.Y)("th",{className:"font-medium text-right pb-2",children:"Share"}),(0,i.Y)("th",{className:"font-medium text-right pb-2",children:"Tokens"})]})}),(0,i.Y)("tbody",{className:"divide-y divide-ink/5",children:r.map(e=>(0,i.FD)("tr",{children:[(0,i.FD)("td",{className:"py-2.5 flex items-center gap-2",children:[(0,i.Y)("div",{className:`w-1.5 h-1.5 rounded-full ${e.dotColorClass}`}),(0,i.Y)("span",{className:"font-semibold text-ink whitespace-nowrap",children:e.name})]}),(0,i.Y)("td",{className:"py-2.5 text-right font-bold text-ink",children:e.cost}),(0,i.Y)("td",{className:"py-2.5 text-right text-ink/60",children:e.share}),(0,i.Y)("td",{className:"py-2.5 text-right text-ink/60",children:e.tokens})]},e.name))})]})}),(0,i.Y)("div",{className:"h-1.5 w-full bg-ink/5 rounded-full mt-3 overflow-hidden flex",children:r.map((e,t)=>(0,i.Y)("div",{className:`h-full ${0===t?"bg-ink/80":1===t?"bg-ink/45 border-l border-paper":"bg-ink/20 border-l border-paper"}`,style:{width:`${e.sharePercent}%`}},e.name))})]}),(0,i.FD)("div",{className:"bg-paper border border-ink/15 rounded-lg p-3.5 shadow-xs xl:col-span-1",children:[(0,i.Y)("div",{className:"font-semibold text-xs mb-3 text-ink",children:"Cost quality"}),(0,i.FD)("div",{className:"space-y-2 text-[11px]",children:[(0,i.FD)("div",{className:"flex justify-between items-center",children:[(0,i.Y)("span",{className:"text-ink/60",children:"Provider reported"}),(0,i.Y)("span",{className:"font-semibold text-ink",children:"100.0%"})]}),(0,i.FD)("div",{className:"flex justify-between items-center",children:[(0,i.Y)("span",{className:"text-ink/60",children:"Model priced"}),(0,i.Y)("span",{className:"font-semibold text-ink",children:"0.0%"})]}),(0,i.FD)("div",{className:"flex justify-between items-center",children:[(0,i.Y)("span",{className:"text-ink/60",children:"Unpriced"}),(0,i.Y)("span",{className:"font-semibold text-ink",children:"0.0%"})]})]}),(0,i.Y)("div",{className:"border-t border-ink/10 mt-3 pt-2.5",children:(0,i.FD)("div",{className:"flex justify-between items-center text-[11px]",children:[(0,i.Y)("span",{className:"text-ink/60",children:"Cache savings"}),(0,i.Y)("span",{className:"font-semibold text-ink",children:a.cacheSavings})]})})]})]})}function nL(e){let{cadence:t,metric:n,series:r}=e,a=r.map(e=>"cost"===n?e.cost:e.tokens),l=a.length>0?Math.max(...a):0,s=function(e,t,n){if(0===e.length)return"";if(1===e.length)return"M0,98 L100,98";let i=n>0?n:1;return e.map((n,r)=>{let a=r/(e.length-1)*100,l=98-t[r]/i*94;return`${0===r?"M":"L"}${a.toFixed(2)},${l.toFixed(2)}`}).join(" ")}(r,a,l),o="cost"===n?ta(l)||"$0.00":tr(l)??"0",c="cost"===n?ta(l/2)||"$0.00":tr(l/2)??"0",d=r[0]?.label??"",p=r.length>2?r[Math.floor(r.length/2)]?.label??"":"",u=r.length>1?r[r.length-1]?.label??"":"";return 0===r.length?(0,i.Y)("div",{className:"h-28 flex items-center justify-center text-[11px] text-ink/40",children:"No usage data in this period"}):(0,i.FD)("div",{className:"h-28 relative",children:[(0,i.FD)("div",{className:"absolute inset-0 flex flex-col justify-between pt-1 pb-4",children:[(0,i.Y)("div",{className:"border-t border-ink/5 w-full border-dashed"}),(0,i.Y)("div",{className:"border-t border-ink/5 w-full border-dashed"}),(0,i.Y)("div",{className:"border-t border-ink/15 w-full"})]}),(0,i.FD)("div",{className:"absolute left-0 top-0 bottom-4 flex flex-col justify-between text-[9px] font-mono text-ink/40 w-9",children:[(0,i.Y)("span",{children:o}),(0,i.Y)("span",{children:c}),(0,i.Y)("span",{children:"0"})]}),(0,i.Y)("div",{className:"absolute left-10 right-0 bottom-4 top-0 flex items-end",children:(0,i.Y)("svg",{className:"w-full h-full",preserveAspectRatio:"none",viewBox:"0 0 100 100",children:(0,i.Y)("path",{d:s,fill:"none",stroke:"currentColor",className:"text-ink/60 transition-all duration-300",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),(0,i.FD)("div",{className:"absolute left-10 right-0 bottom-0 h-4 flex justify-between text-[9px] text-ink/40 items-end",children:[(0,i.Y)("span",{children:d}),p&&(0,i.Y)("span",{children:p}),(0,i.Y)("span",{children:u})]}),(0,i.Y)("span",{className:"sr-only",children:`${t} ${n} trend`})]})}function nj(e){let{settings:t,onUpdate:n}=e,[r,l]=(0,a.J0)("daily"),[s,o]=(0,a.J0)("30d"),[c,d]=(0,a.J0)(!1),[p,u]=(0,a.J0)("cost"),[m,h]=(0,a.J0)("model"),[b,f]=(0,a.J0)(!1),x=new Date().toISOString().slice(0,10),g=new Date(Date.now()-2592e6).toISOString().slice(0,10),[v,k]=(0,a.J0)(g),[y,w]=(0,a.J0)(x),[N,Y]=(0,a.J0)([]),[A,F]=(0,a.J0)(null),[C,S]=(0,a.J0)([]),[T,M]=(0,a.J0)([]),z=(0,a.li)(null);(0,eM.W)(z,()=>d(!1));let P=(0,a.hb)(()=>{f(!0);let e="custom"===s?`&customFrom=${v}&customTo=${y}`:"";fetch(`/api/telemetry/tokens?timeRange=${s}&breakdownTab=${m}&cadence=${r}${e}`).then(e=>e.json()).then(e=>{e.timeRanges&&Y(e.timeRanges),e.metrics&&F(e.metrics),e.breakdownRows&&S(e.breakdownRows),e.chartSeries&&M(e.chartSeries)}).catch(e=>console.error("Failed to load token telemetry:",e)).finally(()=>f(!1))},[s,m,r,v,y]);(0,a.vJ)(()=>{P()},[P]);let L=N.find(e=>e.id===s)||N[0]||{id:s,label:s,dateRange:"Current Period"},j="custom"===s?`${v} to ${y}`:L.dateRange;return A?(0,i.FD)("div",{className:"w-full space-y-4 text-ink pb-2 text-xs",children:[(0,i.FD)("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 pb-3 border-b border-ink/10",children:[(0,i.Y)("div",{className:"flex items-center gap-2",children:(0,i.Y)("span",{className:"text-xs font-semibold text-ink/75",children:j})}),(0,i.FD)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,i.FD)("div",{className:"flex items-center bg-paper border border-ink/15 rounded-md text-[11px] font-medium overflow-hidden",children:[(0,i.Y)("button",{onClick:()=>l("daily"),className:`px-2.5 py-1 transition-colors ${"daily"===r?"bg-ink/10 text-ink font-semibold":"text-ink/65 hover:bg-ink/5 hover:text-ink"}`,children:"Daily"}),(0,i.Y)("button",{onClick:()=>l("weekly"),className:`px-2.5 py-1 transition-colors ${"weekly"===r?"bg-ink/10 text-ink font-semibold":"text-ink/65 hover:bg-ink/5 hover:text-ink"}`,children:"Weekly"}),(0,i.Y)("button",{onClick:()=>l("monthly"),className:`px-2.5 py-1 transition-colors ${"monthly"===r?"bg-ink/10 text-ink font-semibold":"text-ink/65 hover:bg-ink/5 hover:text-ink"}`,children:"Monthly"})]}),(0,i.FD)("div",{className:"relative",ref:z,children:[(0,i.FD)("button",{onClick:()=>d(!c),className:"flex items-center gap-1.5 px-2.5 py-1 bg-paper border border-ink/15 rounded-md text-[11px] font-medium hover:bg-ink/5 text-ink/80 transition-colors",children:[(0,i.Y)("span",{children:L.label}),(0,i.Y)(eT.A,{size:12,className:`transition-transform duration-150 ${c?"rotate-180":""}`})]}),c&&(0,i.FD)("div",{className:"absolute right-0 top-full mt-1 w-44 bg-paper border border-ink/15 rounded-md shadow-lg z-30 py-1 text-[11px] divide-y divide-ink/5",children:[N.map(e=>(0,i.FD)("button",{onClick:()=>{o(e.id),"custom"!==e.id&&d(!1)},className:`w-full flex items-center justify-between px-3 py-1.5 text-left hover:bg-ink/5 transition-colors ${s===e.id?"font-semibold text-ink bg-ink/5":"text-ink/70"}`,children:[(0,i.Y)("span",{children:e.label}),s===e.id&&(0,i.Y)(D.A,{size:12,className:"text-ink"})]},e.id)),"custom"===s&&(0,i.FD)("div",{className:"px-3 py-2 space-y-2",children:[(0,i.FD)("label",{className:"block",children:[(0,i.Y)("span",{className:"text-[9px] font-mono uppercase tracking-wider text-ink/40",children:"From"}),(0,i.Y)("input",{type:"date",value:v,max:y,onChange:e=>k(e.currentTarget.value),className:"mt-0.5 w-full bg-paper border border-ink/15 rounded px-1.5 py-1 text-[11px] text-ink focus:outline-none focus:border-ink/40"})]}),(0,i.FD)("label",{className:"block",children:[(0,i.Y)("span",{className:"text-[9px] font-mono uppercase tracking-wider text-ink/40",children:"To"}),(0,i.Y)("input",{type:"date",value:y,min:v,max:x,onChange:e=>w(e.currentTarget.value),className:"mt-0.5 w-full bg-paper border border-ink/15 rounded px-1.5 py-1 text-[11px] text-ink focus:outline-none focus:border-ink/40"})]}),(0,i.Y)("button",{onClick:()=>d(!1),className:"w-full bg-ink/10 hover:bg-ink/20 text-ink font-semibold rounded px-2 py-1 transition-colors",children:"Apply"})]})]})]}),(0,i.Y)("button",{onClick:()=>{P()},className:"p-1.5 bg-paper border border-ink/15 rounded-md hover:bg-ink/5 text-ink/80 transition-colors",title:"Refresh Token Telemetry",children:(0,i.Y)(U.A,{size:12,className:b?"animate-spin text-ink":""})})]})]}),(0,i.FD)("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-3",children:[(0,i.FD)("div",{className:"bg-paper border border-ink/15 rounded-lg p-3.5 shadow-xs flex flex-col justify-between",children:[(0,i.FD)("div",{children:[(0,i.Y)("div",{className:"text-[10px] font-mono font-semibold text-ink/40 tracking-wider uppercase mb-2",children:"USAGECONFIG.RAWTOKENCOST"}),(0,i.FD)("div",{className:"flex items-baseline gap-1 mb-0.5",children:[(0,i.Y)("span",{className:"text-2xl font-bold tracking-tight text-ink",children:A.rawCost}),(0,i.Y)("span",{className:"text-xs font-semibold text-ink/50",children:"*"})]}),(0,i.Y)("p",{className:"text-[11px] text-ink/50 mb-4",children:"* if billed at full API rate"})]}),(0,i.FD)("div",{children:[(0,i.Y)("div",{className:"h-1.5 w-full bg-ink/10 rounded-full mb-2 overflow-hidden flex",children:(0,i.Y)("div",{className:"h-full bg-ink/80 rounded-full",style:{width:"100%"}})}),(0,i.FD)("div",{className:"flex items-center justify-between text-[11px]",children:[(0,i.FD)("div",{className:"flex items-center gap-1.5",children:[(0,i.Y)("div",{className:"w-2 h-2 rounded-full bg-ink/80"}),(0,i.Y)("span",{className:"font-semibold text-ink",children:"DeepSeek"})]}),(0,i.FD)("div",{className:"flex items-center gap-3 text-ink/70",children:[(0,i.Y)("span",{className:"font-bold text-ink",children:A.rawCost}),(0,i.Y)("span",{children:"100.0% share"}),(0,i.Y)("span",{children:A.processedTokens})]})]})]})]}),(0,i.FD)("div",{className:"bg-paper border border-ink/15 rounded-lg p-3.5 shadow-xs flex flex-col",children:[(0,i.FD)("div",{className:"flex justify-between items-start mb-3",children:[(0,i.FD)("div",{className:"flex items-center gap-2",children:[(0,i.FD)("span",{className:"font-semibold text-xs text-ink capitalize",children:[r," ",p]}),(0,i.FD)("div",{className:"flex items-center gap-1",children:[(0,i.Y)("div",{className:"w-1.5 h-1.5 rounded-full bg-ink/80"}),(0,i.Y)("span",{className:"text-[11px] text-ink/60",children:"DeepSeek"})]})]}),(0,i.FD)("div",{className:"flex bg-ink/5 rounded p-0.5",children:[(0,i.Y)("button",{onClick:()=>u("cost"),className:`px-2 py-0.5 rounded text-[9px] font-bold tracking-wider transition-colors ${"cost"===p?"bg-paper shadow-xs text-ink":"text-ink/50 hover:text-ink"}`,children:"COST"}),(0,i.Y)("button",{onClick:()=>u("tokens"),className:`px-2 py-0.5 rounded text-[9px] font-bold tracking-wider transition-colors ${"tokens"===p?"bg-paper shadow-xs text-ink":"text-ink/50 hover:text-ink"}`,children:"TOKENS"})]})]}),(0,i.Y)(nL,{cadence:r,metric:p,series:T})]})]}),(0,i.Y)(nM,{activeMetrics:A}),(0,i.Y)(nP,{breakdownTab:m,setBreakdownTab:h,activeBreakdownRows:C,activeMetrics:A,cadence:r}),(0,i.FD)("div",{className:"text-center text-[10px] text-ink/40 pt-2",children:["Scanned ",A.scannedTranscripts," transcripts (1 outside the window) · ",A.usageRecords," usage records · 0.1s"]})]}):(0,i.Y)("div",{className:"flex items-center justify-center p-8 text-ink/40 text-xs",children:"Loading token usage telemetry..."})}var nR=n("hm");function nI(e){let{report:t,selectedProviderId:n,onSelectProvider:r}=e,a=(0,nR.T)(t);return(0,i.FD)("div",{className:"w-56 sm:w-64 border-r border-ink/10 h-full flex flex-col bg-paper/50 flex-shrink-0 select-none",children:[(0,i.Y)("div",{className:"px-3.5 py-2.5 border-b border-ink/10 flex items-center justify-between",children:(0,i.FD)("span",{className:"text-xs font-semibold text-ink",children:["Total ",a.length," providers"]})}),(0,i.Y)("div",{className:"flex-1 scrollbar-overlay-container scrollbar-overlay-static p-1.5 space-y-3 text-xs",children:(0,i.FD)("div",{children:[(0,i.Y)("div",{className:"px-2.5 pt-1.5 pb-1 text-[10px] font-bold text-ink/50 uppercase tracking-wider",children:"Providers"}),(0,i.Y)("div",{className:"space-y-0.5",children:a.map(e=>{let t=e.id===n,a=e.configured&&!e.error,l="kenari"===e.id?P.A:I.A;return(0,i.FD)("button",{type:"button",onClick:()=>r(e.id),className:`w-full text-left px-2.5 py-2 rounded-lg transition-colors cursor-pointer flex flex-col gap-0.5 group ${t?"bg-ink/10 text-ink font-medium shadow-2xs":"text-ink/80 hover:bg-ink/5 hover:text-ink"}`,children:[(0,i.FD)("div",{className:"flex items-center justify-between gap-1.5",children:[(0,i.FD)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,i.FD)("div",{className:"relative",children:[(0,i.Y)(l,{className:`w-3.5 h-3.5 flex-shrink-0 ${t?"text-ink/80":"text-ink/60"}`}),(0,i.Y)("span",{className:`absolute -top-0.5 -right-0.5 w-1.5 h-1.5 rounded-full ${a?"bg-ink":"bg-ink/20"}`})]}),(0,i.Y)("span",{className:"font-semibold text-xs text-ink truncate",children:e.name})]}),(0,i.Y)("span",{className:`text-[10px] font-mono uppercase px-1.5 py-0.5 rounded bg-ink/10 font-medium ${e.error?"text-error":"text-ink/70"}`,children:(0,nR.R)(e)})]}),(0,i.Y)("p",{className:"text-[11px] text-ink/60 line-clamp-1 leading-snug pl-5",children:e.hint})]},e.id)})})]})})]})}var nE=n("M"),n$=n("TW"),nO=n("uY");function nJ(){let{report:e,isLoading:t,error:n,reload:r}=(0,nO.N)(),[l,s]=(0,a.J0)("kenari");return n&&!e?(0,i.FD)("div",{className:"flex h-full w-full flex-col items-center justify-center gap-2 p-8 text-center text-xs",children:[(0,i.Y)(e7.A,{size:16,className:"text-error"}),(0,i.Y)("p",{className:"text-error text-xs",children:n}),(0,i.Y)("button",{type:"button",onClick:()=>r(),className:"text-[11px] font-semibold text-ink/70 hover:text-ink underline underline-offset-2",children:"Try again"})]}):e?(0,i.FD)("div",{className:"flex h-full w-full overflow-hidden bg-paper text-xs text-ink",children:[(0,i.Y)(nI,{report:e,selectedProviderId:l,onSelectProvider:s}),(0,i.FD)("div",{className:"flex-1 h-full overflow-hidden flex flex-col",children:[(0,i.FD)("div",{className:"px-3.5 py-2.5 border-b border-ink/10 flex items-center justify-between gap-3 flex-shrink-0",children:[(0,i.FD)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,i.FD)("span",{className:"text-xs font-semibold text-ink/75 truncate",children:["Updated ",(0,n$.r6)(e.generatedAt)]}),e.isMock&&(0,i.Y)("span",{className:"text-[10px] font-mono uppercase tracking-wider bg-ink/5 border border-ink/15 rounded px-1.5 py-0.5 text-ink/60",children:"Mock"})]}),(0,i.Y)("button",{type:"button",onClick:()=>r(),disabled:t,className:"p-1.5 bg-paper border border-ink/15 rounded-md hover:bg-ink/5 text-ink/80 transition-colors disabled:opacity-50 flex-shrink-0",title:"Refresh usage",children:(0,i.Y)(U.A,{size:12,className:t?"animate-spin text-ink":""})})]}),(0,i.FD)("div",{className:"flex-1 overflow-y-auto scrollbar-overlay-container scrollbar-overlay-static p-3.5 space-y-4",children:[n&&(0,i.Y)("p",{className:"text-error text-xs",children:n}),(0,i.Y)(nE.H,{providerId:l,report:e})]})]})]}):(0,i.Y)("div",{className:"flex h-full w-full items-center justify-center text-ink/40 text-xs",children:"Loading provider usage..."})}var n_=n("BJ"),nU=n("BL");function nK(){if("u">typeof window)try{let e=window.AudioContext||window.webkitAudioContext;if(!e)return;let t=new e;"suspended"===t.state&&t.resume();let n=t.currentTime,i=t.createOscillator(),r=t.createGain();i.type="sine",i.frequency.setValueAtTime(587.33,n),i.frequency.exponentialRampToValueAtTime(880,n+.1),r.gain.setValueAtTime(0,n),r.gain.linearRampToValueAtTime(.14,n+.02),r.gain.exponentialRampToValueAtTime(1e-4,n+.32),i.connect(r),r.connect(t.destination),i.start(n),i.stop(n+.32);let a=t.createOscillator(),l=t.createGain();a.type="sine",a.frequency.setValueAtTime(880,n+.06),a.frequency.exponentialRampToValueAtTime(1174.66,n+.18),l.gain.setValueAtTime(0,n+.06),l.gain.linearRampToValueAtTime(.1,n+.08),l.gain.exponentialRampToValueAtTime(1e-4,n+.42),a.connect(l),l.connect(t.destination),a.start(n+.06),a.stop(n+.42),setTimeout(()=>{try{t.close()}catch{}},550)}catch(e){console.warn("Unable to play notification audio chime:",e)}}function nB(e){(function(e){if("u"<typeof window)return!0;let t=(0,A.BF)(["chatCompletionSound","soundAlerts"],e);return void 0===t||!!t})(e)&&nK()}function nW(e){let{settings:t,onUpdate:n}=e,[r,l]=(0,a.J0)(!1),s=t.chatCompletionSound??t.soundAlerts??!0;return(0,i.Y)("div",{className:"w-full space-y-6 text-xs text-ink",children:(0,i.FD)("div",{className:"bg-paper border border-ink/15 rounded-lg p-4 shadow-xs space-y-4",children:[(0,i.FD)("div",{className:"flex items-start justify-between gap-4",children:[(0,i.FD)("div",{className:"flex items-start gap-3",children:[(0,i.Y)("div",{className:"w-8 h-8 rounded-md bg-ink/5 border border-ink/10 flex items-center justify-center flex-shrink-0 mt-0.5",children:s?(0,i.Y)(n_.A,{size:16,className:"text-ink"}):(0,i.Y)(nU.A,{size:16,className:"text-ink/40"})}),(0,i.FD)("div",{children:[(0,i.FD)("div",{className:"text-sm font-semibold text-ink flex items-center gap-2",children:[(0,i.Y)("span",{children:"AI Response Completion Sound"}),(0,i.Y)("span",{className:"text-[10px] uppercase font-mono px-1.5 py-0.5 rounded bg-ink/10 text-ink/80 font-bold",children:"Audio Chime"})]}),(0,i.Y)("p",{className:"text-ink/65 text-[11px] mt-1 leading-relaxed",children:"Play an audible notification chime when the AI completes generating its response, thinking blocks, or diagnostic execution."})]})]}),(0,i.Y)("button",{type:"button",role:"switch","aria-checked":s,onClick:()=>{let e=!s;n({chatCompletionSound:e,soundAlerts:e}),e&&nK()},className:`relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none ${s?"bg-ink":"bg-ink/20"}`,children:(0,i.Y)("span",{"aria-hidden":"true",className:`pointer-events-none inline-block h-5 w-5 transform rounded-full bg-paper shadow ring-0 transition duration-200 ease-in-out ${s?"translate-x-5":"translate-x-0"}`})})]}),(0,i.FD)("div",{className:"pt-3 border-t border-ink/10 flex items-center justify-between",children:[(0,i.FD)("span",{className:"text-[11px] text-ink/60 flex items-center gap-1.5",children:[(0,i.Y)(eS.A,{size:13,className:"text-ink/60"}),"Warm harmonic chime synthesized natively via Web Audio"]}),(0,i.FD)("button",{type:"button",onClick:()=>{l(!0),nK(),setTimeout(()=>l(!1),600)},className:`px-3 py-1.5 rounded-md border border-ink/20 bg-paper hover:bg-ink/5 text-ink font-medium text-[11px] flex items-center gap-1.5 transition-all shadow-xs active:scale-95 ${r?"border-ink bg-ink/10":""}`,children:[(0,i.Y)(n_.A,{size:13,className:r?"animate-bounce text-ink":"text-ink/70"}),(0,i.Y)("span",{children:r?"Playing...":"Test Sound"})]})]})]})})}let nH={binaryPath:"/Users/you/.bun/bin/omp",showUpdateNotifications:!0,agentControlTool:!0,ompChamberWebTool:!0,theme:"paper",fontSize:"standard",editorFont:"JetBrains Mono",streamResponses:!0,streamTransport:"websocket",expandedThinking:!0,detailedToolCalls:!1,notificationsEnabled:!0,buildFailureAlert:!0,soundAlerts:!0,chatCompletionSound:!0,defaultWorkspacePath:"~/Projects/ompchamber",tunnelEnabled:!0,tunnelSubdomain:"omp-dev-preview",activeProvider:"claude",autoApproveSafeCmds:!0,autoPatchErrors:!0,followUpBehavior:"queue",keybindingSend:"Enter",keybindingNewLine:"Shift + Enter",keybindingSteering:"Ctrl / Cmd + Enter"};function nq(e){let{isOpen:t,onClose:n,initialCategory:r="appearance",appSettings:l={},autoOpenAddProvider:s=!1}=e,[o,c]=(0,a.J0)(r),[d,p]=(0,a.J0)(s),[u,m]=(0,a.J0)(""),[b,f]=(0,a.J0)(!1),[x,g]=(0,a.J0)(!1),[v,k]=(0,a.J0)(null),y=(0,F.g)(),[w,N]=(0,a.J0)(()=>(0,A.cm)(nH,l));(0,a.vJ)(()=>{t&&(c(r),p(s),g(!1),m(""))},[t,r,s]),(0,C.sY)("omp:open-settings",e=>{e.detail?.category&&c(e.detail.category),e.detail?.autoOpenAdd&&p(!0)});let S=e=>{N(t=>{let n="function"==typeof e?e(t):{...t,...e};return"u">typeof document&&n.theme&&(document.documentElement.dataset.theme=n.theme),y(n),n}),k("Setting was saved"),setTimeout(()=>k(null),3e3)},T=()=>{f(!0),setTimeout(()=>{f(!1)},1200)};if(!t)return null;let M=K.find(e=>e.id===o)||K["0"];return(0,i.Y)("div",{className:"fixed inset-0 bg-ink/40 backdrop-blur-[2px] z-50 flex items-center justify-center p-0 md:p-6 animate-in fade-in duration-150",onClick:n,children:(0,i.FD)("div",{className:"relative bg-paper border border-ink/15 md:rounded-2xl shadow-2xl w-full h-full md:max-w-4xl lg:max-w-5xl xl:max-w-[1150px] md:h-[782px] md:max-h-[92vh] flex flex-col md:flex-row overflow-hidden text-ink",onClick:e=>e.stopPropagation(),children:[(0,i.Y)("div",{className:"hidden md:flex w-64 flex-shrink-0 h-full",children:(0,i.Y)(B,{activeCategory:o,onSelectCategory:e=>c(e),searchQuery:u,onSearchChange:m,onReloadOmpEngine:T,isReloading:b,className:"w-full"})}),(0,i.FD)("div",{className:`flex-1 flex-col h-full bg-paper overflow-hidden ${x?"flex":"hidden md:flex"}`,children:[(0,i.FD)("div",{className:"h-16 px-6 border-b border-ink/10 flex items-center justify-between flex-shrink-0 bg-paper",children:[(0,i.FD)("div",{className:"flex items-center space-x-3 min-w-0",children:[(0,i.Y)("button",{type:"button",onClick:()=>g(!1),className:"md:hidden p-1.5 -ml-2 rounded-lg hover:bg-ink/5 active:bg-ink/10 text-ink","aria-label":"Back to categories",children:(0,i.Y)(Y.A,{size:20})}),(0,i.FD)("div",{className:"truncate",children:[(0,i.Y)("h3",{className:"font-semibold text-base tracking-tight text-ink leading-tight",children:M.label}),(0,i.Y)("p",{className:"text-[11px] text-ink/60 truncate hidden sm:block",children:M.description})]})]}),(0,i.Y)("button",{type:"button",onClick:n,className:"p-1.5 rounded-lg text-ink/50 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer","aria-label":"Close settings",children:(0,i.Y)(h.A,{size:18,strokeWidth:2.2})})]}),(0,i.Y)("div",{className:`flex-1 scrollbar-overlay-container scrollbar-overlay-static w-full ${["projects","providers","agents","behavior","commands","mcp","skills","skills-catalog","usage"].includes(o)?"p-0 flex flex-col":"p-6 md:p-8 flex flex-col"}`,children:(0,i.Y)("div",{className:"w-full h-full flex-1 flex flex-col",children:(()=>{switch(o){case"appearance":return(0,i.Y)(q,{settings:w,onUpdate:S});case"chats":return(0,i.Y)(el,{settings:w,onUpdate:S});case"projects":return(0,i.Y)(e_,{});case"providers":return(0,i.Y)(ty,{autoOpenAdd:d,onAddModalClose:()=>p(!1)});case"agents":return(0,i.Y)(tU,{settings:w,onUpdate:S});case"behavior":return(0,i.Y)(tQ,{});case"commands":return(0,i.Y)(t1,{settings:w,onUpdate:S});case"mcp":return(0,i.Y)(na,{settings:w,onUpdate:S});case"token-usage":return(0,i.Y)(nj,{settings:w,onUpdate:S});case"notifications":return(0,i.Y)(nW,{settings:w,onUpdate:S});case"skills":return(0,i.Y)(nd,{settings:w,onUpdate:S,onNavigateToCatalog:()=>c("skills-catalog")});case"skills-catalog":return(0,i.Y)(nf,{});case"omp":return(0,i.Y)(nS,{settings:w,onUpdate:S});case"usage":return(0,i.Y)(nJ,{});default:return(0,i.Y)(nx,{category:o})}})()})})]}),(0,i.FD)("div",{className:`flex-1 flex-col h-full bg-canvas md:hidden ${x?"hidden":"flex"}`,children:[(0,i.FD)("div",{className:"h-14 px-4 border-b border-ink/10 flex items-center justify-between flex-shrink-0 bg-canvas",children:[(0,i.Y)("span",{className:"font-bold text-sm tracking-tight text-ink",children:"Settings"}),(0,i.Y)("button",{type:"button",onClick:n,className:"p-1.5 rounded-lg text-ink/50 hover:text-ink","aria-label":"Close",children:(0,i.Y)(h.A,{size:18})})]}),(0,i.Y)("div",{className:"flex-1 overflow-hidden",children:(0,i.Y)(B,{activeCategory:o,onSelectCategory:e=>{c(e),g(!0)},searchQuery:u,onSearchChange:m,onReloadOmpEngine:T,isReloading:b,className:"w-full border-r-0"})})]}),v&&(0,i.FD)("div",{className:"absolute bottom-6 left-1/2 transform -translate-x-1/2 bg-ink text-canvas px-4 py-2 rounded-lg text-xs font-semibold shadow-lg animate-in fade-in slide-in-from-bottom-2 z-50 flex items-center space-x-2",children:[(0,i.Y)(D.A,{size:14,className:"text-success"}),(0,i.Y)("span",{children:v})]})]})})}async function nG(e){let t=e?`?path=${encodeURIComponent(e)}`:"",n=await fetch(`/api/fs/browse${t}`),i=await n.json();if(!n.ok||i.error)throw Error(i.error||`HTTP ${n.status}`);return i}function nV(e){let{initialPath:t,onSelect:n,onClose:r}=e,[l,s]=(0,a.J0)(t??""),[o,c]=(0,a.J0)(""),[d,p]=(0,a.J0)([]),[u,m]=(0,a.J0)(null),[x,g]=(0,a.J0)(!0),[v,k]=(0,a.J0)(null),[y,w]=(0,a.J0)(null),N=(0,a.li)(null),Y=(0,a.hb)(async e=>{g(!0),k(null);try{let t=await nG(e);s(t.path??e??""),m(t.parentPath??null),c(t.path??e??""),p(t.directories??[])}catch(e){k(e instanceof Error?e.message:String(e))}finally{g(!1)}},[]);(0,a.vJ)(()=>{Y(t)},[t,Y]);let D=e=>{Y(e.path)};return(0,i.Y)("div",{className:"fixed inset-0 bg-ink/30 z-[60] flex items-center justify-center p-4",onClick:r,children:(0,i.FD)("div",{className:"bg-paper border border-ink/15 rounded-lg shadow-2xl w-full max-w-lg flex flex-col overflow-hidden",onClick:e=>e.stopPropagation(),children:[(0,i.FD)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-ink/10",children:[(0,i.FD)("h3",{className:"font-semibold text-sm flex items-center space-x-2",children:[(0,i.Y)(f.A,{size:15,className:"text-ink/70"}),(0,i.Y)("span",{children:"Choose Project Folder"})]}),(0,i.Y)("button",{type:"button",onClick:r,className:"p-1 rounded hover:bg-ink/10 text-ink/60 hover:text-ink transition-colors","aria-label":"Close picker",children:(0,i.Y)(h.A,{size:15})})]}),(0,i.FD)("div",{className:"px-4 py-2 border-b border-ink/10 bg-canvas/50",children:[(0,i.FD)("form",{onSubmit:e=>{e.preventDefault();let t=o.trim();t&&Y(t)},className:"flex items-center space-x-2",children:[(0,i.Y)(b.A,{size:14,className:"text-ink/40 flex-shrink-0"}),(0,i.Y)("input",{ref:N,type:"text",value:o,onChange:e=>c(e.currentTarget.value),placeholder:"~ or /absolute/path",className:"flex-1 bg-transparent outline-none text-xs font-mono text-ink placeholder-ink/30 py-1",spellcheck:!1}),(0,i.Y)("button",{type:"submit",className:"px-2 py-1 rounded bg-ink/5 border border-ink/10 text-[11px] font-medium hover:bg-ink/10 transition-colors",children:"Go"})]}),(0,i.FD)("div",{className:"flex items-center space-x-1 mt-1 text-[11px] text-ink/40 truncate",children:[(0,i.FD)("button",{type:"button",onClick:()=>void Y(),className:"hover:text-ink transition-colors flex items-center",children:[(0,i.Y)(b.A,{size:11,className:"mr-0.5"})," home"]}),l.split("/").filter(Boolean).map((e,t,n)=>{let r="/"+l.split("/").filter(Boolean).slice(0,t+1).join("/"),a=t===n.length-1;return(0,i.FD)("span",{className:"flex items-center space-x-1 min-w-0",children:[(0,i.Y)(nl.A,{size:10,className:"text-ink/20 flex-shrink-0"}),a?(0,i.Y)("span",{className:"text-ink/70 truncate",children:e}):(0,i.Y)("button",{type:"button",onClick:()=>void Y(r),className:"hover:text-ink transition-colors truncate max-w-[120px]",children:e})]},r)})]})]}),(0,i.Y)("div",{className:"flex-1 min-h-[240px] max-h-[360px] scrollbar-overlay-container scrollbar-overlay-static p-2",children:x?(0,i.Y)("div",{className:"flex items-center justify-center h-40 text-ink/40",children:(0,i.Y)(tf.A,{size:18,className:"animate-spin"})}):v?(0,i.FD)("div",{className:"flex flex-col items-center justify-center h-40 text-xs text-red-600 space-y-2 px-4",children:[(0,i.Y)("span",{children:v}),(0,i.FD)("button",{type:"button",onClick:()=>void Y(l||void 0),className:"px-2 py-1 rounded bg-ink/5 border border-ink/10 text-ink/70 hover:bg-ink/10 flex items-center space-x-1",children:[(0,i.Y)(U.A,{size:11})," Retry"]})]}):0===d.length?(0,i.Y)("div",{className:"text-center py-16 text-xs text-ink/40",children:"No subfolders"}):d.map(e=>(0,i.FD)("div",{className:`group flex items-center justify-between px-2.5 py-2 rounded cursor-pointer transition-colors ${y===e.path?"bg-ink/10":"hover:bg-ink/5"}`,onDblClick:()=>D(e),children:[(0,i.FD)("button",{type:"button",onClick:()=>D(e),className:"flex items-center space-x-2 min-w-0 flex-1 text-left",children:[(0,i.Y)(es.A,{size:15,className:"text-ink/50 flex-shrink-0"}),(0,i.Y)("span",{className:"text-xs truncate text-ink/85",children:e.name})]}),(0,i.Y)("button",{type:"button",onClick:()=>{w(e.path),n(e.path)},className:"hidden group-hover:flex px-2 py-0.5 rounded bg-ink text-canvas text-[10px] font-semibold hover:bg-ink/80 transition-colors flex-shrink-0",children:"Choose"})]},e.path))}),(0,i.FD)("div",{className:"flex items-center justify-between px-4 py-3 border-t border-ink/10",children:[(0,i.FD)("div",{className:"flex items-center space-x-2 min-w-0",children:[(0,i.FD)("button",{type:"button",onClick:()=>{u&&Y(u)},disabled:!u,className:"px-2.5 py-1.5 rounded bg-ink/5 border border-ink/10 text-[11px] font-medium hover:bg-ink/10 disabled:opacity-40 transition-colors flex items-center space-x-1",children:[(0,i.Y)("span",{children:"↑"}),(0,i.Y)("span",{children:"Up"})]}),(0,i.Y)("button",{type:"button",onClick:()=>void Y(),className:"px-2.5 py-1.5 rounded bg-ink/5 border border-ink/10 text-[11px] font-medium hover:bg-ink/10 transition-colors",children:"Home"})]}),(0,i.FD)("div",{className:"flex items-center space-x-2",children:[(0,i.Y)("button",{type:"button",onClick:r,className:"px-3 py-1.5 text-xs font-medium text-ink/60 hover:text-ink transition-colors",children:"Cancel"}),(0,i.Y)("button",{type:"button",onClick:()=>{l&&(w(l),n(l))},disabled:!l,className:"px-3.5 py-1.5 text-xs font-medium bg-ink text-canvas rounded hover:bg-ink/90 disabled:opacity-50 transition-colors",children:"Use This Folder"})]})]})]})})}var nQ="0.3.0";function nZ(){return(0,i.FD)("div",{className:"flex flex-col items-center gap-3 mt-6 pt-1",children:[(0,i.FD)("div",{className:"flex items-center justify-center gap-6",children:[(0,i.FD)("a",{href:"https://github.com",target:"_blank",rel:"noreferrer",className:"flex items-center gap-2 text-xs font-medium text-ink/75 hover:text-ink transition-colors",children:[(0,i.Y)("svg",{className:"w-4 h-4 fill-current",viewBox:"0 0 24 24",children:(0,i.Y)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.53 1.032 1.53 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z"})}),(0,i.Y)("span",{children:"GitHub"})]}),(0,i.FD)("a",{href:"https://discord.com",target:"_blank",rel:"noreferrer",className:"flex items-center gap-2 text-xs font-medium text-ink/75 hover:text-ink transition-colors",children:[(0,i.Y)("svg",{className:"w-4 h-4 fill-current",viewBox:"0 0 24 24",children:(0,i.Y)("path",{d:"M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028c.462-.63.874-1.295 1.226-1.994.021-.041.001-.09-.041-.106a13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.929 1.793 8.18 1.793 12.061 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.894.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.028zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z"})}),(0,i.Y)("span",{children:"Discord"})]})]}),(0,i.FD)("a",{href:"https://x.com",target:"_blank",rel:"noreferrer",className:"flex items-center gap-2 text-xs font-medium text-ink/75 hover:text-ink transition-colors",children:[(0,i.Y)("svg",{className:"w-3.5 h-3.5 fill-current",viewBox:"0 0 24 24",children:(0,i.Y)("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})}),(0,i.Y)("span",{children:"@ompchamber"})]})]})}let nX="inline-flex items-center gap-1.5 rounded-md border border-ink/20 px-2.5 py-1.5 text-[11px] font-medium text-ink transition-colors hover:border-ink/40 disabled:cursor-not-allowed disabled:opacity-50";function n0(e){let{target:t,info:n,applying:r,disabled:a,onApply:l}=e,s=`v${n.current??"…"} → v${n.latest??"…"}`;return(0,i.FD)("div",{className:"flex items-center justify-between gap-3 border-t border-ink/10 py-2.5 first:border-t-0",children:[(0,i.FD)("div",{className:"min-w-0",children:[(0,i.Y)("p",{className:"text-xs font-medium text-ink",children:"ompchamber"===t?"OMPChamber":"Oh-My-Pi"}),(0,i.Y)("p",{className:"font-mono text-[10px] text-ink/60",children:n.installed?s:"not detected"})]}),n.installed?(0,i.FD)("button",{type:"button",onClick:()=>l(t),disabled:a,className:nX,children:[r?(0,i.Y)(tf.A,{size:12,className:"animate-spin motion-reduce:animate-none"}):(0,i.Y)(nh.A,{size:12}),(0,i.Y)("span",{children:"Update"})]}):(0,i.Y)("span",{className:"shrink-0 text-[10px] text-ink/40",children:"not detected"})]})}function n1(e){let{updates:t,onToast:n}=e,r=t.info?[{target:"ompchamber",info:t.info.ompchamber},{target:"omp",info:t.info.omp}].filter(e=>{let{info:t}=e;return t.updateAvailable&&null!==t.latest}):[],a=async e=>{let i=await t.apply(e);if(n){if(!i)return void n("The update request could not be completed.","error");if("ompchamber"===e)return void n(i.message,i.success?"success":"error");i.success?n(`${i.message} A restart may be needed.`,"success"):n(i.message,"error")}},l=!!(t.info&&!t.checking&&!t.error);return(0,i.FD)("section",{className:"mt-5 border-y border-ink/10 py-3 text-left","aria-labelledby":"updates-heading",children:[(0,i.FD)("div",{className:"flex items-center justify-between gap-3",children:[(0,i.Y)("h3",{id:"updates-heading",className:"text-xs font-semibold text-ink",children:"Updates"}),t.info&&(0,i.Y)("span",{className:"font-mono text-[9px] text-ink/40",children:"checked"})]}),(0,i.FD)("div",{className:"mt-2.5",children:[t.checking&&(0,i.FD)("button",{type:"button",disabled:!0,className:`${nX} w-full justify-center`,children:[(0,i.Y)(tf.A,{size:13,className:"animate-spin motion-reduce:animate-none"}),(0,i.Y)("span",{children:"Checking…"})]}),t.error&&!t.checking&&(0,i.FD)("div",{className:"flex items-start gap-2",children:[(0,i.Y)(e7.A,{size:14,className:"mt-0.5 shrink-0 text-error"}),(0,i.FD)("div",{className:"min-w-0 flex-1",children:[(0,i.Y)("p",{className:"text-[11px] leading-4 text-error",children:t.error}),(0,i.FD)("button",{type:"button",onClick:()=>void t.check(),className:`${nX} mt-2`,children:[(0,i.Y)(U.A,{size:12}),(0,i.Y)("span",{children:"Retry"})]})]})]}),!t.info&&!t.checking&&!t.error&&(0,i.FD)("button",{type:"button",onClick:()=>void t.check(),className:`${nX} w-full justify-center`,children:[(0,i.Y)(U.A,{size:13}),(0,i.Y)("span",{children:"Check for updates"})]}),l&&0===r.length&&(0,i.FD)("div",{className:"flex items-center justify-between gap-3",children:[(0,i.FD)("p",{className:"flex items-center gap-1.5 text-[11px] text-success",children:[(0,i.Y)(D.A,{size:13}),(0,i.Y)("span",{children:"You're up to date"})]}),(0,i.FD)("button",{type:"button",onClick:()=>void t.check(),className:nX,children:[(0,i.Y)(U.A,{size:12}),(0,i.Y)("span",{children:"Check again"})]})]}),l&&r.length>0&&(0,i.FD)("div",{children:[r.map(e=>{let{target:n,info:r}=e;return(0,i.Y)(n0,{target:n,info:r,applying:t.applying===n,disabled:null!==t.applying,onApply:e=>void a(e)},n)}),(0,i.FD)("button",{type:"button",onClick:()=>void t.check(),disabled:null!==t.applying,className:`${nX} mt-2 w-full justify-center`,children:[(0,i.Y)(U.A,{size:12}),(0,i.Y)("span",{children:"Check again"})]})]})]})]})}function n2(e){let{isOpen:t,onClose:n,updates:r,onToast:a}=e;return t?(0,i.Y)("div",{className:"fixed inset-0 bg-ink/40 backdrop-blur-[2px] z-50 flex items-center justify-center p-4 animate-in fade-in duration-200",onClick:n,children:(0,i.FD)("div",{className:"relative bg-paper border border-ink/15 rounded-2xl shadow-2xl w-full max-w-[340px] p-6 text-center text-ink select-none",onClick:e=>e.stopPropagation(),children:[(0,i.Y)("button",{onClick:n,className:"absolute top-4 right-4 text-ink/40 hover:text-ink transition-colors p-1 rounded-md","aria-label":"Close",children:(0,i.Y)(h.A,{size:18,className:"stroke-[2.5]"})}),(0,i.Y)("div",{className:"flex justify-center pt-2 pb-1",children:(0,i.Y)("img",{src:"/icon.svg",alt:"OMPChamber",width:96,height:96,draggable:!1})}),(0,i.FD)("h2",{className:"text-xl font-bold tracking-tight mt-3 flex items-center justify-center",children:[(0,i.Y)("span",{className:"text-transparent bg-clip-text bg-gradient-to-r from-orange-600 to-amber-500 font-extrabold text-2xl tracking-tighter",children:"OMP"}),(0,i.Y)("span",{className:"text-ink text-2xl font-bold ml-[1px]",children:"Chamber"})]}),(0,i.FD)("div",{className:"text-xs text-ink/60 space-y-1 mt-1.5 font-mono",children:[(0,i.FD)("p",{children:["OMPChamber v",nQ]}),(0,i.FD)("p",{children:["Oh-My-Pi ",r.info?.omp.current??"…"]})]}),(0,i.Y)(n1,{updates:r,onToast:a}),(0,i.Y)(nZ,{}),(0,i.Y)("p",{className:"text-[11px] text-ink/50 font-normal mt-8",children:"Made with love for the community"})]})}):null}function n5(e){let{isOpen:t,onClose:n,onCreate:r}=e,[l,s]=(0,a.J0)(""),[o,c]=(0,a.J0)(""),[d,p]=(0,a.J0)(!1),[u,m]=(0,a.J0)(null),[x,g]=(0,a.J0)(!1);if((0,a.vJ)(()=>{t&&(s(""),c(""),p(!1),m(null),g(!1))},[t]),!t)return null;let v=async()=>{if(!r)return void n();if(!l.trim()&&!o.trim())return void m("Enter a name or a project path.");p(!0),m(null);try{await r({name:l.trim(),path:o.trim()||void 0}),n()}catch(e){m(e instanceof Error?e.message:String(e)),p(!1)}};return(0,i.FD)("div",{className:"fixed inset-0 bg-ink/20 z-50 flex items-center justify-center",children:[(0,i.FD)("div",{className:"bg-paper border border-ink/10 rounded-lg shadow-xl w-96 p-4 flex flex-col",children:[(0,i.FD)("div",{className:"flex justify-between items-center mb-4 border-b border-ink/10 pb-2",children:[(0,i.Y)("h3",{className:"font-semibold text-sm",children:"New Workspace"}),(0,i.Y)(h.A,{size:14,className:"cursor-pointer hover:text-ink/60",onClick:n})]}),(0,i.FD)("div",{className:"text-sm text-ink/80 py-2 space-y-3",children:[(0,i.FD)("div",{children:[(0,i.Y)("label",{className:"block text-xs font-semibold mb-1 text-ink",children:"Workspace Name"}),(0,i.Y)("input",{type:"text",value:l,onChange:e=>s(e.currentTarget.value),placeholder:"e.g. bofis-pro",className:"w-full bg-paper border border-ink/20 rounded px-3 py-2 outline-none focus:border-ink/50 text-sm"})]}),(0,i.FD)("div",{children:[(0,i.FD)("label",{className:"block text-xs font-semibold mb-1 text-ink",children:["Project Path ",(0,i.Y)("span",{className:"text-ink/40 font-normal",children:"(optional — binds omp sessions)"})]}),(0,i.FD)("div",{className:"flex items-center space-x-2",children:[(0,i.FD)("div",{className:"flex-1 flex items-center bg-paper border border-ink/20 rounded overflow-hidden focus-within:border-ink/50",children:[(0,i.Y)("div",{className:"px-2 text-ink/40 bg-ink/5 h-full flex items-center border-r border-ink/10",children:(0,i.Y)(b.A,{size:14})}),(0,i.Y)("input",{type:"text",value:o,onChange:e=>c(e.currentTarget.value),placeholder:"~/projects/my-project",className:"w-full px-3 py-2 outline-none text-sm bg-transparent"})]}),(0,i.FD)("button",{type:"button",onClick:()=>g(!0),className:"px-3 py-2 bg-ink/5 border border-ink/10 rounded text-xs font-medium hover:bg-ink/10 transition-colors flex items-center space-x-1.5 flex-shrink-0",children:[(0,i.Y)(f.A,{size:13}),(0,i.Y)("span",{children:"Browse"})]})]})]}),u&&(0,i.Y)("div",{className:"text-xs text-red-600",children:u})]}),(0,i.FD)("div",{className:"mt-4 flex justify-end space-x-2",children:[(0,i.Y)("button",{className:"px-3 py-1.5 text-xs font-medium text-ink/60 hover:text-ink transition-colors",onClick:n,disabled:d,children:"Cancel"}),(0,i.Y)("button",{className:"px-4 py-1.5 text-xs font-medium bg-ink text-canvas rounded hover:bg-ink/90 transition-colors disabled:opacity-50",onClick:v,disabled:d,children:d?"Creating…":"Create Workspace"})]})]}),x&&(0,i.Y)(nV,{initialPath:o||void 0,onSelect:e=>{if(c(e),g(!1),!l.trim()){let t=e.replace(/[\\/]+$/,"").split(/[\\/]/).pop()||"";t&&s(t)}},onClose:()=>g(!1)})]})}function n3(e){let{isOpen:t,onClose:n}=e;return t?(0,i.Y)("div",{className:"fixed inset-0 bg-ink/20 z-50 flex items-center justify-center p-4",children:(0,i.FD)("div",{className:"bg-paper border border-ink/10 rounded-lg shadow-xl w-full max-w-2xl flex flex-col overflow-hidden",children:[(0,i.FD)("div",{className:"flex justify-between items-center p-4 border-b border-ink/10 bg-paper",children:[(0,i.FD)("div",{className:"flex items-center space-x-2 text-ink",children:[(0,i.Y)(x.A,{size:16}),(0,i.Y)("h3",{className:"font-semibold text-sm",children:"Schedule Chat / Task"})]}),(0,i.Y)(h.A,{size:16,className:"cursor-pointer hover:text-ink/60",onClick:n})]}),(0,i.Y)("div",{className:"p-4 bg-canvas",children:(0,i.FD)("div",{className:"w-full bg-paper border border-ink/20 rounded-md focus-within:border-ink transition-colors flex flex-col shadow-sm",children:[(0,i.FD)("div",{className:"flex items-center px-3 py-2 border-b border-ink/5 text-ink/60 space-x-2",children:[(0,i.Y)("button",{className:"hover:text-ink transition-colors",children:(0,i.Y)(g.A,{size:14})}),(0,i.Y)("button",{className:"hover:text-ink transition-colors",children:(0,i.Y)(v.A,{size:14})}),(0,i.Y)("button",{className:"hover:text-ink transition-colors",children:(0,i.Y)(k.A,{size:14})}),(0,i.Y)("div",{className:"flex-1"}),(0,i.FD)("div",{className:"flex items-center space-x-2 text-xs text-ink",children:[(0,i.Y)("span",{className:"font-medium",children:"Schedule:"}),(0,i.FD)("select",{className:"bg-transparent border border-ink/20 rounded px-1.5 py-0.5 outline-none focus:border-ink/50",children:[(0,i.Y)("option",{value:"once",children:"Once"}),(0,i.Y)("option",{value:"every",children:"Every"}),(0,i.Y)("option",{value:"cron",children:"Cron"})]}),(0,i.Y)("input",{type:"text",placeholder:"e.g. 5 mins, 0 0 * * *",className:"w-32 bg-transparent border border-ink/20 rounded px-2 py-0.5 outline-none focus:border-ink/50"})]})]}),(0,i.Y)("textarea",{placeholder:"Describe your scheduled task, ask a question, or paste commands...",className:"w-full bg-transparent border-none px-4 py-4 text-sm focus:outline-none resize-none text-ink placeholder-ink/40 min-h-[120px]"}),(0,i.FD)("div",{className:"flex items-center justify-between px-3 py-2 border-t border-ink/5",children:[(0,i.FD)("div",{className:"flex items-center space-x-3 text-ink/60 text-xs",children:[(0,i.FD)("div",{className:"flex items-center space-x-1 hover:text-ink cursor-pointer",children:[(0,i.Y)(y.A,{size:14}),(0,i.Y)("span",{children:"Default"})]}),(0,i.FD)("div",{className:"flex items-center space-x-1 hover:text-ink cursor-pointer",children:[(0,i.Y)(w.A,{size:14}),(0,i.Y)("span",{children:"[CMD] DeepSeek V4 Flash"})]})]}),(0,i.FD)("button",{onClick:n,className:"flex items-center justify-center space-x-1.5 px-3 py-1.5 rounded bg-ink text-canvas hover:bg-ink/80 transition-colors text-xs font-medium",children:[(0,i.Y)("span",{children:"Schedule Task"}),(0,i.Y)(N.A,{size:12,className:"ml-px"})]})]})]})})]})}):null}function n4(e){let{onNewSession:t}=e;return(0,i.FD)(i.FK,{children:[(0,i.Y)("div",{className:"h-12 flex-shrink-0 flex items-center px-4 border-b border-ink/10 titlebar-drag-region select-none",style:{paddingLeft:"max(1rem, env(titlebar-area-x, 0px))"},children:(0,i.FD)("span",{className:"font-bold text-sm tracking-tight flex items-center",children:[(0,i.Y)("span",{className:"text-transparent bg-clip-text bg-gradient-to-r from-orange-600 to-amber-500 font-extrabold text-[15px] tracking-tighter",children:"OMP"}),(0,i.Y)("span",{className:"ml-[1px]",children:"Chamber"})]})}),(0,i.Y)("div",{className:"px-3 pt-3 titlebar-no-drag",children:(0,i.FD)("button",{onClick:t,className:"w-full flex items-center justify-center space-x-2 py-2 bg-ink text-canvas rounded text-xs font-semibold hover:bg-ink/90 transition-colors cursor-pointer",children:[(0,i.Y)(g.A,{size:14}),(0,i.Y)("span",{children:"New Session"})]})})]})}var n6=n("DL"),n8=n("O6"),n7=n("p7"),n9=n("Sj"),ie=n("x");let it=["A-Z","Z-A","LATEST_SESSION","LATEST_ADDED"],ii={"A-Z":"A-Z","Z-A":"Z-A",LATEST_SESSION:"Latest Session",LATEST_ADDED:"Latest Added"};function ir(e){let{variant:t,sortOption:n,onSortChange:r}=e;return"mobile"===t?(0,i.FD)(i.FK,{children:[(0,i.Y)("div",{className:"px-2 py-1 text-[10px] uppercase font-bold text-ink/40 font-mono",children:"Sort Workspaces"}),it.map(e=>(0,i.FD)("button",{type:"button",onClick:()=>r(e),className:`w-full text-left px-2.5 py-1.5 rounded-lg flex items-center justify-between transition-colors ${n===e?"bg-ink/10 font-semibold text-ink":"hover:bg-ink/5 text-ink/80"}`,children:[(0,i.Y)("span",{children:e.replace("_"," ")}),n===e&&(0,i.Y)(D.A,{size:13,className:"text-ink"})]},e))]}):(0,i.FD)(i.FK,{children:[(0,i.Y)("div",{className:"px-3 py-1 text-[10px] uppercase font-bold text-ink/40 tracking-wider",children:"Sort Workspaces"}),it.map(e=>(0,i.FD)("div",{className:`px-3 py-1.5 text-xs cursor-pointer flex items-center justify-between ${n===e?"bg-ink/5 text-ink font-medium":"text-ink/70 hover:bg-ink/5 hover:text-ink"}`,onClick:()=>r(e),children:[(0,i.Y)("span",{children:ii[e]}),n===e&&(0,i.Y)("div",{className:"w-1.5 h-1.5 rounded-full bg-ink"})]},e))]})}function ia(e){let{isSearchVisible:t,searchQuery:n,showArchived:r,optionsOpen:a,sortOption:l,onToggleSearch:s,onSearchChange:o,onToggleArchived:c,onHideArchived:d,onToggleOptions:p,onCloseOptions:u,onSortChange:m,onNewWorkspace:b,onScheduler:f,onRefresh:x,onClose:g}=e;return(0,i.FD)("div",{className:"p-3 border-b border-ink/10 flex flex-col space-y-3",children:[(0,i.FD)("div",{className:"flex items-center justify-between px-1 text-ink/60",children:[(0,i.FD)("div",{className:"flex space-x-3 items-center",children:[(0,i.Y)(n6.A,{size:14,className:"hover:text-ink cursor-pointer",onClick:b}),(0,i.Y)(n8.A,{size:14,className:"hover:text-ink cursor-pointer",onClick:f}),(0,i.Y)("span",{title:"Refresh sessions",onClick:x,className:"inline-flex cursor-pointer",children:(0,i.Y)(U.A,{size:14,className:"hover:text-ink"})})]}),(0,i.FD)("div",{className:"flex space-x-3 items-center relative",children:[(0,i.Y)(_.A,{size:14,className:`cursor-pointer transition-colors ${t?"text-ink":"hover:text-ink"}`,onClick:s}),(0,i.Y)("span",{title:r?"Hide Archive":"Show Archive",onClick:c,className:"inline-flex cursor-pointer",children:(0,i.Y)(n7.A,{size:14,className:`transition-colors ${r?"text-ink":"hover:text-ink"}`})}),(0,i.FD)("div",{className:"relative",children:[(0,i.Y)(n9.A,{size:14,className:`cursor-pointer transition-colors ${a?"text-ink":"hover:text-ink"}`,onClick:p}),a&&(0,i.Y)("div",{className:"absolute right-0 top-full mt-2 w-48 bg-paper border border-ink/10 rounded shadow-lg z-50 py-1",onMouseLeave:u,children:(0,i.Y)(ir,{variant:"desktop",sortOption:l,onSortChange:m})})]}),(0,i.Y)(ie.A,{size:14,className:"hover:text-ink cursor-pointer ml-1",onClick:g})]})]}),t&&(0,i.Y)("div",{className:"pt-1",children:(0,i.Y)("input",{type:"text",placeholder:"Search workspaces & sessions...",value:n,onChange:e=>o(e.currentTarget.value),autoFocus:!0,className:"w-full bg-ink/5 border border-ink/10 rounded px-2.5 py-1.5 outline-none focus:border-ink/30 text-xs text-ink placeholder-ink/40 transition-colors"})}),r&&(0,i.FD)("div",{className:"flex items-center justify-between bg-amber-500/10 border border-amber-500/20 text-amber-900 rounded px-2.5 py-1.5 text-[10px] font-medium",children:[(0,i.FD)("div",{className:"flex items-center space-x-1.5",children:[(0,i.Y)(n7.A,{size:10}),(0,i.Y)("span",{children:"Showing Archived"})]}),(0,i.Y)("button",{className:"hover:text-amber-950",onClick:d,children:(0,i.Y)(h.A,{size:10})})]})]})}var il=n("vB");function is(e){let{onSettings:t,onInfo:n,updateAvailable:r,onUpdateClick:a}=e;return(0,i.FD)("div",{className:"p-3 border-t border-ink/10 flex items-center justify-between text-ink/60 shrink-0",children:[(0,i.FD)("div",{className:"flex space-x-3",children:[(0,i.Y)(il.A,{size:16,className:"hover:text-ink cursor-pointer",onClick:t}),(0,i.Y)(eC.A,{size:16,className:"hover:text-ink cursor-pointer",onClick:n})]}),r&&(0,i.Y)("button",{type:"button",onClick:a,className:"px-2 py-0.5 rounded-full border border-ink/20 text-[10px] font-semibold text-ink hover:border-ink/40",children:"update"})]})}var io=n("aC");function ic(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:7,[n,i]=(0,a.J0)(e);return{visibleCount:n,showMore:(0,a.hb)(()=>i(e=>e+t),[t])}}function id(e,t){let[n,i]=(0,a.J0)(!1),r=(0,t9.L)(),l=(0,t9.L)(),s=(0,t9.L)();return(0,a.vJ)(()=>{(r.data?.success||l.data?.success)&&window.dispatchEvent(new CustomEvent("omp:workspace-updated"))},[l.data,r.data]),{confirmDelete:n,requestDelete:()=>i(!0),cancelDelete:()=>i(!1),handlePin:()=>{"number"==typeof e.id&&(r.submit({isPinned:String(!e.isPinned)},{method:"POST",action:`/api/folders/${e.id}/pin`}),t())},handleDelete:()=>{"number"==typeof e.id&&(l.submit({},{method:"POST",action:`/api/folders/${e.id}/delete`}),i(!1),t())},handleArchive:e=>{let n=1!==e.is_archived;s.submit({archived:String(n)},{method:"POST",action:`/api/sessions/${e.id}/archive`}),t()},handleRename:async(e,n)=>{try{let t=new FormData;if(t.set("name",n),!(await fetch(`/api/sessions/${encodeURIComponent(String(e.id))}/rename`,{method:"POST",body:t})).ok)return}catch{return}window.dispatchEvent(new CustomEvent("omp:session-renamed",{detail:{sessionId:String(e.id),title:n}})),t()}}}var ip=n("b4"),iu=n("HZ");function im(e,t){let[n,i]=(0,a.J0)(!1),[r,l]=(0,a.J0)(e),s=(0,a.li)(null),o=(0,a.li)(!1);(0,a.vJ)(()=>{n&&s.current?.select()},[n]);let c=()=>{let n=r.trim();i(!1),n&&n!==e&&t?.(n)},d=()=>{o.current=!0,i(!1)};return{isEditing:n,draft:r,setDraft:l,inputRef:s,startRename:()=>{o.current=!1,l(e),i(!0)},commitRename:c,cancelRename:d,handleKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),c()):"Escape"===e.key&&(e.preventDefault(),d())},handleBlur:()=>{if(o.current){o.current=!1;return}c()}}}function ih(e){let{title:t,isActive:n=!1,isArchived:r=!1,status:a,onClick:l,onArchive:s,onRename:o,expandable:c=!1,isExpanded:d=!1,hasSubagents:p=!1,onToggleExpand:u}=e,m=!!(c&&p&&u),{isEditing:h,draft:b,setDraft:f,inputRef:x,startRename:g,handleKeyDown:v,handleBlur:k}=im(t,o);return(0,i.FD)("div",{onClick:h?void 0:l,className:`group/item relative flex items-center w-full rounded-lg px-2 py-1.5 cursor-pointer text-xs transition-colors select-none ${n?"bg-ink/10 font-medium text-ink":"text-ink/75 hover:text-ink hover:bg-ink/5"}`,children:[(0,i.FD)("span",{className:"relative w-4 h-4 shrink-0",children:[m&&u&&(0,i.Y)("button",{type:"button",onClick:e=>{e.stopPropagation(),u(e)},title:d?"Collapse subagents":"Expand subagents","aria-expanded":d,className:`peer absolute inset-0 flex items-center justify-center rounded cursor-pointer text-ink/40 transition-opacity hover:text-ink ${d?"":"pointer-events-none opacity-0 group-hover/item:pointer-events-auto group-hover/item:opacity-100 focus-visible:opacity-100"}`,children:d?(0,i.Y)(eT.A,{size:13,className:"text-ink/70"}):(0,i.Y)(nl.A,{size:13})}),a&&!(m&&d)&&(0,i.Y)("span",{className:`absolute inset-0 flex items-center justify-center text-ink/60 transition-opacity ${m?"group-hover/item:opacity-0 peer-focus-visible:opacity-0":""}`,children:"stream"===a?(0,i.Y)(tf.A,{size:12,className:"animate-spin"}):(0,i.Y)(D.A,{size:12})})]}),(0,i.Y)("span",{className:"w-2 shrink-0"}),h?(0,i.Y)("input",{ref:x,autoFocus:!0,value:b,onChange:e=>f(e.currentTarget.value),onClick:e=>e.stopPropagation(),onKeyDown:v,onBlur:k,className:"flex-1 min-w-0 bg-paper border border-ink/25 rounded px-1 py-0.5 text-xs text-ink outline-none focus:border-ink/50"}):(0,i.Y)("span",{className:"flex-1 min-w-0 truncate leading-snug",children:t.charAt(0).toUpperCase()+t.slice(1)}),!h&&(o||s)&&(0,i.FD)("div",{className:"absolute right-1.5 top-1/2 -translate-y-1/2 flex items-center gap-0.5 opacity-0 group-hover/item:opacity-100 transition-opacity",children:[o&&(0,i.Y)("button",{type:"button",onClick:e=>{e.stopPropagation(),g()},title:"Rename session",className:"p-1 text-ink/40 hover:text-ink bg-paper/90 hover:bg-ink/10 rounded shadow-xs cursor-pointer",children:(0,i.Y)(ip.A,{size:12})}),s&&(0,i.Y)("button",{type:"button",onClick:e=>{e.stopPropagation(),s()},title:r?"Unarchive session":"Archive session",className:"p-1 text-ink/40 hover:text-ink bg-paper/90 hover:bg-ink/10 rounded shadow-xs cursor-pointer",children:r?(0,i.Y)(iu.A,{size:12}):(0,i.Y)(n7.A,{size:12})})]})]})}var ib=n("V");function ix(e){let{status:t,live:n,size:r=12}=e,a={size:r,strokeWidth:2,"aria-hidden":!0};if("completed"===t)return(0,i.Y)(th.A,{...a,className:"text-success"});if("failed"===t)return(0,i.Y)(e7.A,{...a,className:"text-error"});if("aborted"===t)return(0,i.Y)(e8.A,{...a,className:"text-ink/40"});if(!1===n)return(0,i.Y)(ib.A,{...a,className:"text-ink/30"});let l=Math.max(5,Math.round(r/2));return(0,i.Y)("span",{"aria-hidden":!0,className:"inline-block shrink-0 animate-pulse rounded-full bg-success",style:{width:l,height:l}})}var ig=n("oS");function iv(e){return(0,ig.u)(e)&&"string"==typeof e.id&&e.id.length>0&&"string"==typeof e.agent&&e.agent.length>0&&"string"==typeof e.status&&"number"==typeof e.index}async function ik(e){try{let t=await fetch(`/api/sessions/${encodeURIComponent(e)}/subagents`);if(!t.ok)return null;let n=await t.json().catch(()=>null);if(!(0,ig.u)(n))return null;let i=(0,ig.u)(n.data)?n.data:n;if(!Array.isArray(i.subagents))return null;return i.subagents.filter(iv)}catch{return null}}function iy(e){let t={...e,source:"history",lastUpdate:0},n={};return void 0!==e.lastIntent&&(n.lastIntent=e.lastIntent),void 0!==e.toolCount&&(n.toolCount=e.toolCount),void 0!==e.requests&&(n.requests=e.requests),void 0!==e.tokens&&(n.tokens=e.tokens),void 0!==e.contextTokens&&(n.contextTokens=e.contextTokens),void 0!==e.contextWindow&&(n.contextWindow=e.contextWindow),void 0!==e.cost&&(n.cost=e.cost),void 0!==e.durationMs&&(n.durationMs=e.durationMs),void 0!==e.resolvedModel&&(n.resolvedModel=e.resolvedModel),Object.keys(n).length>0&&(t.progress=n),t}function iw(e){return"string"==typeof e&&e.length>0?e:void 0}function iN(e){return"number"==typeof e&&Number.isFinite(e)?e:void 0}function iY(e){return"bundled"===e||"user"===e||"project"===e?e:void 0}function iD(e){var t;if(!(0,ig.u)(e))return;let n={},i=iN(e.index);void 0!==i&&(n.index=i);let r=iw(e.id);void 0!==r&&(n.id=r);let a=iw(e.agent);void 0!==a&&(n.agent=a);let l=iY(e.agentSource);void 0!==l&&(n.agentSource=l);let s="pending"===(t=e.status)||"running"===t||"completed"===t||"failed"===t||"aborted"===t?t:void 0;void 0!==s&&(n.status=s);let o=iw(e.task);void 0!==o&&(n.task=o);let c=iw(e.assignment);void 0!==c&&(n.assignment=c);let d=iw(e.description);void 0!==d&&(n.description=d);let p=iw(e.lastIntent);void 0!==p&&(n.lastIntent=p);let u=iw(e.currentTool);void 0!==u&&(n.currentTool=u);let m=iw(e.currentToolArgs);void 0!==m&&(n.currentToolArgs=m);let h=iN(e.currentToolStartMs);void 0!==h&&(n.currentToolStartMs=h),Array.isArray(e.recentTools)&&(n.recentTools=e.recentTools),Array.isArray(e.recentOutput)&&(n.recentOutput=e.recentOutput.filter(e=>"string"==typeof e));let b=iN(e.toolCount);void 0!==b&&(n.toolCount=b);let f=iN(e.requests);void 0!==f&&(n.requests=f);let x=iN(e.tokens);void 0!==x&&(n.tokens=x);let g=iN(e.contextTokens);void 0!==g&&(n.contextTokens=g);let v=iN(e.contextWindow);void 0!==v&&(n.contextWindow=v);let k=iN(e.cost);void 0!==k&&(n.cost=k);let y=iN(e.durationMs);void 0!==y&&(n.durationMs=y),("string"==typeof e.modelOverride||Array.isArray(e.modelOverride)&&e.modelOverride.every(e=>"string"==typeof e))&&(n.modelOverride=e.modelOverride);let w=iw(e.modelRole);void 0!==w&&(n.modelRole=w);let N=iw(e.resolvedModel);if(void 0!==N&&(n.resolvedModel=N),"boolean"==typeof e.resolvedModelIsFallback&&(n.resolvedModelIsFallback=e.resolvedModelIsFallback),(0,ig.u)(e.retryState)){let t=iN(e.retryState.attempt),i=iN(e.retryState.maxAttempts),r=iN(e.retryState.delayMs),a=iw(e.retryState.errorMessage),l=iN(e.retryState.startedAtMs);void 0!==t&&void 0!==i&&void 0!==r&&void 0!==a&&void 0!==l&&(n.retryState={attempt:t,maxAttempts:i,delayMs:r,errorMessage:a,startedAtMs:l})}if((0,ig.u)(e.retryFailure)){let t=iN(e.retryFailure.attempt),i=iw(e.retryFailure.errorMessage);void 0!==t&&void 0!==i&&(n.retryFailure={attempt:t,errorMessage:i})}return void 0!==e.inflightTaskDetails&&(n.inflightTaskDetails=e.inflightTaskDetails),(0,ig.u)(e.extractedToolData)&&(n.extractedToolData=e.extractedToolData),Object.keys(n).length>0?n:void 0}function iA(e){if(!(0,ig.u)(e))return;let t=iw(e.id),n=iw(e.status);if(!t||!n||"started"!==n&&"completed"!==n&&"failed"!==n&&"aborted"!==n)return;let i={id:t,agent:iw(e.agent)??"subagent",status:n,index:iN(e.index)??-1,lastUpdate:Date.now(),source:"live"},r=iY(e.agentSource);void 0!==r&&(i.agentSource=r);let a=iw(e.description);void 0!==a&&(i.description=a);let l=iw(e.sessionFile);void 0!==l&&(i.sessionFile=l);let s=iw(e.parentToolCallId);return void 0!==s&&(i.parentToolCallId=s),"boolean"==typeof e.detached&&(i.detached=e.detached),i}function iF(e,t){return(e.batchSeq??Number.MAX_SAFE_INTEGER)-(t.batchSeq??Number.MAX_SAFE_INTEGER)||e.index-t.index||e.id.localeCompare(t.id)}function iC(e,t,n){let i=new Map(e.map(e=>[e.id,e]));for(let e of t){let t=i.get(e.id);if(!t){i.set(e.id,e);continue}let r=t.batchSeq??e.batchSeq;if(void 0!==n&&(t.lastUpdate??0)>=n||"history"===e.source&&"history"!==t.source){r!==t.batchSeq&&i.set(e.id,{...t,batchSeq:r});continue}if("history"!==e.source&&"history"===t.source){i.set(e.id,{...e,batchSeq:r});continue}i.set(e.id,{...t,...e,batchSeq:r})}return[...i.values()].sort(iF)}let iS={pending:"started",running:"started",completed:"completed",failed:"failed",aborted:"aborted"};function iT(e){let{sessionId:t,isActiveSession:n}=e,[r]=(0,l.o)(),s=r.get("subagent"),[o,c]=(0,a.J0)([]),[d,p]=(0,a.J0)(!1);(0,a.vJ)(()=>{let e=!1,n=String(t);return c([]),p(!0),ik(n).then(t=>{if(e||!t)return;let n=t.map(iy);c(e=>iC(e,n))}).finally(()=>{e||p(!1)}),()=>{e=!0}},[t]),(0,a.vJ)(()=>{if(!n)return;let e=!1,i=String(t),r=Date.now(),a=e=>{let t=e.detail;return t&&t.sessionId===i?t:null},l=e=>{let t=iA(a(e)?.payload);t&&c(e=>iC(e,[t]))},s=e=>{let t=function(e){let t=iD(e);if(!(0,ig.u)(e)||!(0,ig.u)(e.progress))return t;let n=iD(e.progress);return n?{...n,id:n.id??t?.id,index:n.index??t?.index}:t}(a(e)?.payload);t&&c(e=>e.map(e=>{if(void 0!==t.id){if(e.id!==t.id)return e}else if(void 0===t.index||t.index<0||e.index!==t.index)return e;let n=t.status&&"started"===e.status?iS[t.status]??e.status:e.status;return{...e,status:n,progress:{...e.progress,...t},lastUpdate:Date.now()}}))};return window.addEventListener("subagent_lifecycle",l),window.addEventListener("subagent_progress",s),fetch(`/api/agent/${encodeURIComponent(i)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"get_subagents"})}).then(e=>e.ok?e.json():null).then(t=>{if(e||!(0,ig.u)(t))return;let n="data"in t?t.data:t;c(e=>iC(e,function(e){if(!(0,ig.u)(e))return[];let t=e.subagents;if(!Array.isArray(t))return[];let n=[];for(let e of t){let t=function(e){let t;if(!(0,ig.u)(e))return;let n=iw(e.id),i=iw(e.agent);if(!n||!i)return;if("started"===e.status||"completed"===e.status||"failed"===e.status||"aborted"===e.status)t=e.status;else{if("pending"!==e.status&&"running"!==e.status)return;t="started"}let r={id:n,agent:i,status:t,index:iN(e.index)??-1,source:"live"},a=iY(e.agentSource);void 0!==a&&(r.agentSource=a);let l=iw(e.description);void 0!==l&&(r.description=l);let s=iw(e.task);void 0!==s&&(r.task=s);let o=iw(e.assignment);void 0!==o&&(r.assignment=o);let c=iw(e.sessionFile);void 0!==c&&(r.sessionFile=c);let d=iw(e.parentToolCallId);void 0!==d&&(r.parentToolCallId=d),r.lastUpdate=iN(e.lastUpdate)??Date.now();let p=iD(e.progress);return void 0!==p&&(r.progress=p),r}(e);t&&n.push(t)}return n}(n),r))}).catch(()=>{}),()=>{e=!0,window.removeEventListener("subagent_lifecycle",l),window.removeEventListener("subagent_progress",s)}},[n,t]);let u=d?"Loading subagents…":0===o.length?"No subagent activity":null;return(0,i.Y)("div",{className:"pl-6 pr-0 space-y-0.5 py-0.5",children:u?(0,i.FD)("div",{className:"px-2 py-1 text-xs italic text-ink/40 flex items-center",children:[(0,i.Y)("span",{className:"w-4 h-4 shrink-0"}),(0,i.Y)("span",{className:"w-2 shrink-0"}),(0,i.Y)("span",{className:"flex-1 min-w-0 truncate",children:u})]}):o.map(e=>{let r=e.task??e.description??e.assignment??e.agent??"",a=e.id===s;return(0,i.FD)("button",{type:"button",title:r,onClick:()=>window.dispatchEvent(new CustomEvent("omp:view-subagent",{detail:{sessionId:String(t),subagent:e}})),className:`w-full flex items-center text-left text-xs rounded-md px-2 py-1 cursor-pointer transition-colors select-none group/subagent ${a?"bg-ink/10 font-medium text-ink":"text-ink/70 hover:text-ink hover:bg-ink/5"}`,children:[(0,i.Y)("span",{className:"w-4 h-4 flex items-center justify-center shrink-0",children:(0,i.Y)(ix,{status:e.status,live:n&&"started"===e.status,size:11})}),(0,i.Y)("span",{className:"w-2 shrink-0"}),(0,i.Y)("span",{className:"flex-1 min-w-0 truncate leading-snug",children:r})]},e.id)})})}var iM=n("Wi");function iz(e){let{variant:t,isPinned:n=!1,confirmDelete:r,onPin:a,onDelete:l,onRequestDelete:s,onCancelDelete:o}=e;return"mobile"===t?r?(0,i.FD)(i.FK,{children:[(0,i.Y)("div",{className:"px-3 py-2 text-ink/80 font-medium",children:"Delete workspace?"}),(0,i.FD)("button",{type:"button",onClick:l,className:"w-full text-left px-3 py-2 hover:bg-error/10 text-error flex items-center space-x-2",children:[(0,i.Y)(eD.A,{size:13}),(0,i.Y)("span",{children:"Yes, delete"})]}),(0,i.Y)("button",{type:"button",onClick:o,className:"w-full text-left px-3 py-2 hover:bg-ink/5 text-ink/70",children:"Cancel"})]}):(0,i.FD)(i.FK,{children:[(0,i.FD)("button",{type:"button",onClick:a,className:"w-full text-left px-3 py-2 hover:bg-ink/5 text-ink/80 flex items-center space-x-2",children:[n?(0,i.Y)(iM.A,{size:13}):(0,i.Y)(io.A,{size:13}),(0,i.Y)("span",{children:n?"Unpin Workspace":"Pin Workspace"})]}),(0,i.FD)("button",{type:"button",onClick:s,className:"w-full text-left px-3 py-2 hover:bg-error/10 text-error flex items-center space-x-2",children:[(0,i.Y)(eD.A,{size:13}),(0,i.Y)("span",{children:"Delete Workspace"})]})]}):r?(0,i.FD)(i.FK,{children:[(0,i.Y)("div",{className:"px-3 py-1.5 text-xs text-ink/80 font-medium",children:"Delete workspace?"}),(0,i.FD)("div",{className:"px-3 py-1.5 hover:bg-ink/5 cursor-pointer flex items-center space-x-2 text-error",onClick:l,children:[(0,i.Y)(eD.A,{size:12}),(0,i.Y)("span",{children:"Yes, delete"})]}),(0,i.Y)("div",{className:"px-3 py-1.5 hover:bg-ink/5 cursor-pointer flex items-center space-x-2 text-ink/70",onClick:o,children:(0,i.Y)("span",{children:"Cancel"})})]}):(0,i.FD)(i.FK,{children:[(0,i.FD)("div",{className:"px-3 py-1.5 hover:bg-ink/5 cursor-pointer flex items-center space-x-2 text-ink/80",onClick:a,children:[n?(0,i.Y)(iM.A,{size:12}):(0,i.Y)(io.A,{size:12}),(0,i.Y)("span",{children:n?"Unpin Workspace":"Pin Workspace"})]}),(0,i.FD)("div",{className:"px-3 py-1.5 hover:bg-ink/5 cursor-pointer flex items-center space-x-2 text-error",onClick:s,children:[(0,i.Y)(eD.A,{size:12}),(0,i.Y)("span",{children:"Delete Workspace"})]})]})}let iP="omp_sidebar_expanded_sessions",iL={default:es.A,code:eo.A,terminal:w.A,rocket:ec.A,flask:ed.A,gamepad:ep.A,briefcase:eu.A,home:b.A,globe:em.A,leaf:eh.A,shield:eb.A,palette:S.A,server:ef.A,smartphone:ex.A,database:eg.A,lightbulb:ev.A,music:ek.A,camera:ey.A,book:J.A,heart:ew.A};function ij(e){return iL[e||"default"]||es.A}function iR(e){let{folder:t,activeSessionId:n,onSelectSession:r,onNewSessionForFolder:s,forceExpanded:o=!1,showArchived:c=!1,sessionStatus:d={}}=e,[p,u]=(0,a.J0)(t.isExpanded||!1),[m,h]=(0,a.J0)(!1),{visibleCount:b,showMore:f}=ic(),[x]=(0,l.o)(),v=x.get("subagent"),k=x.get("sessionId"),[y,w]=(0,a.J0)(()=>new Set);(0,a.vJ)(()=>{let e,t=Array.isArray(e=(0,A.BF)(iP))?new Set(e.filter(e=>"string"==typeof e)):new Set;t&&t.size>0&&w(t)},[]),(0,a.vJ)(()=>{"boolean"==typeof t.isExpanded&&u(t.isExpanded)},[t.isExpanded]),(0,a.vJ)(()=>{v&&k&&w(e=>{if(e.has(k))return e;let t=new Set(e);return t.add(k),t})},[v,k]);let N=(0,a.li)(null),{refresh:Y}=ni(),D=(0,t9.L)(),{confirmDelete:F,requestDelete:C,cancelDelete:S,handlePin:T,handleDelete:M,handleArchive:z,handleRename:P}=id(t,Y);(0,a.vJ)(()=>{D.data?.success&&window.dispatchEvent(new CustomEvent("omp:workspace-updated"))},[D.data]),(0,eM.W)(N,()=>{h(!1),S()});let L=t.sessions,j=ij(t.icon),R=(L||[]).filter(e=>c?1===e.is_archived:1!==e.is_archived),I=R.slice(0,b),E=R.length>b;return(0,i.FD)("div",{className:"space-y-1",children:[(0,i.FD)("div",{className:"group flex items-center justify-between h-7 text-xs font-semibold text-ink px-2 hover:bg-ink/5 rounded-md transition-colors select-none",children:[(0,i.FD)("div",{className:"flex-1 h-full flex items-center cursor-pointer min-w-0",onClick:()=>{let e=!p;u(e),"number"==typeof t.id&&D.submit({isExpanded:String(e)},{method:"POST",action:`/api/folders/${t.id}/toggle`})},children:[(0,i.Y)("span",{className:"w-4 h-4 flex items-center justify-center shrink-0",children:t.customIconUrl?(0,i.Y)("img",{src:t.customIconUrl,alt:"",className:"w-[15px] h-[15px] rounded-xs object-contain shrink-0",referrerPolicy:"no-referrer"}):(0,i.Y)(j,{size:15,className:"text-ink/75",style:{color:t.accentColor||void 0}})}),(0,i.Y)("span",{className:"w-2 shrink-0"}),t.isPinned&&(0,i.Y)(io.A,{size:11,className:"text-ink/60 shrink-0 mr-1.5"}),(0,i.Y)("span",{className:"truncate text-[13px] font-semibold tracking-tight",children:t.name})]}),(0,i.FD)("div",{className:`items-center space-x-0.5 pl-1 ${m?"flex":"hidden group-hover:flex"}`,children:[(0,i.Y)("button",{type:"button",title:"New Session",className:"w-5 h-5 flex items-center justify-center text-ink/40 hover:text-ink hover:bg-ink/10 rounded cursor-pointer transition-colors",onClick:e=>{e.stopPropagation(),s(t.id)},children:(0,i.Y)(g.A,{size:12})}),(0,i.FD)("div",{className:"relative flex items-center",ref:N,children:[(0,i.Y)("button",{type:"button",title:"Workspace Options",className:"w-5 h-5 flex items-center justify-center text-ink/40 hover:text-ink hover:bg-ink/10 rounded cursor-pointer transition-colors",onClick:e=>{e.stopPropagation(),h(!m)},children:(0,i.Y)(n9.A,{size:12})}),m&&(0,i.Y)("div",{className:"absolute right-0 top-full mt-1 w-44 bg-paper border border-ink/15 rounded-md shadow-lg z-50 py-1 text-xs",children:(0,i.Y)(iz,{variant:"desktop",isPinned:t.isPinned,confirmDelete:F,onPin:()=>{T(),h(!1)},onDelete:()=>{M(),h(!1)},onRequestDelete:C,onCancelDelete:S})})]})]})]}),(o||p)&&(0,i.FD)("div",{className:"space-y-0.5",children:[I.map(e=>{let t=String(e.id),a=null!==n?String(n)===t:1===e.is_active,l=a&&k===t&&!!v,s=null!==n&&t===String(n),o=!!e.hasSubagents,c=o&&y.has(t);return(0,i.FD)("div",{className:"space-y-0.5",children:[(0,i.Y)(ih,{title:e.title,isActive:a&&!l,isArchived:1===e.is_archived,status:d[t],onClick:()=>r(e.id),onArchive:()=>z(e),onRename:String(e.id).startsWith("new-")?void 0:t=>void P(e,t),expandable:o,hasSubagents:o,isExpanded:c,onToggleExpand:()=>{w(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),(0,A.cz)(iP,[...n].slice(-50)),n})}}),o&&c&&(0,i.Y)(iT,{sessionId:e.id,isActiveSession:s})]},e.id)}),E&&!o&&(0,i.FD)("button",{type:"button",onClick:f,className:"flex items-center text-xs text-ink/45 hover:text-ink/80 w-full text-left py-1.5 px-2 rounded-lg hover:bg-ink/5 transition-colors cursor-pointer select-none",children:[(0,i.Y)("span",{className:"w-4 h-4 shrink-0"}),(0,i.Y)("span",{className:"w-2 shrink-0"}),(0,i.Y)("span",{className:"truncate leading-snug",children:"Show more sessions"})]}),0===R.length&&(0,i.Y)("div",{className:"px-3 py-2 text-[11px] text-ink/40 italic",children:c?"No archived sessions.":"No sessions."})]})]})}var iI=n("jo");function iE(e){let{folders:t,activeSessionId:n,searchQuery:r,showArchived:a,sessionStatus:l,isScrolling:s,onScroll:o,onSelectSession:c,onNewSessionForFolder:d}=e;return(0,i.Y)("div",{onScroll:o,className:`flex-1 scrollbar-overlay-container p-2 space-y-4 ${(0,iI.p)(s)}`,children:0===t.length?(0,i.Y)("div",{className:"text-center py-8 text-xs text-ink/40",children:r?"No results found.":"No workspaces available."}):t.map(e=>(0,i.Y)(iR,{folder:e,activeSessionId:n,onSelectSession:c,onNewSessionForFolder:d,forceExpanded:!!r,showArchived:a,sessionStatus:l},e.id))})}let i$=[3,2];function iO(){return(0,i.Y)("div",{className:"flex-1 p-2 space-y-4","aria-hidden":"true",children:i$.map((e,t)=>(0,i.FD)("div",{className:"space-y-1.5",children:[(0,i.FD)("div",{className:"flex items-center gap-2 px-1 py-1.5",children:[(0,i.Y)("span",{className:"w-3.5 h-3.5 rounded-sm animate-pulse bg-ink/10"}),(0,i.Y)("span",{className:"h-3 w-24 rounded animate-pulse bg-ink/10"})]}),Array.from({length:e},(e,t)=>(0,i.FD)("div",{className:"flex items-center gap-2 rounded px-2 py-1.5",children:[(0,i.Y)("span",{className:"w-4 h-4 rounded-full animate-pulse bg-ink/10"}),(0,i.Y)("span",{className:"h-3 rounded animate-pulse bg-ink/10",style:{width:`${58-t%3*12}%`}})]},t))]},t))})}function iJ(e,t){e&&fetch("/api/agent/prewarm",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:e,...t?{accessMode:t}:{}})}).catch(()=>{})}function i_(e,t,n){let i=void 0!==n?e.find(e=>String(e.id)===String(n)):e.find(e=>e.sessions?.some(e=>String(e.id)===String(t)))??e.find(e=>!!e.project_path);return i?.project_path||i?.name||null}function iU(e,t){return"object"!=typeof e||null===e?t:"error"in e&&"string"==typeof e.error?e.error:"message"in e&&"string"==typeof e.message?e.message:t}function iK(){let[e,t]=(0,a.J0)(null),[n,i]=(0,a.J0)(!1),[r,l]=(0,a.J0)(null),[s,o]=(0,a.J0)(null),c=(0,a.li)(null),d=(0,a.li)(!1),p=(0,a.hb)(()=>{if(c.current)return c.current;let e=(async()=>{i(!0),o(null);try{let e=await fetch("/api/updates/check"),n=await e.json();if(!e.ok)throw Error(iU(n,`Update check failed (HTTP ${e.status})`));t(n)}catch(e){o(e instanceof Error?e.message:"Unable to check for updates.")}finally{i(!1),c.current=null}})();return c.current=e,e},[]),u=(0,a.hb)(async e=>{l(e),o(null);try{let t=await fetch("/api/updates/apply",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({target:e})}),n=await t.json();if("object"!=typeof n||null===n||!("success"in n)||"boolean"!=typeof n.success||!("target"in n)||"ompchamber"!==n.target&&"omp"!==n.target||!("manual"in n)||"boolean"!=typeof n.manual||!("message"in n)||"string"!=typeof n.message)throw Error(iU(n,`Update failed (HTTP ${t.status})`));return await p(),n}catch(e){return o(e instanceof Error?e.message:"Unable to apply the update."),null}finally{l(null)}},[p]);return(0,a.vJ)(()=>{d.current||(d.current=!0,p())},[]),{info:e,checking:n,applying:r,error:s,hasUpdate:!!(e?.ompchamber.updateAvailable||e?.omp.updateAvailable),check:p,apply:u}}function iB(e){let t=-1/0;for(let n of e.sessions??[]){let e=function(e){if(!e)return 0/0;let t=Date.parse(e);return Number.isFinite(t)?t:0/0}(n.updated_at??n.created_at);e>t&&(t=e)}return t}function iW(e){let t=-1/0;for(let n of e.sessions??[]){let e=Number(n.id);Number.isFinite(e)&&e>t&&(t=e)}return t}function iH(e){let t=Number(e.id);return Number.isFinite(t)?t:-1/0}function iq(e,t){return e===t?0:e>t?-1:1}function iG(e,t){return e===t?0:e>t?1:-1}let iV=["A-Z","Z-A","LATEST_SESSION","LATEST_ADDED"],iQ="new-";function iZ(e){return String(e).padStart(2,"0")}function iX(e){return e?.startsWith(iQ)?Number(e.slice(iQ.length)):0/0}function i0(e){let t=iX(e);return function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date;return Number.isNaN(e.getTime())?"New Session":`New Session - ${e.getFullYear()}-${iZ(e.getMonth()+1)}-${iZ(e.getDate())}T${iZ(e.getHours())}:${iZ(e.getMinutes())}:${iZ(e.getSeconds())}`}(Number.isFinite(t)?new Date(t):new Date)}function i1(){let e,t,n,i,r,s,o,c,d,p,u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},m=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{includePendingSessions:h=!1,onSelectSession:b,onAfterSelect:f}=m,{folders:x,initializing:g,refresh:v,markSeen:k,hasSeen:y}=ni(),[w,N]=(0,l.o)(),Y=w.get("sessionId"),D=Y?Number.isNaN(Number(Y))?Y:Number(Y):null,F=(0,a.li)(v);F.current=v;let S=(0,a.hb)(()=>F.current(),[]);(e=(0,a.li)(S)).current=S,t=(0,a.li)(void 0),n=(0,a.li)(0),(0,a.vJ)(()=>{let i=()=>{n.current=Date.now(),e.current()},r=()=>{let e=Date.now()-n.current;if(e>=1e3){clearTimeout(t.current),t.current=void 0,i();return}clearTimeout(t.current),t.current=setTimeout(()=>{t.current=void 0,i()},1e3-e)};return window.addEventListener("omp:session-updated",r),()=>{window.removeEventListener("omp:session-updated",r),void 0!==t.current&&(clearTimeout(t.current),t.current=void 0)}},[]),(0,C.sY)("omp:workspace-updated",()=>F.current());let[T,M]=(0,a.J0)(""),[z,P]=(0,a.J0)(!1),[L,j]=(0,a.J0)(!1),[R,I]=(0,a.J0)(()=>{var e;return"string"==typeof(e=u.omp_sidebar_sort)&&iV.includes(e)?u.omp_sidebar_sort:"A-Z"}),E=(0,a.li)(null),$=(0,a.hb)(e=>{E.current&&clearTimeout(E.current),E.current=setTimeout(()=>{(0,A.cz)("omp_sidebar_sort",e)},200)},[]);(0,a.vJ)(()=>()=>{E.current&&clearTimeout(E.current)},[]);let O=(0,a.Kr)(()=>(function(e){let t={};for(let n of e)for(let e of n.sessions??[])e.streamStatus&&(t[String(e.id)]=e.streamStatus);return t})(x),[x]);r=null!==(i=null===D?null:String(D))?O[i]:void 0,s=(0,a.li)(null),(o=(0,a.li)(S)).current=S,(c=(0,a.li)(y)).current=y,(0,a.vJ)(()=>{if(!r||"stream"===r||c.current?.(i))return;let e=`${i}:${r}`;s.current!==e&&(s.current=e,fetch(`/api/sessions/${encodeURIComponent(i)}/stream-seen`,{method:"POST"}).then(e=>e.json()).then(e=>{!1===e.deleted&&(s.current=null),o.current()}).catch(()=>{s.current=null}))},[i,r]),(d=(0,a.li)(Object.values(O).includes("stream"))).current=Object.values(O).includes("stream"),(p=(0,a.li)(S)).current=S,(0,a.vJ)(()=>{let e=setInterval(()=>{d.current&&p.current()},8e3);return()=>clearInterval(e)},[]);let J=(0,a.Kr)(()=>{let e=[...x];if(h){let t=e.some(e=>e.sessions?.some(e=>String(e.id)===String(Y))),n=Y&&!t?Y:null;if(n){let t=w.get("folderId"),i=t?e.find(e=>String(e.id)===String(t)):e[0],r=!!i?.sessions?.some(e=>String(e.id)===String(n));if(i&&!r){let t=iX(n),r=Number.isFinite(t)?new Date(t).toISOString():new Date().toISOString();e=e.map(e=>{if(e.id!==i.id)return e;let t={id:n,folder_id:e.id,title:i0(n),created_at:r,updated_at:r};return{...e,isExpanded:!0,sessions:[t,...e.sessions||[]]}})}}}if(T.trim()){let t=T.toLowerCase();e=h?e.filter(e=>{let n=e.name.toLowerCase().includes(t),i=e.sessions?.some(e=>e.title.toLowerCase().includes(t));return n||i}).map(e=>{let n=e.sessions?.filter(n=>e.name.toLowerCase().includes(t)||n.title.toLowerCase().includes(t));return{...e,sessions:n,isExpanded:!0}}):e.map(e=>{let n=e.name.toLowerCase().includes(t),i=(e.sessions||[]).filter(e=>e.title.toLowerCase().includes(t));return n?e:{...e,sessions:i}}).filter(e=>e.sessions&&e.sessions.length>0)}return e=[...e].sort((e,t)=>(function(e,t,n){let i=!!e.isPinned;if(i!==!!t.isPinned)return i?-1:1;switch(n){case"Z-A":{let n=t.name.localeCompare(e.name);return 0!==n?n:iG(iH(e),iH(t))}case"LATEST_SESSION":{let n=iq(iB(e),iB(t));if(0!==n)return n;let i=iq(iW(e),iW(t));if(0!==i)return i;let r=iq(iH(e),iH(t));return 0!==r?r:e.name.localeCompare(t.name)}case"LATEST_ADDED":{let n=iq(iH(e),iH(t));return 0!==n?n:e.name.localeCompare(t.name)}default:{let n=e.name.localeCompare(t.name);return 0!==n?n:iG(iH(e),iH(t))}}})(e,t,R))},[x,T,R,Y,w,h]);return{folders:x,initializing:g,refresh:S,activeSessionId:D,sessionParam:Y,searchQuery:T,setSearchQuery:M,showArchived:z,setShowArchived:P,optionsOpen:L,setOptionsOpen:j,sortOption:R,handleSortChange:e=>{I(e),j(!1),$(e)},processedFolders:J,sessionStatus:O,handleSelectSession:e=>{k(e),b?b(e):N(t=>(t.set("sessionId",e.toString()),t.has("subagent")&&t.delete("subagent"),t),{replace:!0}),f?.()}}}function i2(e){let{className:t="",onClose:n,appSettings:r={}}=e,{folders:s,initializing:o,refresh:c,activeSessionId:d,sessionParam:p,searchQuery:u,setSearchQuery:m,showArchived:h,setShowArchived:b,optionsOpen:f,setOptionsOpen:x,sortOption:g,handleSortChange:v,processedFolders:k,sessionStatus:y,handleSelectSession:w}=i1(r,{includePendingSessions:!0}),[,N]=(0,l.o)(),[Y,D]=(0,a.J0)(!1),[A,F]=(0,a.J0)(!1),[C,S]=(0,a.J0)(!1),[T,M]=(0,a.J0)(!1),z=iK(),{toasts:P,pushToast:L,dismissToast:j}=(0,e0.Y)(),[R,I]=(0,a.J0)(!1),{isScrolling:E,handleScroll:$}=(0,iI.K)(),O=e=>{let t=i_(s,p,e);t&&iJ(t,r.omp_access_mode)};return(0,i.FD)(i.FK,{children:[(0,i.FD)("aside",{className:`flex flex-col bg-paper h-full ${t}`,children:[(0,i.Y)(n4,{onNewSession:()=>{O(),N(e=>{let t=e.get("sessionId"),n=new URLSearchParams(e);if(n.set("sessionId",`new-${Date.now()}`),t){let e=s.find(e=>e.sessions?.some(e=>String(e.id)===String(t)));e&&n.set("folderId",e.id.toString())}else n.delete("folderId");return n},{replace:!0})}}),(0,i.Y)(ia,{isSearchVisible:R,searchQuery:u,showArchived:h,optionsOpen:f,sortOption:g,onToggleSearch:()=>I(!R),onSearchChange:m,onToggleArchived:()=>b(!h),onHideArchived:()=>b(!1),onToggleOptions:()=>x(!f),onCloseOptions:()=>x(!1),onSortChange:v,onNewWorkspace:()=>S(!0),onScheduler:()=>M(!0),onRefresh:c,onClose:n}),o?(0,i.Y)(iO,{}):(0,i.Y)(iE,{folders:k,activeSessionId:d,searchQuery:u,showArchived:h,sessionStatus:y,isScrolling:E,onScroll:$,onSelectSession:w,onNewSessionForFolder:e=>{O(e),N(t=>{let n=new URLSearchParams(t);return n.set("sessionId",`new-${Date.now()}`),n.set("folderId",e.toString()),n},{replace:!0})}}),(0,i.Y)(is,{onSettings:()=>D(!0),onInfo:()=>F(!0),updateAvailable:z.hasUpdate,onUpdateClick:()=>{F(!0),z.check()}})]}),(0,i.Y)(nq,{isOpen:Y,onClose:()=>D(!1),appSettings:r}),(0,i.Y)(n2,{isOpen:A,onClose:()=>F(!1),updates:z,onToast:L}),(0,i.Y)(n5,{isOpen:C,onClose:()=>S(!1),onCreate:async e=>{let{name:t,path:n}=e,i=await fetch("/api/folders",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t,path:n})}),r=await i.json().catch(()=>({}));if(!i.ok||!r.success)throw Error(r.error||`HTTP ${i.status}`);window.location.reload()}}),(0,i.Y)(n3,{isOpen:T,onClose:()=>M(!1)}),(0,i.Y)(eU.y,{toasts:P,onDismiss:j})]})}var i5=n("zI");function i3(e,t){if(!t)return{folder:null,projectPath:null};for(let n of e)if((n.sessions||[]).some(e=>String(e.id)===String(t)))return{folder:n,projectPath:n.project_path??null};return{folder:null,projectPath:null}}var i4=n("FL"),i6=n("As"),i8=n("b5"),i7=n("P"),i9=n("se");let re=()=>{let{isInstallable:e,isInstalled:t,isIOS:n,install:r}=function(){let[e,t]=(0,a.J0)(null),[n,i]=(0,a.J0)(!1),[r,l]=(0,a.J0)(!1);(0,a.vJ)(()=>{i(window.matchMedia("(display-mode: standalone)").matches||!0===window.navigator.standalone);let e=window.navigator.userAgent.toLowerCase();l(/iphone|ipad|ipod/.test(e));let n=e=>{e.preventDefault(),t(e)},r=()=>{i(!0),t(null)};return window.addEventListener("beforeinstallprompt",n),window.addEventListener("appinstalled",r),()=>{window.removeEventListener("beforeinstallprompt",n),window.removeEventListener("appinstalled",r)}},[]);let s=async()=>{if(!e)return!1;await e.prompt();let{outcome:n}=await e.userChoice;return"accepted"===n&&(i(!0),t(null),!0)};return{isInstallable:!!e,isInstalled:n,isIOS:r,install:s}}(),[l,s]=(0,a.J0)(!1);return t?null:e?(0,i.Y)("button",{onClick:r,className:"p-1.5 rounded hover:bg-ink/10 transition-colors text-ink/60 hover:text-ink",title:"Install OMPChamber",children:(0,i.Y)(nh.A,{size:16})}):n?(0,i.FD)(i.FK,{children:[(0,i.Y)("button",{onClick:()=>s(!0),className:"p-1.5 rounded hover:bg-ink/10 transition-colors text-ink/60 hover:text-ink",title:"Install on iOS",children:(0,i.Y)(nh.A,{size:16})}),l&&(0,i.Y)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-ink/20 p-4",children:(0,i.FD)("div",{className:"w-full max-w-sm rounded bg-paper border border-ink/10 p-6 shadow-xl text-ink",children:[(0,i.Y)("h3",{className:"text-sm font-semibold",children:"Install on iPhone / iPad"}),(0,i.FD)("p",{className:"mt-2 text-xs opacity-80",children:["1. Tap the ",(0,i.Y)("strong",{children:"Share"})," button in Safari toolbar.",(0,i.Y)("br",{}),"2. Scroll down and tap ",(0,i.Y)("strong",{children:"Add to Home Screen"}),"."]}),(0,i.Y)("button",{onClick:()=>s(!1),className:"mt-4 w-full rounded bg-ink text-canvas py-2 text-xs font-semibold hover:bg-ink/90",children:"Close"})]})})]}):null};function rt(e){let{status:t}=e;if(t?.transport!=="websocket")return null;let n=!!t.connected,r=n?"WebSocket connected":"WebSocket disconnected";return(0,i.Y)("span",{role:"status","aria-label":r,title:r,className:"flex items-center flex-shrink-0 select-none",children:(0,i.Y)("span",{className:`w-1.5 h-1.5 rounded-full flex-shrink-0 ${n?"bg-success":"bg-error"}`})})}function rn(e){let{sessionTitle:t,showLeftPanel:n,showEditor:r,showRightPanel:a,streamStatus:l,onSwitchToMobile:s,onToggleEditor:o,onToggleRightPanel:c}=e;return(0,i.FD)("header",{className:"h-12 flex-shrink-0 border-b border-ink/10 bg-paper flex items-center justify-between pr-4 z-20 titlebar-drag-region select-none",style:{paddingLeft:n?void 0:"max(1rem, env(titlebar-area-x, 0px))",paddingRight:"max(1rem, calc(100vw - env(titlebar-area-width, 100vw)))"},children:[(0,i.FD)("div",{className:"flex items-center space-x-2 px-4 min-w-0",children:[!n&&(0,i.FD)(i.FK,{children:[(0,i.FD)("span",{className:"font-bold text-sm tracking-tight hidden sm:flex items-center flex-shrink-0",children:[(0,i.Y)("span",{className:"text-transparent bg-clip-text bg-gradient-to-r from-orange-600 to-amber-500 font-extrabold text-[15px] tracking-tighter",children:"OMP"}),(0,i.Y)("span",{className:"ml-[1px]",children:"Chamber"})]}),t&&(0,i.Y)("span",{className:"text-ink/30 text-xs select-none flex-shrink-0",children:"/"})]}),t&&(0,i.FD)("div",{className:"flex items-center space-x-2 titlebar-no-drag",children:[(0,i.Y)("span",{className:"font-bold text-sm tracking-tight hidden sm:flex items-center",children:(0,i.Y)("span",{className:"font-semibold text-xs text-ink truncate",children:t.charAt(0).toUpperCase()+t.slice(1)})}),(0,i.Y)(n9.A,{size:14,className:"text-ink/40 hover:text-ink cursor-pointer flex-shrink-0"})]})]}),(0,i.Y)("div",{className:"flex items-center space-x-3 titlebar-no-drag",children:(0,i.FD)("div",{className:"flex items-center space-x-1",children:[(0,i.Y)(rt,{status:l}),s&&(0,i.Y)("button",{type:"button",onClick:s,className:"p-1.5 rounded hover:bg-ink/10 transition-colors text-ink/60 hover:text-ink cursor-pointer",title:"Switch to Mobile View",children:(0,i.Y)(ex.A,{size:16})}),(0,i.Y)(re,{}),(0,i.Y)("button",{type:"button",onClick:o,className:`p-1.5 rounded hover:bg-ink/10 transition-colors cursor-pointer ${r?"text-ink":"text-ink/40"}`,title:"Toggle Editor Layout",children:(0,i.Y)(i8.A,{size:16})}),(0,i.Y)("button",{type:"button",onClick:c,className:`p-1.5 rounded hover:bg-ink/10 transition-colors cursor-pointer ${a?"text-ink":"text-ink/40"}`,title:"Toggle Right Panel",children:a?(0,i.Y)(i7.A,{size:16}):(0,i.Y)(i9.A,{size:16})})]})})]})}let ri=(0,s.RZ)(()=>n.e("rf").then(n.bind(n,"Rt")).then(e=>({default:e.AskDialog})));function rr(e){return(0,i.Y)(s.tY,{fallback:null,children:(0,i.Y)(ri,{...e})})}var ra=n("s8");function rl(e){let{search:t,onSearchChange:n,onAddProvider:r}=e;return(0,i.FD)("div",{className:"flex flex-col border-b border-ink/10 bg-canvas/40",children:[(0,i.FD)("button",{type:"button",onClick:r,className:"w-full flex items-center space-x-2 px-3 py-2 text-xs text-ink/70 hover:text-ink hover:bg-ink/5 transition-colors text-left font-medium cursor-pointer border-b border-ink/5",children:[(0,i.Y)(g.A,{size:14,className:"text-ink/60"}),(0,i.Y)("span",{children:"Add new provider"})]}),(0,i.FD)("div",{className:"p-2 flex items-center bg-canvas/60",children:[(0,i.Y)(_.A,{size:13,className:"text-ink/40 mr-2 flex-shrink-0"}),(0,i.Y)("input",{type:"text",value:t,onChange:e=>n(e.currentTarget.value),placeholder:"Search models",className:"bg-transparent border-none focus:outline-none w-full text-ink placeholder-ink/40 text-xs font-sans",autoFocus:!0}),t&&(0,i.Y)("button",{type:"button",onClick:()=>n(""),className:"p-0.5 text-ink/40 hover:text-ink transition-colors cursor-pointer",title:"Clear search",children:(0,i.Y)(h.A,{size:12})})]})]})}var rs=n("hw"),ro=n("j7"),rc=n("Wb"),rd=n("cV"),rp=n("K6");function ru(e){let{model:t,isSelected:n,isFocused:r,onSelect:a,onToggleFavorite:l,onCycleThinking:s,onMouseEnter:o}=e;return(0,i.FD)("div",{role:"button",tabIndex:0,onClick:()=>a(t),onMouseEnter:o,className:`group relative w-full flex items-center justify-between px-2.5 py-1.5 rounded-lg text-xs transition-colors cursor-pointer select-none ${r?"bg-ink/10 text-ink":n?"bg-ink/5 text-ink":"text-ink/85 hover:bg-ink/5"}`,children:[(0,i.FD)("div",{className:"flex items-center space-x-2 min-w-0 flex-1 mr-2",children:[(0,i.Y)(ro.A,{size:12,className:"text-ink/20 group-hover:text-ink/50 transition-colors flex-shrink-0"}),(()=>{if(t.isCmdAgent)return(0,i.Y)("span",{className:"inline-flex items-center justify-center w-4 h-4 rounded border border-ink/20 bg-ink/5 text-ink/80 flex-shrink-0",title:"Autonomous Agent Command Mode [CMD]",children:(0,i.Y)(rd.A,{size:10})});switch(t.providerIcon||t.provider.toLowerCase()){case"deepseek":return(0,i.Y)("span",{className:"text-[12px] leading-none flex-shrink-0",title:"DeepSeek",children:"🐋"});case"anthropic":case"claude":return(0,i.Y)(I.A,{size:13,className:"text-orange-400 flex-shrink-0"});case"openai":return(0,i.Y)($.A,{size:13,className:"text-emerald-500 flex-shrink-0"});case"google":case"gemini":return(0,i.Y)(eS.A,{size:13,className:"text-blue-400 flex-shrink-0"});case"opencode":return(0,i.Y)(en.A,{size:13,className:"text-violet-400 flex-shrink-0"});case"mistral":return(0,i.Y)(em.A,{size:13,className:"text-rose-400 flex-shrink-0"});default:return(0,i.Y)(eS.A,{size:13,className:"text-ink/60 flex-shrink-0"})}})(),(0,i.FD)("div",{className:"flex items-center space-x-1.5 truncate",children:[t.isCmdAgent&&(0,i.Y)("span",{className:"font-mono text-[11px] font-semibold text-ink/75 flex-shrink-0",children:"[CMD]"}),(0,i.Y)("span",{className:`truncate ${n?"font-semibold text-ink":"font-normal text-ink/90"}`,children:t.name}),t.contextWindow&&(0,i.Y)("span",{className:"font-mono text-[10px] text-ink/45 flex-shrink-0",children:tr(t.contextWindow)})]})]}),(0,i.FD)("div",{className:"flex items-center space-x-2 flex-shrink-0",children:[t.thinkingLevel&&(0,i.FD)("button",{type:"button",onClick:e=>{e.stopPropagation(),s?.(t,e)},title:`Thinking preset: ${t.thinkingLevel} (Click or use ← / → to change)`,className:"inline-flex items-center space-x-1 px-1.5 py-0.5 rounded text-[10px] font-mono text-ink/70 bg-ink/5 hover:bg-ink/10 border border-ink/10 transition-colors cursor-pointer",children:[(0,i.Y)(rp.A,{size:10,className:"text-ink/50"}),(0,i.Y)("span",{children:t.thinkingLevel})]}),n&&(0,i.Y)(D.A,{size:13,className:"text-ink flex-shrink-0"}),(0,i.Y)("button",{type:"button",onClick:e=>l(t,e),title:t.isFavorite?"Remove from favorites":"Add to favorites",className:"p-1 rounded text-ink/30 hover:text-sky-400 hover:bg-ink/5 transition-colors cursor-pointer",children:(0,i.Y)(np.A,{size:13,className:t.isFavorite?"fill-sky-400 text-sky-400":"text-ink/30 hover:text-sky-400"})})]})]})}function rm(e){return e?`${e.provider}:${e.id}`:""}function rh(e){let{id:t,title:n,iconType:r="provider",models:a,isCollapsed:l,onToggleCollapse:s,selectedModelKey:o,modelIndex:c,focusedIndex:d,onSelect:p,onToggleFavorite:u,onCycleThinking:m,onHoverItem:h}=e;return 0===a.length?null:(0,i.FD)("div",{className:"space-y-0.5",children:[(0,i.FD)("button",{type:"button",onClick:()=>s(t),className:"w-full flex items-center justify-between px-2 py-1 text-[11px] font-semibold text-ink/60 uppercase tracking-wider hover:text-ink cursor-pointer select-none",children:[(0,i.FD)("div",{className:"flex items-center space-x-1.5",children:["star"===r&&(0,i.Y)(np.A,{size:12,className:"fill-sky-400 text-sky-400"}),"recent"===r&&(0,i.Y)(rs.A,{size:12,className:"text-ink/60"}),"whale"===r&&(0,i.Y)("span",{children:"🐋"}),"provider"===r&&(0,i.Y)(ro.A,{size:11,className:"text-ink/25"}),(0,i.Y)("span",{children:n})]}),l?(0,i.Y)(eT.A,{size:12,className:"text-ink/40"}):(0,i.Y)(rc.A,{size:12,className:"text-ink/40"})]}),!l&&(0,i.Y)("div",{className:"space-y-0.5",children:a.map(e=>{let n=rm(e),r=c[n]??-1;return(0,i.Y)(ru,{model:e,isSelected:o===n,isFocused:d===r,onSelect:p,onToggleFavorite:u,onCycleThinking:m,onMouseEnter:()=>h(r,e)},`${t}-${n}`)})})]})}function rb(){return(0,i.Y)("div",{className:"flex items-center justify-between px-3 py-1.5 border-t border-ink/10 bg-canvas/60 text-[10px] text-ink/50 font-mono select-none",children:(0,i.FD)("div",{className:"flex items-center space-x-3",children:[(0,i.FD)("span",{className:"flex items-center space-x-1",children:[(0,i.Y)("span",{className:"text-ink/70",children:"↑ ↓"}),(0,i.Y)("span",{children:"navigate"})]}),(0,i.FD)("span",{className:"flex items-center space-x-1",children:[(0,i.Y)("span",{className:"text-ink/70",children:"Tab"}),(0,i.Y)("span",{children:"switch agent"})]}),(0,i.FD)("span",{className:"flex items-center space-x-1",children:[(0,i.Y)("span",{className:"text-ink/70",children:"← →"}),(0,i.Y)("span",{children:"thinking"})]})]})})}let rf=[3,2];function rx(){return(0,i.Y)("div",{className:"space-y-2","aria-hidden":"true",children:rf.map((e,t)=>(0,i.FD)("div",{className:"space-y-0.5",children:[(0,i.FD)("div",{className:"flex items-center space-x-1.5 px-2 py-1",children:[(0,i.Y)("span",{className:"w-2.5 h-2.5 rounded-sm animate-pulse bg-ink/10"}),(0,i.Y)("span",{className:"h-2.5 w-20 rounded animate-pulse bg-ink/10"})]}),Array.from({length:e},(e,n)=>(0,i.FD)("div",{className:"flex items-center justify-between px-2.5 py-1.5",children:[(0,i.FD)("div",{className:"flex items-center space-x-2 min-w-0 flex-1 mr-2",children:[(0,i.Y)("span",{className:"w-3 h-3 rounded-sm animate-pulse bg-ink/10 flex-shrink-0"}),(0,i.Y)("span",{className:"h-3 rounded animate-pulse bg-ink/10",style:{width:`${52-(n+t)%3*10}%`}})]}),(0,i.Y)("span",{className:"h-4 w-9 rounded animate-pulse bg-ink/10 flex-shrink-0"})]},n))]},t))})}function rg(e){let{model:t}=e;return t?(0,i.Y)("div",{className:"w-72 bg-paper/95 backdrop-blur-sm border border-ink/20 rounded-xl shadow-2xl p-3.5 text-xs text-ink select-none animate-in fade-in zoom-in-95 duration-100",children:(0,i.FD)("div",{className:"space-y-2.5 font-mono text-[11px]",children:[t.capabilities&&t.capabilities.length>0&&(0,i.FD)("div",{className:"flex items-start justify-between gap-2",children:[(0,i.Y)("span",{className:"text-ink/50 font-sans text-xs",children:"Capabilities"}),(0,i.Y)("span",{className:"text-ink font-medium text-right text-xs font-sans",children:t.capabilities.join(", ")})]}),t.contextWindow&&(0,i.FD)("div",{className:"flex items-center justify-between gap-2",children:[(0,i.Y)("span",{className:"text-ink/50 font-sans text-xs",children:"Context"}),(0,i.Y)("span",{className:"text-ink/80",children:tr(t.contextWindow)})]}),t.thinkingLevel&&(0,i.FD)("div",{className:"flex items-center justify-between gap-2",children:[(0,i.Y)("span",{className:"text-ink/50 font-sans text-xs",children:"Thinking"}),(0,i.Y)("span",{className:"text-ink/80",children:t.thinkingLevel})]}),t.input&&(0,i.FD)("div",{className:"flex items-center justify-between gap-2",children:[(0,i.Y)("span",{className:"text-ink/50 font-sans text-xs",children:"Input"}),(0,i.Y)("span",{className:"text-ink/80",children:t.input})]}),t.output&&(0,i.FD)("div",{className:"flex items-center justify-between gap-2",children:[(0,i.Y)("span",{className:"text-ink/50 font-sans text-xs",children:"Output"}),(0,i.Y)("span",{className:"text-ink/80",children:t.output})]}),t.cost&&(0,i.FD)("div",{className:"flex items-center justify-between gap-2 pt-1 border-t border-ink/10",children:[(0,i.Y)("span",{className:"text-ink/50 font-sans text-xs",children:"Cost ($/1M tokens)"}),(0,i.FD)("span",{className:"text-ink font-semibold tracking-tight",children:["In ",t.cost.input," · Out ",t.cost.output]})]}),(t.cost?.cacheRead!==void 0||t.cost?.cacheWrite!==void 0)&&(0,i.FD)("div",{className:"flex items-center justify-between gap-2 pt-1 border-t border-ink/5",children:[(0,i.Y)("span",{className:"text-ink/50 font-sans text-xs",children:"Cache"}),(0,i.Y)("span",{className:"text-ink/80",children:t.cost?.cacheRead!==void 0&&t.cost?.cacheWrite!==void 0?`Read ${t.cost.cacheRead} \xb7 Write ${t.cost.cacheWrite}`:t.cost?.cacheRead!==void 0?`Read ${t.cost.cacheRead}`:`Write ${t.cost.cacheWrite}`})]}),t.description&&(0,i.Y)("div",{className:"pt-1.5 text-[10px] text-ink/60 font-sans leading-relaxed border-t border-ink/5",children:t.description})]})}):null}function rv(e){let{search:t,onSearchChange:n,onAddProvider:r,isLoading:a,filteredModels:l,favoriteModels:s,recentModels:o,providerGroups:c,collapsedSections:d,onToggleCollapse:p,selectedModelKey:u,modelIndex:m,focusedIndex:h,hoveredModel:b,onSelect:f,onToggleFavorite:x,onCycleThinking:g,onHoverItem:v,onMouseLeave:k}=e;return(0,i.FD)("div",{className:"absolute bottom-full left-0 mb-2.5 z-50 flex items-start",children:[(0,i.FD)("div",{className:"w-84 sm:w-96 bg-paper border border-ink/20 rounded-xl shadow-2xl flex flex-col overflow-hidden text-xs max-h-[460px] animate-in fade-in zoom-in-95 duration-100",children:[(0,i.Y)(rl,{search:t,onSearchChange:n,onAddProvider:r}),(0,i.Y)("div",{className:"flex-1 scrollbar-overlay-container scrollbar-overlay-static p-1.5 space-y-2 max-h-80",onMouseLeave:k,children:a?(0,i.Y)(rx,{}):0===l.length?(0,i.Y)("div",{className:"px-3 py-6 text-center text-ink/40 italic",children:t?(0,i.FD)(i.FK,{children:['No models found matching "',t,'"']}):(0,i.Y)(i.FK,{children:"No models available. Enable a provider in Settings → Providers."})}):(0,i.FD)(i.FK,{children:[(0,i.Y)(rh,{id:"favorites",title:"FAVORITES",iconType:"star",models:s,isCollapsed:!!d.favorites,onToggleCollapse:p,selectedModelKey:u,modelIndex:m,focusedIndex:h,onSelect:f,onToggleFavorite:x,onCycleThinking:g,onHoverItem:v}),(0,i.Y)(rh,{id:"recent",title:"RECENT",iconType:"recent",models:o,isCollapsed:!!d.recent,onToggleCollapse:p,selectedModelKey:u,modelIndex:m,focusedIndex:h,onSelect:f,onToggleFavorite:x,onCycleThinking:g,onHoverItem:v}),Object.entries(c).map(e=>{let[t,n]=e;return(0,i.Y)(rh,{id:t,title:t,iconType:"DEEPSEEK"===t?"whale":"provider",models:n,isCollapsed:!!d[t],onToggleCollapse:p,selectedModelKey:u,modelIndex:m,focusedIndex:h,onSelect:f,onToggleFavorite:x,onCycleThinking:g,onHoverItem:v},t)})]})}),(0,i.Y)(rb,{})]}),b&&(0,i.Y)("div",{className:"hidden lg:block ml-2 self-center",children:(0,i.Y)(rg,{model:b})})]})}function rk(e){let t=Array.isArray(e.thinkingLevels)?e.thinkingLevels:[],n=e.cost;return{id:e.id,name:e.name,provider:e.provider,contextWindow:e.contextWindow,thinkingLevel:t[0]??"off",thinkingLevels:t,capabilities:t.length>1?["Tool calling","Reasoning"]:["Tool calling"],cost:n?{input:void 0!==n.input?`$${n.input}`:"—",output:void 0!==n.output?`$${n.output}`:"—",cacheRead:void 0!==n.cacheRead?`$${n.cacheRead}`:void 0,cacheWrite:void 0!==n.cacheWrite?`$${n.cacheWrite}`:void 0}:void 0}}function ry(e){let{selectedModel:t,onSelectModel:n,onOpenAddProvider:r,onThinkingLevelChange:l,className:s=""}=e,[o,c]=(0,a.J0)(!1),[d,p]=(0,a.J0)(""),[u,m]=(0,a.J0)(-1),[h,b]=(0,a.J0)(null),[f,x]=(0,a.J0)({}),{models:g,isLoading:v,setModels:k,selectedModel:y,setSelectedModel:w}=function(e){let[t,n]=(0,a.J0)([]),[i,r]=(0,a.J0)(!0),[l,s]=(0,a.J0)(e??null),o=(0,a.li)(e);o.current=e;let c=(0,a.hb)(e=>{n(e)},[]),d=(0,a.hb)(async()=>{try{let e=await eH();if(Array.isArray(e.modelList)&&e.modelList.length>0){let t=e.modelList.map(rk);n(e=>t.map(t=>{let n=e.find(e=>e.id===t.id&&e.provider===t.provider);return n?.thinkingLevel&&t.thinkingLevels?.includes(n.thinkingLevel)?{...t,thinkingLevel:n.thinkingLevel}:t}));let i=e.defaultModel;if(i&&!o.current){let e=t.find(e=>e.id===i.modelId&&e.provider===i.provider);e&&s(e)}}else Array.isArray(e.models)&&e.models.length>0&&n(e.models);e.selectedModel&&!o.current&&s(e.selectedModel)}catch{}finally{r(!1)}},[]);return(0,a.vJ)(()=>(d(),eG(d)),[d]),(0,a.vJ)(()=>{e&&(s(e),n(t=>t.map(t=>t.id===e.id&&t.provider===e.provider?{...t,thinkingLevel:e.thinkingLevel}:t)))},[e]),{models:t,isLoading:i,setModels:c,selectedModel:l,setSelectedModel:s}}(t),N=(0,a.li)(null);(0,eM.W)(N,()=>{c(!1),b(null),m(-1)});let{filtered:Y,favorites:D,recent:A,byProvider:F,visibleFlatList:C,index:S}=(0,a.Kr)(()=>(function(e,t,n){let i=t.trim().toLowerCase(),r=i?e.filter(e=>e.name.toLowerCase().includes(i)||e.provider.toLowerCase().includes(i)||String(e.contextWindow??"").toLowerCase().includes(i)||e.capabilities?.some(e=>e.toLowerCase().includes(i))):e,a=r.filter(e=>e.isFavorite),l=r.filter(e=>e.isRecent&&!e.isFavorite),s={};for(let e of r){let t=e.provider.toUpperCase();(s[t]??=[]).push(e)}let o=[];for(let[e,t]of(n.favorites||o.push(...a),n.recent||o.push(...l),Object.entries(s)))n[e]||o.push(...t);let c={};return o.forEach((e,t)=>{c[rm(e)]=t}),{filtered:r,favorites:a,recent:l,byProvider:s,visibleFlatList:o,index:c}})(g,d,f),[g,d,f]),T=rm(y),M=async(e,t)=>{t.stopPropagation();let n=rm(e);k(e=>e.map(e=>rm(e)===n?{...e,isFavorite:!e.isFavorite}:e));try{await fetch("/api/models",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({actionType:"toggleFavorite",provider:e.provider,modelId:e.id})})}catch{}},z=e=>{let t=e.thinkingLevels??[];if(0===t.length)return;let i=e.thinkingLevel??t[0],r=t.indexOf(i),a=t[(r+1)%t.length],s=rm(e);if(k(e=>e.map(e=>rm(e)===s?{...e,thinkingLevel:a}:e)),T===s&&y){let e={...y,thinkingLevel:a};w(e),n?.(e),l?.(a)}},P=async e=>{let t=!e.isCmdAgent,n=rm(e);k(e=>e.map(e=>rm(e)===n?{...e,isCmdAgent:t}:e)),T===n&&y&&w({...y,isCmdAgent:t});try{await fetch("/api/models",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({actionType:"toggleCmd",provider:e.provider,modelId:e.id})})}catch{}},L=async e=>{w(e),n?.(e),c(!1),b(null);try{await fetch("/api/models",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({actionType:"selectModel",model:e})}),eW=null}catch{}};return(0,i.FD)("div",{className:`relative ${s}`,ref:N,onKeyDown:e=>{if(o){if("ArrowDown"===e.key)e.preventDefault(),m(e=>{let t=(e+1)%Math.max(1,C.length);return b(C[t]||null),t});else if("ArrowUp"===e.key)e.preventDefault(),m(e=>{let t=(e-1+C.length)%Math.max(1,C.length);return b(C[t]||null),t});else if("Enter"===e.key){e.preventDefault();let t=(u>=0?C[u]:null)||h;t&&L(t)}else if("Escape"===e.key)e.preventDefault(),c(!1),b(null);else if("Tab"===e.key){e.preventDefault();let t=(u>=0?C[u]:null)||h;t&&P(t)}else if("ArrowRight"===e.key||"ArrowLeft"===e.key){e.preventDefault();let t=(u>=0?C[u]:null)||h;t&&z(t)}}},children:[(0,i.FD)("button",{type:"button",onClick:()=>{c(e=>!e),b(null),m(-1)},className:"flex items-center space-x-1.5 hover:bg-ink/5 px-2 py-1 rounded transition-colors text-xs text-ink/80 font-medium cursor-pointer min-w-0 max-w-full",title:y?`${y.provider} • ${y.name}`:"Select a model",children:[y?(0,i.FD)(i.FK,{children:[(0,i.Y)("span",{className:"text-ink/60 flex-shrink-0",children:y.isCmdAgent?(0,i.Y)("span",{className:"font-mono text-[10px] font-bold text-ink/70",children:"⌘"}):"deepseek"===y.provider.toLowerCase()?(0,i.Y)("span",{children:"🐋"}):(0,i.Y)(eS.A,{size:12,className:"text-ink/60"})}),(0,i.FD)("span",{className:"flex items-center space-x-1 min-w-0 max-w-[280px]",children:[(0,i.Y)("span",{className:"text-ink/50 font-normal truncate",children:y.provider}),(0,i.Y)("span",{className:"text-ink/30 flex-shrink-0",children:"•"}),(0,i.Y)("span",{className:"truncate",children:y.name})]})]}):(0,i.FD)(i.FK,{children:[(0,i.Y)("span",{className:"text-ink/60 flex-shrink-0",children:(0,i.Y)(eS.A,{size:12,className:"text-ink/60"})}),(0,i.Y)("span",{className:"h-3 w-28 rounded animate-pulse bg-ink/10"})]}),(0,i.Y)(eT.A,{size:12,className:"text-ink/40 flex-shrink-0"})]}),o&&(0,i.Y)(rv,{search:d,onSearchChange:p,onAddProvider:()=>{c(!1),b(null),r?r():window.dispatchEvent(new CustomEvent("omp:open-settings",{detail:{category:"providers",autoOpenAdd:!0}}))},isLoading:v,filteredModels:Y,favoriteModels:D,recentModels:A,providerGroups:F,collapsedSections:f,onToggleCollapse:e=>{x(t=>({...t,[e]:!t[e]}))},selectedModelKey:T,modelIndex:S,focusedIndex:u,hoveredModel:h,onSelect:L,onToggleFavorite:M,onCycleThinking:z,onHoverItem:(e,t)=>{m(e),b(t)},onMouseLeave:()=>b(null)})]})}function rw(e){let{thinkingLevels:t,currentThinking:n,onSelect:r}=e,[l,s]=(0,a.J0)(!1),o=(0,a.li)(null);return(0,eM.W)(o,()=>s(!1)),(0,i.FD)("div",{className:"relative",ref:o,children:[(0,i.FD)("button",{onClick:()=>t.length>0&&s(!l),disabled:0===t.length,className:"flex items-center space-x-1 hover:bg-ink/5 px-2 py-1 rounded transition-colors text-xs text-ink/80 disabled:opacity-40 disabled:cursor-not-allowed",title:0===t.length?"This model exposes no thinking levels":`Thinking Level: ${n}`,children:[(0,i.Y)(rp.A,{size:12,className:"text-ink/60"}),(0,i.Y)("span",{className:"hidden lg:inline",children:n})]}),l&&t.length>0&&(0,i.FD)("div",{className:"absolute bottom-full left-0 mb-1 w-40 bg-paper border border-ink/20 rounded-md shadow-lg z-50 py-1 text-xs",children:[(0,i.Y)("div",{className:"px-3 py-1 text-[10px] uppercase tracking-wider text-ink/40 font-semibold mb-1",children:"Thinking Level"}),t.map(e=>(0,i.FD)("button",{onClick:()=>{s(!1),r(e)},className:"w-full text-left px-3 py-1.5 hover:bg-ink/5 flex items-center justify-between transition-colors",children:[(0,i.Y)("span",{children:e}),n===e&&(0,i.Y)(D.A,{size:12,className:"text-ink"})]},e))]})]})}var rN=n("wf");let rY=["always-ask","write","yolo"],rD={"always-ask":"Always ask",write:"Minimal",yolo:"Full bypass"},rA={"always-ask":"Read-only tools run automatically; writes and shell commands ask first.",write:"Reads and edits run automatically; shell commands ask first.",yolo:"Everything runs without asking."};function rF(e){let{value:t,onSelect:n}=e,[r,l]=(0,a.J0)(!1),s=(0,a.li)(null);return(0,eM.W)(s,()=>l(!1)),(0,i.FD)("div",{className:"relative",ref:s,children:[(0,i.FD)("button",{type:"button",onClick:()=>l(!r),className:"flex items-center space-x-1 hover:bg-ink/5 px-2 py-1 rounded transition-colors text-xs text-ink/80",children:[(0,i.Y)(rN.A,{size:12,className:"text-ink/60"}),(0,i.Y)("span",{className:"hidden lg:inline",children:rD[t]})]}),r&&(0,i.FD)("div",{className:"absolute bottom-full left-0 mb-1 w-40 bg-paper border border-ink/20 rounded-md shadow-lg z-50 py-1 text-xs",children:[(0,i.Y)("div",{className:"px-3 py-1 text-[10px] uppercase tracking-wider text-ink/40 font-semibold mb-1",children:"Access Control"}),rY.map(e=>(0,i.FD)("button",{type:"button",onClick:()=>{n(e),l(!1)},title:rA[e],className:"w-full text-left px-3 py-1.5 hover:bg-ink/5 flex items-center justify-between transition-colors",children:[(0,i.Y)("span",{children:rD[e]}),t===e&&(0,i.Y)(D.A,{size:12,className:"text-ink"})]},e))]})]})}function rC(e){let{isMobile:t,selectedModel:n,onSelectModel:r,thinkingLevels:a,currentThinking:l,onSelectThinking:s,onThinkingLevelChange:o,isGenerating:c,onStop:d,onSend:p,sendDisabled:u,accessMode:m,onSelectAccess:h}=e;return(0,i.FD)("div",{className:`flex items-center justify-between border-t border-ink/5 bg-canvas/50 rounded-b-md ${t?"px-2 py-2":"px-3 py-2"}`,children:[(0,i.FD)("div",{className:`flex items-center min-w-0 ${t?"space-x-1":"space-x-2"}`,children:[(0,i.Y)(ry,{selectedModel:n??void 0,onSelectModel:r,onThinkingLevelChange:o,className:t?"min-w-0 max-w-[58%]":void 0}),(0,i.Y)("div",{className:"w-[1px] h-3 bg-ink/10"}),(0,i.Y)(rw,{thinkingLevels:a,currentThinking:l,onSelect:s}),(0,i.Y)("div",{className:"w-[1px] h-3 bg-ink/10"}),(0,i.Y)(rF,{value:m,onSelect:h})]}),(0,i.FD)("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[c&&(!t||!!d)&&(0,i.Y)("button",{type:"button",onClick:d,className:`flex items-center justify-center rounded transition-colors cursor-pointer shadow-xs animate-in zoom-in-90 duration-150 flex-shrink-0 ${t?"w-10 h-10 rounded-lg border border-ink/25 text-ink hover:bg-error hover:text-canvas hover:border-error":"w-7 h-7 bg-ink text-canvas hover:bg-error hover:text-canvas"}`,title:"Stop generation",children:(0,i.Y)(ra.A,{size:t?14:10,className:"fill-current"})}),(!c||t)&&(0,i.Y)("button",{type:"button",onClick:p,disabled:u,className:`flex items-center justify-center rounded bg-ink text-canvas hover:bg-ink/80 transition-colors disabled:opacity-40 disabled:cursor-not-allowed cursor-pointer flex-shrink-0 ${t?"w-10 h-10 rounded-lg":"w-7 h-7"}`,title:c?"Queue follow-up message":"Send message",children:(0,i.Y)(N.A,{size:t?16:12,className:"ml-px"})})]})]})}let rS=/[\s([{]/,rT=/^file:/i;function rM(e){let{item:t}=e,n=t.match;return!n||n.start<0||n.start>=n.end||n.end>t.name.length?(0,i.Y)(i.FK,{children:t.name}):(0,i.FD)(i.FK,{children:[t.name.slice(0,n.start),(0,i.Y)("mark",{className:"bg-transparent font-semibold text-ink",children:t.name.slice(n.start,n.end)}),t.name.slice(n.end)]})}function rz(e){let{open:t,kind:n,items:r,activeIndex:l,loading:s,error:o,listboxId:c,optionId:d,onSelect:p,onHover:u}=e,m=(0,a.li)(null);if((0,a.vJ)(()=>{t&&m.current?.scrollIntoView({block:"nearest"})},[l,t,r.length]),!t)return null;let h="mention"===n;return(0,i.FD)("div",{role:"listbox",id:c,"aria-label":h?"Files and agents":"Commands and skills",className:"absolute left-0 right-0 bottom-full mb-1 z-50 min-w-[260px] flex max-h-60 flex-col rounded-md border border-ink/20 bg-paper shadow-lg text-sm",children:[(0,i.Y)("div",{className:"shrink-0 text-[10px] uppercase tracking-wider text-ink/40 px-3 py-1.5 border-b border-ink/10",children:h?"Type to search files and agents":"Type to search commands and skills"}),(0,i.Y)("div",{className:"flex-1 overflow-y-auto",children:o?(0,i.Y)("div",{className:"px-3 py-2 text-error",children:o}):s&&0===r.length?(0,i.Y)("div",{className:"px-3 py-2 text-ink/50",children:"Loading…"}):0===r.length?(0,i.Y)("div",{className:"px-3 py-2 text-ink/50",children:h?"No matching files or agents":"No matching commands or skills"}):r.slice(0,100).map((e,t)=>(0,i.FD)("div",{id:d(t),role:"option","aria-selected":t===l,ref:t===l?m:void 0,onMouseDown:e=>e.preventDefault(),onMouseEnter:()=>u(t),onClick:()=>p(e),className:`px-3 py-2 cursor-pointer ${t===l?"bg-ink/10":""}`,children:[(0,i.FD)("div",{className:"flex items-center justify-between gap-2",children:[(0,i.Y)("span",{className:"truncate",children:(0,i.Y)(rM,{item:e})}),"file"===e.source&&(0,i.Y)("span",{className:"text-ink/40 text-[10px] uppercase shrink-0",children:"file"}),"skill"===e.source&&(0,i.Y)("span",{className:"text-ink/40 text-[10px] uppercase shrink-0",children:"skill"})]}),(0,i.Y)("div",{className:"truncate text-ink/50 text-xs",children:e.description})]},e.id))}),(0,i.Y)("div",{className:"shrink-0 px-3 py-1.5 border-t border-ink/10 text-[10px] text-ink/40",children:"↑↓ navigate · Enter select · Esc close"})]})}function rP(e){let{value:t,onChange:n,onSend:r,disabled:l=!1,appSettings:s,placeholder:o,className:c,onPaste:d,rootPath:p,variant:u="desktop"}=e,m="mobile"===u,h=(0,a.li)(null),b=(0,a.li)(null),f=function(e){let{value:t,setValue:n,textareaRef:i,disabled:r=!1,rootPath:l}=e,[s,o]=(0,a.J0)(null),[c,d]=(0,a.J0)(0),p=(0,a.li)(!1),u=(0,a.li)(null),{items:m,loading:h,error:b}=function(e,t){let[n,i]=(0,a.J0)({items:[],loading:!1,error:null});return(0,a.vJ)(()=>{var n;if(!e)return void i({items:[],loading:!1,error:null});let r=!1;return i({items:[],loading:!0,error:null}),(n=t??null,"mention"===e?Promise.all([tI(),tE(n??null)]).then(e=>{let[t,n]=e;return[...t,...n]}):t$()).then(e=>{r||i({items:e,loading:!1,error:null})}).catch(e=>{r||i({items:[],loading:!1,error:e instanceof Error?e.message:String(e)})}),()=>{r=!0}},[e,t]),n}(s?.kind??null,l??null),f=(0,a.Kr)(()=>(function(e,t){let n=t.trim(),i=rT.test(n),r=i?e.filter(e=>"file"===e.source):e,a=i?n.replace(rT,"").trim():n;if(""===a)return r.map(e=>({...e,match:null}));let l=[];return r.forEach((e,t)=>{let n=function(e,t,n){let i=n.trim().toLowerCase();if(""===i)return null;let r=e.toLowerCase(),a=t.toLowerCase();if(r===i)return{tier:0,match:{start:0,end:e.length}};if(r.startsWith(i))return{tier:1,match:{start:0,end:i.length}};let l=r.indexOf(i);return l>=0?{tier:2,match:{start:l,end:l+i.length}}:a.includes(i)?{tier:3,match:null}:null}(e.name,e.description,a);n&&l.push({...n,index:t})}),l.sort((e,t)=>e.tier-t.tier||e.index-t.index),l.map(e=>({...r[e.index],match:e.match}))})(m,s?.query??""),[m,s?.query]),x=f.length>0?Math.min(Math.max(c,0),f.length-1):-1,g=(0,a.Bi)(),v=(0,a.hb)(e=>`${g}-option-${e}`,[g]),k=(0,a.hb)(()=>{o(null),d(0)},[]),y=(0,a.hb)(e=>{d(e)},[]),w=(0,a.hb)(()=>{p.current=!0},[]),N=(0,a.hb)(()=>{p.current=!1},[]),Y=(0,a.hb)(e=>{var t;let i=e.currentTarget,a=i.value,l=i.selectionStart??a.length;if(p.current||!0===(t=e).isComposing||t.inputType?.startsWith("insertFromPaste")===!0||t.inputType?.startsWith("insertFromDrop")===!0){n(a),k();return}(n(a),r)?k():(o(function(e,t){let n=Math.max(0,Math.min(t,e.length));for(let t=n-1;t>=0;t--){let i=e[t];if(/\s/.test(i))break;if("/"===i||"@"===i){if("/"===i){if(0!==t)return null;return{kind:"command",query:e.slice(t+1,n),start:t,end:n}}if(0===t||rS.test(e[t-1]))return{kind:"mention",query:e.slice(t+1,n),start:t,end:n};break}}return null}(a,l)),d(0))},[n,k,r]),D=(0,a.hb)(e=>{var i;if(!s)return;let r=(i=`${e.token} `,{value:t.slice(0,s.start)+i+t.slice(s.end),caret:s.start+i.length});u.current=r.caret,n(r.value),k()},[t,s,n,k]),A=(0,a.hb)(e=>!p.current&&229!==e.keyCode&&!!s&&("ArrowDown"===e.key||"ArrowUp"===e.key?(e.preventDefault(),f.length>0&&d((x+("ArrowDown"===e.key?1:-1)+f.length)%f.length),!0):("Enter"===e.key||"Tab"===e.key)&&f.length>0?(e.preventDefault(),e.stopPropagation(),D(f[x]),!0):"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),k(),!0)),[s,f,x,D,k]);return(0,a.Nf)(()=>{if(null==u.current)return;let e=u.current;u.current=null;let t=i.current;t&&(t.focus(),t.setSelectionRange(e,e))},[t,i]),{trigger:s,isOpen:null!==s,matches:f,loading:h,error:b,activeIndex:x,setActiveIndex:y,handleChange:Y,handleCompositionStart:w,handleCompositionEnd:N,handleKeyDown:A,selectItem:D,close:k,listboxId:g,optionId:v}}({value:t,setValue:n,textareaRef:h,disabled:l,rootPath:p});return(0,eM.W)(b,f.close),(0,i.FD)("div",{className:"relative",ref:b,children:[(0,i.Y)("textarea",{ref:h,value:t,onChange:f.handleChange,onCompositionStart:f.handleCompositionStart,onCompositionEnd:f.handleCompositionEnd,onKeyDown:e=>{if(f.handleKeyDown(e)||"Enter"!==e.key)return;let t=s?.keybindingSend||"Enter",n=s?.keybindingNewLine||"Shift + Enter",i=s?.keybindingSteering||"Ctrl / Cmd + Enter",a="u">typeof navigator&&navigator.platform.toUpperCase().indexOf("MAC")>=0?e.metaKey:e.ctrlKey,o=e.shiftKey,c=t=>"Enter"===t&&!o&&!a&&!e.altKey||"Shift + Enter"===t&&!!o&&!a&&!e.altKey||"Ctrl / Cmd + Enter"===t&&!o&&!!a&&!e.altKey,d=!o&&!a&&!e.altKey;(!m||!d)&&(c(i)?(e.preventDefault(),l||r({steering:!0})):c(t)?(e.preventDefault(),l||r()):c(n)||e.preventDefault())},onPaste:d,disabled:l,placeholder:o,enterkeyhint:m?"enter":void 0,className:c,"aria-autocomplete":"list","aria-expanded":f.isOpen,"aria-controls":f.listboxId,"aria-haspopup":"listbox","aria-activedescendant":f.isOpen&&f.matches.length>0?f.optionId(f.activeIndex):void 0}),(0,i.Y)(rz,{open:f.isOpen,kind:f.trigger?.kind??"mention",items:f.matches,activeIndex:f.activeIndex,loading:f.loading,error:f.error,listboxId:f.listboxId,optionId:f.optionId,onSelect:f.selectItem,onHover:f.setActiveIndex})]})}var rL=n("Bt"),rj=n("HD");function rR(e){let{attachments:t,onFilesSelected:n,onRemove:r}=e,l=(0,a.li)(null);return(0,i.FD)(i.FK,{children:[(0,i.FD)("div",{className:"flex items-center flex-wrap gap-1.5 px-3 py-2 border-b border-ink/5 text-ink/60",children:[(0,i.Y)("button",{onClick:()=>l.current?.click(),className:"flex items-center justify-center hover:bg-ink/5 p-1 rounded transition-colors text-ink/60 hover:text-ink shrink-0",title:"Attach file or image",children:(0,i.Y)(rL.A,{size:14})}),t.map(e=>(0,i.FD)("div",{className:"relative flex items-center bg-canvas border border-ink/10 rounded-md p-0.5 pr-6 text-xs shadow-sm group",children:[e.preview?(0,i.Y)("img",{src:e.preview,alt:"preview",className:"w-6 h-6 object-cover rounded-sm mr-1.5 border border-ink/5"}):(0,i.Y)("div",{className:"w-6 h-6 flex items-center justify-center bg-ink/5 rounded-sm mr-1.5 text-ink/60",children:(0,i.Y)(rj.A,{size:12})}),(0,i.Y)("span",{className:"truncate max-w-[120px] font-mono text-[10px] text-ink/80",children:e.file.name}),(0,i.Y)("button",{onClick:()=>r(e.id),className:"absolute right-0.5 top-1/2 -translate-y-1/2 p-0.5 text-ink/40 hover:text-error hover:bg-error/10 rounded transition-colors",title:"Remove attachment",children:(0,i.Y)(h.A,{size:10})})]},e.id))]}),(0,i.Y)("input",{type:"file",multiple:!0,className:"hidden",ref:l,onChange:e=>{e.currentTarget.files&&e.currentTarget.files.length>0&&n(Array.from(e.currentTarget.files)),l.current&&(l.current.value="")}})]})}let rI=["auto","off","minimal","low","medium","high","xhigh","max"];function rE(e){if(!e||0===e.length)return[];let t=new Set(e.filter(e=>e&&"auto"!==e));return[...rI.filter(e=>t.delete(e)),...t]}function r$(e){let{value:t,onChange:n,onSend:r,isGenerating:l,onStop:s,className:o="",disabled:c=!1,appSettings:d={},attachments:p,onAttachmentsChange:u,onThinkingLevelChange:m,onModelChange:h,sessionModel:b,sessionThinkingLevel:f,rootPath:x,variant:g="desktop",accessMode:v,onAccessModeChange:k,composerModelRef:y}=e,[w,N]=(0,a.J0)([]),Y=void 0!==p?p:w,D=e=>{u?u(e):N(e)},[A,F]=(0,a.J0)(null),[C,S]=(0,a.J0)("auto");(0,a.vJ)(()=>{A?.id&&(y.current={provider:A.provider,modelId:A.id,thinkingLevel:A.thinkingLevel??"auto"})},[A?.provider,A?.id,A?.thinkingLevel,y]);let T=(0,a.li)(null);T.current=f??null;let M=(0,a.li)(b??null);M.current=b??null;let z=(e,t)=>{let n=T.current;if(!n)return t;let i=rE(e??[]);return 0===i.length||i.includes(n)?n:t};(0,a.vJ)(()=>{if(!b?.provider||!b.modelId)return;let e=!0;return eH().then(t=>{if(!e||!b)return;let n=(t.modelList||[]).find(e=>e.id===b.modelId&&e.provider===b.provider);n&&F(e=>({id:n.id,name:n.name,provider:n.provider,contextWindow:n.contextWindow,thinkingLevels:n.thinkingLevels,thinkingLevel:z(n.thinkingLevels,e?.thinkingLevel??n.thinkingLevels?.[0]??"off")}))}).catch(()=>{}),()=>{e=!1}},[b?.provider,b?.modelId]),(0,a.vJ)(()=>{f&&F(e=>{if(!e)return e;let t=rE(e.thinkingLevels??[]),n=0===t.length||t.includes(f)?f:e.thinkingLevel;return n===e.thinkingLevel?e:{...e,thinkingLevel:n}})},[f]),(0,a.vJ)(()=>{let e=!0,t=async()=>{try{let t=await eH();if(!e)return;if(Array.isArray(t.modelList)&&t.modelList.length>0){let e=M.current;if(e?.provider&&e.modelId){let n=t.modelList.find(t=>t.id===e.modelId&&t.provider===e.provider);n&&F(e=>({id:n.id,name:n.name,provider:n.provider,thinkingLevels:n.thinkingLevels,thinkingLevel:z(n.thinkingLevels,e?.thinkingLevel??n.thinkingLevels?.[0]??"off")}));return}let n=t.selectedModel;if(n?.provider&&n.id){let e=t.modelList.find(e=>e.id===n.id&&e.provider===n.provider);if(e)return void F(t=>({id:e.id,name:e.name,provider:e.provider,thinkingLevels:e.thinkingLevels,thinkingLevel:z(e.thinkingLevels,t?.thinkingLevel??e.thinkingLevels?.[0]??"off")}))}let i=t.defaultModel;if(i){let e=t.modelList.find(e=>e.id===i.modelId&&e.provider===i.provider);e&&F(t=>({id:e.id,name:e.name,provider:e.provider,thinkingLevels:e.thinkingLevels,thinkingLevel:z(e.thinkingLevels,t?.thinkingLevel??e.thinkingLevels?.[0]??"off")}))}}else if(t.selectedModel){let e=t.selectedModel;F(t=>({...e,thinkingLevel:z(e.thinkingLevels,t?.thinkingLevel??e.thinkingLevel??"off")}))}}catch{}};t();let n=eG(t);return()=>{e=!1,n()}},[]);let P=(0,a.Kr)(()=>rE(A?.thinkingLevels),[A]);(0,a.vJ)(()=>{A?.thinkingLevel&&S(A.thinkingLevel)},[A?.thinkingLevel]);let L=e=>{let t=e.map(e=>({id:Math.random().toString(36).substring(7),file:e,preview:e.type.startsWith("image/")?URL.createObjectURL(e):""}));for(let e of(D(e=>[...e,...t]),t)){if(!e.file.type.startsWith("image/"))continue;let t=new FileReader;t.onload=()=>{let n=t.result.split(",")[1];n&&D(t=>t.map(t=>t.id===e.id?{...t,dataBase64:n}:t))},t.readAsDataURL(e.file)}},j=e=>{(t.trim()||0!==Y.length)&&(r(Y,e),D([]))},R="mobile"===g;return(0,i.FD)("div",{className:`relative border border-ink/20 rounded-md bg-paper focus-within:border-ink transition-colors flex flex-col shadow-sm ${o}`,children:[(0,i.Y)(rR,{attachments:Y,onFilesSelected:L,onRemove:e=>{D(t=>{let n=t.find(t=>t.id===e);return n&&n.preview&&URL.revokeObjectURL(n.preview),t.filter(t=>t.id!==e)})}}),(0,i.Y)(rP,{value:t,onChange:n,onSend:j,disabled:c,appSettings:d,rootPath:x,placeholder:c?"Please select a workspace above to start prompting...":"@ for files/agents; / for commands and skills; ! for shell; # for snippets (Paste images/files here)",className:`w-full bg-transparent border-none focus:outline-none resize-none text-ink placeholder-ink/40 disabled:opacity-50 disabled:cursor-not-allowed ${R?"px-3 py-3 text-base min-h-[68px] max-h-40":"px-3 py-3 text-sm min-h-[80px]"}`,onPaste:e=>{let t=e.clipboardData;t&&t.files.length>0&&(e.preventDefault(),L(Array.from(t.files)))},variant:g}),(0,i.Y)(rC,{isMobile:R,selectedModel:A,onSelectModel:e=>{F(e),h?.(e.provider,e.id)},thinkingLevels:P,currentThinking:C,onSelectThinking:e=>{S(e),F(t=>t?{...t,thinkingLevel:e}:t),m?.(e)},onThinkingLevelChange:m,isGenerating:l,onStop:s,onSend:()=>j(),sendDisabled:c||!t.trim()&&0===Y.length,accessMode:v,onSelectAccess:k})]})}var rO=n("Ih"),rJ=n("J"),r_=n("DT"),rU=n("d"),rK=n("pH");function rB(e){let{text:t,className:n="flex cursor-pointer items-center gap-1 rounded px-1.5 py-0.5 text-[10px] text-ink/45 transition-colors hover:bg-ink/5 hover:text-ink",iconSize:r=10,iconClassName:l,copiedIconClassName:s="text-success",label:o,copiedLabel:c="Copied",wrapLabel:d=!1,copiedLabelClassName:p,title:u,onClick:m,resetMs:h=2e3}=e,{copied:b,flagCopied:f}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2e3,[t,n]=(0,a.J0)(!1),i=(0,a.li)(null),r=(0,a.hb)(()=>{n(!0),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>n(!1),e)},[e]);return(0,a.vJ)(()=>()=>{i.current&&clearTimeout(i.current)},[]),{copied:t,flagCopied:r}}(h),x=async e=>{m?.(e),!t||await (0,rK.l)(t)&&f()},g=b?c:o;return(0,i.FD)("button",{type:"button",onClick:x,className:n,title:u,children:[b?(0,i.Y)(D.A,{size:r,className:s}):(0,i.Y)(tS.A,{size:r,className:l}),void 0!==g&&(d?(0,i.Y)("span",{className:b?p:void 0,children:g}):g)]})}function rW(e){let{thinking:t,defaultExpanded:n=!1,showSeparator:r=!1}=e,l="object"==typeof t&&!!t.isGenerating,[s,o]=(0,a.J0)(n||l),c=(0,a.li)(null);(0,a.vJ)(()=>{l&&o(!0)},[l]);let d="string"==typeof t?t:t.thought||"",p=d.match(/<system-notice[^>]*>([\s\S]*?)<\/system-notice>/),u=p?.[1]?.trim()??"",m=d.replace(/<system-notice[^>]*>[\s\S]*?<\/system-notice>/g,"").trim(),h="object"==typeof t?t.duration:void 0,b="object"==typeof t&&t.summary?t.summary:m.slice(0,100)+(m.length>100?"...":"");return((0,a.vJ)(()=>{if(!s||!l)return;let e=c.current;e&&(e.scrollTop=e.scrollHeight)},[s,m,l]),m)?(0,i.FD)("div",{className:`mx-3 ${r?"space-y-1.5":""}`,children:[r&&(0,i.FD)("div",{className:"flex items-center gap-2 px-1 pt-0.5",children:[(0,i.Y)("span",{className:"text-[9.5px] font-semibold uppercase tracking-[0.14em] text-ink/35",children:"Thinking"}),(0,i.Y)("span",{className:"h-px flex-1 bg-ink/8"})]}),(0,i.FD)("div",{className:"overflow-hidden rounded-xl border border-ink/10 bg-paper transition-colors hover:border-ink/20",children:[(0,i.FD)("button",{type:"button",onClick:()=>o(e=>!e),className:"flex w-full items-center gap-2.5 px-3 py-2.5 text-left transition-colors hover:bg-ink/[0.03] cursor-pointer select-none","aria-expanded":s,children:[(0,i.Y)("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-lg bg-ink/5 text-ink/70",children:(0,i.Y)(eS.A,{size:13})}),(0,i.FD)("span",{className:"flex min-w-0 flex-1 flex-col",children:[(0,i.FD)("span",{className:"flex items-center gap-1.5",children:[(0,i.Y)("span",{className:"text-[12px] font-semibold tracking-tight text-ink",children:"Thinking"}),l&&(0,i.Y)("span",{className:"h-1.5 w-1.5 rounded-full bg-ink/60 animate-pulse"})]}),!s&&b&&(0,i.Y)("span",{className:"truncate font-mono text-[10.5px] text-ink/45",children:b})]}),h&&(0,i.Y)("span",{className:"shrink-0 rounded-full bg-ink/5 px-2 py-0.5 font-mono text-[10px] text-ink/50",children:h}),(0,i.Y)(eT.A,{size:14,className:`shrink-0 text-ink/35 transition-transform duration-200 ${s?"rotate-180":""}`})]}),s&&(0,i.FD)("div",{className:"border-t border-ink/8 bg-canvas/40 px-3 py-3",children:[(0,i.FD)("div",{className:"flex items-center justify-between pb-1.5",children:[(0,i.Y)("span",{className:"text-[9.5px] font-semibold uppercase tracking-[0.14em] text-ink/40",children:"Model Reasoning & Strategy"}),(0,i.Y)(rB,{text:m,className:"flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[10px] text-ink/45 transition-colors hover:bg-ink/5 hover:text-ink",title:"Copy thinking",wrapLabel:!0,label:"Copy"})]}),u&&(0,i.FD)("div",{className:"mb-2 flex items-start gap-2.5 rounded-lg border border-ink/15 bg-paper px-3 py-2.5",children:[(0,i.Y)("span",{className:"mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-ink/10",children:(0,i.Y)(r_.A,{size:13,className:"text-ink/70"})}),(0,i.FD)("div",{className:"min-w-0 flex-1",children:[(0,i.Y)("div",{className:"mb-0.5 text-[9.5px] font-semibold uppercase tracking-[0.12em] text-ink/50",children:"System Notice"}),(0,i.Y)("div",{className:"text-[12px] leading-relaxed text-ink/85",children:(0,i.Y)(rU.T,{content:u,className:"text-[12px] text-ink/85 leading-relaxed"})})]})]}),(0,i.Y)("div",{ref:c,className:"max-h-72 overflow-auto border-l-2 border-ink/15 py-1 pl-3 text-ink/80 scrollbar-overlay-container scrollbar-overlay-static select-text",children:(0,i.Y)(rU.T,{content:m,className:"text-[12px] leading-relaxed text-ink/85 [&_.code-block]:my-2 [&_p]:my-1.5 [&_ul]:my-1.5 [&_ol]:my-1.5"})})]})]})]}):null}function rH(e){if(!0===e.synthetic||"skipped"===e.status||"aborted"===e.status)return!0;let t=e.details;return t?.__synthetic===!0||t?.source==="assistant_stop_skipped"||t?.executed===!1}var rq=n("Jr"),rG=n("SR"),rV=n("aP"),rQ=n("WO"),rZ=n("ke8"),rX=n("wJ"),r0=n("yy");function r1(e){let t,{tool:n,icon:r,title:l,subtitle:s,meta:o,isOpen:c,onToggle:d,defaultExpanded:p=!1,alwaysExpanded:u=!1,children:m}=e,[h,b]=(0,a.J0)(p),f=!u,x=u||(void 0!==c?c:h),g=n.status||(n.error?"error":"success"),v="running"===g,k=!!m,y=rH(n);return(0,i.FD)("div",{className:`group overflow-hidden rounded-xl border transition-all duration-200 ${"error"===g&&!y?"border-error/25 bg-error/[0.03]":v?"border-ink/15 bg-paper":y?"border-dashed border-ink/15 bg-paper/60 opacity-80":"border-ink/10 bg-paper hover:border-ink/20"} ${x?"shadow-sm":""}`,children:[(0,i.FD)("button",{type:"button",onClick:()=>{k&&f&&(d?d():b(e=>!e))},disabled:!k||!f,"aria-expanded":x,className:`flex w-full items-center gap-2.5 px-3 py-2.5 text-left transition-colors ${k&&f?"cursor-pointer hover:bg-ink/[0.03]":"cursor-default"} focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ink/20`,children:[(0,i.Y)("span",{className:`flex h-7 w-7 shrink-0 items-center justify-center rounded-lg transition-colors ${"error"===g&&!y?"bg-error/10 text-error":v?"bg-ink/8 text-ink":"bg-ink/5 text-ink/70 group-hover:bg-ink/8"}`,children:r}),(0,i.FD)("span",{className:"flex min-w-0 flex-1 flex-col",children:[(0,i.FD)("span",{className:"flex items-center gap-1.5",children:[(0,i.Y)("span",{className:"truncate text-[12px] font-semibold tracking-tight text-ink",children:l}),(t="h-1.5 w-1.5 rounded-full","running"===g?(0,i.Y)("span",{className:`${t} bg-ink/60 animate-pulse`}):y?(0,i.Y)("span",{className:`${t} bg-ink/30`}):"error"===g?(0,i.Y)("span",{className:`${t} bg-error`}):(0,i.Y)("span",{className:`${t} bg-success`}))]}),s&&(0,i.Y)("span",{className:"truncate font-mono text-[10.5px] text-ink/45",children:s})]}),(0,i.FD)("span",{className:"flex shrink-0 items-center gap-2",children:[o,function(e){if(rH(e))return(0,i.FD)("span",{className:"inline-flex items-center gap-1 rounded-full bg-ink/8 px-2 py-0.5 text-[10px] font-semibold text-ink/50",children:[(0,i.Y)(r0.A,{size:10})," Skipped"]});let t=e.status||(e.error?"error":"success");return"error"===t?(0,i.FD)("span",{className:"inline-flex items-center gap-1 rounded-full bg-error/10 px-2 py-0.5 text-[10px] font-semibold text-error",children:[(0,i.Y)(e7.A,{size:10})," Failed"]}):"running"===t?(0,i.FD)("span",{className:"inline-flex items-center gap-1 rounded-full bg-ink/8 px-2 py-0.5 text-[10px] font-semibold text-ink/60",children:[(0,i.Y)(tf.A,{size:10,className:"animate-spin"})," Running"]}):(0,i.FD)("span",{className:"inline-flex items-center gap-1 rounded-full bg-success/10 px-2 py-0.5 text-[10px] font-semibold text-success",children:[(0,i.Y)(D.A,{size:10})," Done"]})}(n),k&&f&&(0,i.Y)(eT.A,{size:14,className:`text-ink/35 transition-transform duration-200 ${x?"rotate-180":""}`})]})]}),x&&k&&(0,i.Y)("div",{className:"border-t border-ink/8 bg-canvas/40 px-3 py-3 code-surface",children:m})]})}var r2=n("qg"),r5=n("Po");function r3(e){let{text:t}=e,n=(0,a.Kr)(()=>(function(e){let t=[],n=null;for(let i of e.split(/\r?\n/)){if(i.startsWith("diff --git ")){n&&t.push(n),n=null;continue}if(i.startsWith("--- ")){n?n.oldPath=i.slice(4).replace(/^[ab]\//,""):n={oldPath:i.slice(4).replace(/^[ab]\//,""),newPath:"",lines:[]};continue}if(i.startsWith("+++ ")){n||(n={oldPath:"",newPath:"",lines:[]}),n.newPath=i.slice(4).replace(/^[ab]\//,"");continue}if(!n)if(!(i.startsWith("@@")||i.startsWith("+")||i.startsWith("-")))continue;else n={oldPath:"",newPath:"",lines:[]};i.startsWith("@@")?n.lines.push({kind:"meta",text:i}):i.startsWith("+")&&!i.startsWith("+++")?n.lines.push({kind:"add",text:i.slice(1)}):i.startsWith("-")&&!i.startsWith("---")?n.lines.push({kind:"del",text:i.slice(1)}):n.lines.push({kind:"context",text:i.startsWith(" ")?i.slice(1):i})}return n&&t.push(n),t})(t),[t]),r=(0,r5.w)(),l=(0,a.Kr)(()=>n.map(e=>{let t=(0,r2.sQ)(e.newPath||e.oldPath);return(0,r2.O9)(e.lines.map(e=>"meta"===e.kind?"":e.text).join("\n"),t)}),[n,r]);if(0===n.length)return(0,i.Y)("pre",{className:"max-h-48 overflow-auto whitespace-pre overflow-x-auto rounded-lg border border-ink/8 bg-paper p-3 font-mono text-[11px] leading-relaxed text-ink/80 select-text",children:t});let s=n.reduce((e,t)=>{for(let n of t.lines)"add"===n.kind?e.added++:"del"===n.kind&&e.removed++;return e},{added:0,removed:0});return(0,i.FD)("div",{className:"overflow-hidden rounded-lg border border-ink/8",children:[(0,i.FD)("div",{className:"flex items-center gap-2 border-b border-ink/8 bg-paper px-2.5 py-1.5",children:[(0,i.Y)("span",{className:"truncate font-mono text-[10.5px] text-ink/60",children:n[0]?.newPath||n[0]?.oldPath||"diff"}),n.length>1&&(0,i.FD)("span",{className:"rounded-full bg-ink/5 px-1.5 py-px font-mono text-[9.5px] text-ink/45",children:[n.length," files"]}),(0,i.FD)("span",{className:"ml-auto flex items-center gap-1.5 font-mono text-[10px]",children:[(0,i.FD)("span",{className:"text-success",children:["+",s.added]}),(0,i.FD)("span",{className:"text-error",children:["-",s.removed]})]})]}),(0,i.Y)("div",{className:"max-h-56 overflow-auto bg-paper font-mono text-[11px] leading-relaxed select-text",children:n.map((e,t)=>(0,i.Y)("div",{className:t>0?"border-t border-ink/6":"",children:e.lines.map((e,n)=>{let r="add"===e.kind?"bg-success/[0.07]":"del"===e.kind?"bg-error/[0.07]":"meta"===e.kind?"bg-ink/[0.04]":"",a="add"===e.kind?"text-success":"del"===e.kind?"text-error":"meta"===e.kind?"text-ink/45":"text-ink/70",s="add"===e.kind?"+":"del"===e.kind?"-":"meta"===e.kind?"@":" ",o=l[t]?.[n]||"";return(0,i.FD)("div",{className:`flex px-2.5 ${r}`,children:[(0,i.Y)("span",{className:`w-4 shrink-0 select-none font-bold ${a}`,children:s}),"meta"!==e.kind&&o?(0,i.Y)("span",{className:"shiki min-w-0 flex-1 whitespace-pre-wrap break-all",dangerouslySetInnerHTML:{__html:o}}):(0,i.Y)("span",{className:`min-w-0 flex-1 whitespace-pre-wrap break-all ${a}`,children:e.text||" "})]},n)})},t))})]})}var r4=n("rr"),r6=n("k8"),r8=n("dg");function r7(e){let{jsonString:t,title:n,maxHeightClass:r,showHeader:l=!0,className:s="",compact:o=!1,icon:c}=e,d=(0,a.Kr)(()=>t.split("\n"),[t]),p=(0,r5.w)(),u=(0,a.Kr)(()=>(0,r2.PH)(t),[t,p]);return(0,i.FD)("div",{className:`overflow-hidden ${o?"rounded-md":"rounded-lg"} border border-ink/8 bg-paper ${s}`,children:[l&&(0,i.FD)("div",{className:`flex items-center justify-between border-b border-ink/6 bg-canvas/40 ${o?"px-2.5 py-1":"px-3 py-1.5"}`,children:[(0,i.FD)("div",{className:"flex items-center gap-1.5 min-w-0",children:[c||(0,i.Y)(r8.A,{size:o?10.5:11,className:"text-ink/60 shrink-0"}),(0,i.Y)("span",{className:`font-mono ${o?"text-[10px]":"text-[10.5px]"} font-semibold text-ink truncate`,children:n||"JSON"}),(0,i.Y)("span",{className:`rounded bg-ink/5 px-1.5 py-0.2 font-mono ${o?"text-[8.5px]":"text-[9px]"} uppercase tracking-wider text-ink/50 shrink-0`,children:"JSON"}),(0,i.FD)("span",{className:`font-mono ${o?"text-[9px]":"text-[9.5px]"} text-ink/40 shrink-0`,children:[d.length," ",1===d.length?"line":"lines"]})]}),(0,i.Y)(rB,{text:t,className:"flex cursor-pointer items-center gap-1 rounded px-1.5 py-0.5 text-[9px] text-ink/45 transition-colors hover:bg-ink/5 hover:text-ink shrink-0",title:"Copy JSON",onClick:e=>e.stopPropagation(),label:"Copy"})]}),(0,i.FD)("div",{className:`flex ${r||(o?"max-h-40":"max-h-56")} items-start overflow-x-auto font-mono ${o?"text-[10.5px] leading-snug":"text-[11px] leading-relaxed"} select-text`,children:[(0,i.Y)("div",{className:`sticky left-0 flex-shrink-0 select-none border-r border-ink/6 bg-canvas/50 ${o?"py-1.5 pl-2 pr-1.5 text-[9.5px]":"py-2 pl-2.5 pr-2 text-[10px]"} text-right text-ink/25`,children:d.map((e,t)=>(0,i.Y)("div",{children:t+1},t))}),(0,i.Y)("pre",{className:`flex-1 overflow-x-auto ${o?"p-1.5":"p-2"} whitespace-pre text-ink/85 font-mono`,dangerouslySetInnerHTML:{__html:u}})]})]})}let r9={running:{icon:(0,i.Y)(tf.A,{size:11,className:"animate-spin text-ink/50"}),label:"running"},done:{icon:(0,i.Y)(th.A,{size:11,className:"text-success"}),label:"done"},failed:{icon:(0,i.Y)(r4.A,{size:11,className:"text-error"}),label:"failed"},aborted:{icon:(0,i.Y)(e8.A,{size:11,className:"text-ink/35"}),label:"aborted"}};function ae(e){return"number"==typeof e?tr(e)??"":""}function at(e){return"number"==typeof e?ta(e,3):""}function an(e){let{tool:t}=e,[n,r]=(0,a.J0)(!1),[l,s]=(0,a.J0)(!0),o=t.details??{},c=Array.isArray(o.results)?o.results:[],d=Array.isArray(o.progress)?o.progress:[],p=(0,a.Kr)(()=>t.output?(0,r2.Bl)(t.output):{isValid:!1},[t.output]),u="object"==typeof t.input&&null!==t.input?t.input:void 0,m="string"==typeof u?.context?u.context.trim():"",h=Array.isArray(u?.tasks)?u.tasks:[],b=(0,a.Kr)(()=>c.length>0?c:d.length>0?d:h.length>0?h.map((e,n)=>({id:`task-sub-${n}`,name:e.name,agent:e.agent||"scout",task:e.task,status:"success"===t.status?"done":"running"})):[],[c,d,h,t.status]);if(0===b.length&&!t.output&&!m)return null;let f=b.reduce((e,t)=>e+("number"==typeof t.tokens?t.tokens:0),0),x=b.reduce((e,t)=>e+("number"==typeof t.cost?t.cost:0),0);return(0,i.FD)("div",{className:"space-y-2.5",children:[b.length>0&&(0,i.FD)("div",{className:"overflow-hidden rounded-lg border border-ink/8 bg-paper",children:[(0,i.FD)("div",{className:"flex items-center gap-2 border-b border-ink/8 px-2.5 py-1.5",children:[(0,i.FD)("span",{className:"flex items-center gap-1 text-[9.5px] font-semibold uppercase tracking-[0.14em] text-ink/50",children:[(0,i.Y)(I.A,{size:11,className:"text-ink/60"}),"Subagents"]}),(0,i.FD)("span",{className:"ml-auto font-mono text-[10px] text-ink/45",children:[b.length," ",b.length>1?"agents":"agent",f?` \xb7 ${ae(f)} tok`:"",x?` \xb7 ${at(x)}`:""]})]}),(0,i.Y)("div",{className:"divide-y divide-ink/6 px-2.5 py-1",children:b.map((e,t)=>{var n;let r=!0===e.aborted?"aborted":"string"==typeof e.error&&e.error?"failed":"number"==typeof e.exitCode?0===e.exitCode?"done":"failed":"done"===e.status||"completed"===e.status||"success"===e.status?"done":"failed"===e.status?"failed":"aborted"===e.status?"aborted":"running",a=r9[r],l="string"==typeof e.name&&e.name?e.name:null,s="string"==typeof e.agent?e.agent:"scout",o=[ae(e.tokens),at(e.cost),"running"!==r?"number"!=typeof(n=e.durationMs)||!Number.isFinite(n)||n<1e3?"":`${Math.floor(n/1e3)}s`:""].filter(Boolean).join(" · ");return(0,i.FD)("div",{className:"flex items-center gap-2 py-1.5 text-[11.5px]",children:[(0,i.Y)("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded-md bg-ink/[0.04]",children:a.icon}),(0,i.Y)("span",{className:"shrink-0 font-mono text-[10.5px] font-semibold text-ink",children:l||s}),l&&(0,i.Y)("span",{className:"rounded bg-ink/5 px-1.5 py-0.2 font-mono text-[9px] text-ink/50",children:s}),(0,i.Y)("span",{className:"ml-auto shrink-0 font-mono text-[9.5px] text-ink/40",children:o||("done"===r?"settled":"running")})]},"string"==typeof e.id?e.id:`row-${t}`)})})]}),m&&(0,i.FD)("div",{className:"overflow-hidden rounded-lg border border-ink/8 bg-paper",children:[(0,i.FD)("button",{type:"button",onClick:()=>r(e=>!e),className:"flex w-full cursor-pointer items-center justify-between px-2.5 py-1.5 text-left transition-colors hover:bg-ink/[0.02]",children:[(0,i.FD)("span",{className:"flex items-center gap-1.5 text-[9.5px] font-semibold uppercase tracking-[0.14em] text-ink/50",children:[(0,i.Y)(r6.A,{size:11,className:"text-ink/60"}),"Goal & Constraints"]}),(0,i.Y)(eT.A,{size:12,className:`text-ink/40 transition-transform duration-150 ${n?"rotate-180":""}`})]}),n&&(0,i.Y)("div",{className:"border-t border-ink/8 bg-canvas/30 px-3 py-2 text-[11.5px] text-ink/80 select-text leading-relaxed",children:(0,i.Y)(rU.T,{content:m})})]}),h.length>0&&(0,i.FD)("div",{className:"overflow-hidden rounded-lg border border-ink/8 bg-paper",children:[(0,i.FD)("button",{type:"button",onClick:()=>s(e=>!e),className:"flex w-full cursor-pointer items-center justify-between px-2.5 py-1.5 text-left transition-colors hover:bg-ink/[0.02]",children:[(0,i.FD)("span",{className:"flex items-center gap-1.5 text-[9.5px] font-semibold uppercase tracking-[0.14em] text-ink/50",children:[(0,i.Y)(rG.A,{size:11,className:"text-ink/60"}),"Task Brief & Specification"]}),(0,i.Y)(eT.A,{size:12,className:`text-ink/40 transition-transform duration-150 ${l?"rotate-180":""}`})]}),l&&(0,i.Y)("div",{className:"divide-y divide-ink/8 border-t border-ink/8 bg-canvas/30",children:h.map((e,t)=>(0,i.FD)("div",{className:"p-3 space-y-1.5 text-[11.5px] text-ink/80 select-text",children:[(0,i.FD)("div",{className:"flex items-center gap-2",children:[(0,i.Y)("span",{className:"font-semibold text-ink text-[12px]",children:e.name||`Task #${t+1}`}),e.agent&&(0,i.Y)("span",{className:"rounded bg-ink/5 px-1.5 py-0.2 font-mono text-[9.5px] text-ink/60",children:e.agent})]}),e.task&&(0,i.Y)("div",{className:"text-ink/85 leading-relaxed font-sans",children:(0,i.Y)(rU.T,{content:e.task})})]},t))})]}),t.output&&(p.isValid&&p.pretty?(0,i.Y)(r7,{jsonString:p.pretty,title:"Yield Output",maxHeightClass:"max-h-72",showHeader:!0}):(0,i.FD)("div",{className:"overflow-hidden rounded-lg border border-ink/8 bg-paper",children:[(0,i.FD)("div",{className:"flex items-center gap-1.5 border-b border-ink/8 px-2.5 py-1.5 text-[9.5px] font-semibold uppercase tracking-[0.14em] text-ink/50",children:[(0,i.Y)(I.A,{size:11,className:"text-ink/60"}),(0,i.Y)("span",{children:"Yield Output"})]}),(0,i.Y)("div",{className:"bg-canvas/30 px-3 py-2 text-[11px] font-sans leading-relaxed text-ink/80 select-text",children:(0,i.Y)(rU.T,{content:t.output})})]}))]})}function ai(e){let t=e.replace(/:$/,"").trim();return(t=(t=(t=(t=t.replace(/^active\s+phase(?:\s+\d+\/\d+)?(?:\s*[:\-]\s*|\s+)?/i,"")).replace(/^["']|["']$/g,"")).replace(/\s*\(\d+(?:\/\d+)?\s*(?:done|remaining|tasks)?\)$/i,"")).replace(/^\((.+)\)$/,"$1")).trim()||"Tasks"}function ar(e){let t,n=e.input,i="object"==typeof n&&null!==n?n:void 0,r=e.output||"";i?.op==="done"&&i.task?t=`Completed: ${i.task}`:i?.op==="init"&&(t="Initialized Todo List");let a=r.split(/\r?\n/),l=[],s={phase:"Tasks",tasks:[]},o=!1;for(let e of a){let t=e.trim();if(!t)continue;if(t.endsWith(":")&&!t.startsWith("Overall")&&!t.startsWith("Remaining")){let e=ai(t);s.tasks.length>0&&l.push(s),s={phase:e,tasks:[]},o=!0;continue}let n=t.match(/^(?:[-*]\s*)?\[([ xX])\]\s*(.+)$/);if(n){let e=n[1].toLowerCase(),t=n[2].trim(),i="x"===e?"done":"pending";(t.includes("(in progress)")||t.includes("[in_progress]"))&&(i="in_progress",t=t.replace(/\(in progress\)/gi,"").replace(/\[in_progress\]/gi,"").trim()),s.tasks.push({text:t,status:i,phase:s.phase});continue}let i=t.match(/^-\s*(.+?)\s*\[(in_progress|pending|done)\](?:\s*\((.+?)\))?$/);if(i&&!o){let e=i[1].trim(),t=i[2],n=ai(i[3]?.trim()||"Tasks"),r=l.find(e=>ai(e.phase).toLowerCase()===n.toLowerCase());r||(r={phase:n,tasks:[]},l.push(r)),r.tasks.push({text:e,status:t,phase:n})}}if(s.tasks.length>0&&!l.includes(s)&&l.push(s),0===l.length&&Array.isArray(i?.list))for(let e of i.list){let t=ai(e.phase||"Tasks"),n=(e.items||[]).map(e=>({text:e,status:"pending",phase:t}));l.push({phase:t,tasks:n})}let c=function(e){let t=new Map;for(let n of e){if(!n.tasks.length)continue;let e=ai(n.phase),i=e.toLowerCase(),r=t.get(i);if(r){let t=n.tasks.length>=r.tasks.length?n.tasks:r.tasks,i=t===n.tasks?r.tasks:n.tasks,a=new Map;for(let n of t)a.set(n.text.toLowerCase().trim(),{...n,phase:e});for(let t of i){let n=t.text.toLowerCase().trim(),i=a.get(n);i?"done"===t.status?i.status="done":"in_progress"===t.status&&"done"!==i.status&&(i.status="in_progress"):a.set(n,{...t,phase:e})}r.phase=e,r.tasks=Array.from(a.values())}else t.set(i,{phase:e,tasks:[...n.tasks]})}let n=Array.from(t.values()),i=[];for(let e=0;e<n.length;e++){let t=n[e],r=t.tasks.map(e=>e.text.toLowerCase().trim()),a=!1;for(let i=0;i<n.length;i++){if(e===i)continue;let l=n[i],s=new Set(l.tasks.map(e=>e.text.toLowerCase().trim()));if(l.tasks.length>=t.tasks.length&&r.every(e=>s.has(e))){for(let e of t.tasks){let t=l.tasks.find(t=>t.text.toLowerCase().trim()===e.text.toLowerCase().trim());t&&("done"===e.status?t.status="done":"in_progress"===e.status&&"done"!==t.status&&(t.status="in_progress"))}a=!0;break}}a||i.push(t)}return i}(l);if(i?.op==="done"&&i.task){let e=String(i.task).toLowerCase().trim();for(let t of c){let n=t.tasks.find(t=>t.text.toLowerCase().trim()===e);n&&(n.status="done")}}let d=0,p=0,u=0;for(let e of c)for(let t of e.tasks)"done"===t.status?d++:"in_progress"===t.status?p++:u++;let m=d+p+u,h=r.match(/Overall:\s*(\d+)\/(\d+)\s*done/i)||r.match(/(\d+)\s+of\s+(\d+)\s+completed/i);if(h){let e=parseInt(h[1],10),t=parseInt(h[2],10);t>=m&&(d=e,u=Math.max(0,(m=t)-d-p))}let b=[];d>0&&b.push(`${d} complete`),p>0&&b.push(`${p} in progress`),u>0&&b.push(`${u} pending`);let f=b.length>0?b.join(" · "):m>0?`${m} items`:"";return{groups:c,totalDone:d,totalInProgress:p,totalPending:u,totalTasks:m,opBadge:t,summaryText:f}}var aa=n("ok");let al=/\x1b\][^\x07\x1b]*(?:\x07|\x1b\\)|\x1b[()][0-9A-B]|\x1b\[[0-9;?]*[A-Za-z]/g;function as(e){return e?e.includes("\x1b")?e.replace(al,"").replace(/\r\n/g,"\n").replace(/\r/g,"\n"):e.replace(/\r\n/g,"\n").replace(/\r/g,"\n"):""}let ao=/(^|\n)\s*(#{1,6}\s|```|`[^`\n]+`|>|[-*+]\s|\d+\.\s|\[[^\]]+\]\([^)]+\)|\|.*\|)/;function ac(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;if(!e)return{text:"",skipped:0};let n=e.split(/\r?\n/);return n.length<=t?{text:e,skipped:0}:{text:n.slice(n.length-t).join("\n"),skipped:n.length-t}}function ad(e){let t,{text:n}=e,r=(0,a.Kr)(()=>as(n),[n]),l=(0,a.Kr)(()=>(function(e){if(!e)return"text";let t=e.trim();if(!t)return"text";if(t.includes("```"))return"markdown";if(t.length<1e5&&(t.startsWith("{")||t.startsWith("[")))try{let e=JSON.parse(t);if(null!==e&&"object"==typeof e)return"json"}catch{}return ao.test(t)?"markdown":/^<(?:!doctype|html|div|section|article|table|ul|ol|h[1-6]|p|pre|code|span|a|b|strong|em|i|blockquote|form|button|input|img|nav|header|footer|main|aside|figure|figcaption|details|summary|label|select|option|textarea|video|audio|iframe|script|style|link|meta|title|body|head)\b/i.test(t)||/<[a-z][a-z0-9-]*\s[^>]*>[\s\S]*<\/[a-z][a-z0-9-]*>/i.test(t)&&/<\/[a-z][a-z0-9-]*>/i.test(t)?"html":"text"})(r),[r]),s=(0,a.Kr)(()=>"json"===l?(0,r2.Bl)(r):null,[l,r]),o=(0,a.Kr)(()=>s?.isValid&&s.linesCount?s.linesCount:r.split(/\r?\n/).length,[s,r]),c=(0,a.Kr)(()=>ac("json"===l&&s?.isValid&&s.pretty?s.pretty:r,1e3),[l,s,r]),d="markdown"!==l&&"json"!==l&&"html"!==l,p=(0,r5.w)(),u=(0,a.Kr)(()=>d?(0,r2.wY)(c.text,"javascript"):"",[d,c,p]),m=(0,a.Kr)(()=>s?.isValid&&s.pretty?s.pretty:r,[s,r]);if("markdown"===l)t=(0,i.Y)("div",{className:"prose-content max-h-72 overflow-auto rounded-lg border border-ink/8 bg-paper px-3 py-2.5 text-[12px] leading-relaxed text-ink/85 select-text",children:(0,i.Y)(rU.T,{content:c.text})});else if("json"===l)t=(0,i.Y)(r7,{jsonString:c.text,maxHeightClass:"max-h-72",showHeader:!1});else if("html"===l){let e=(0,aa.p)(c.text);t=(0,i.Y)("div",{className:"max-h-72 overflow-auto rounded-lg border border-ink/8 bg-paper px-3 py-2.5 text-[12px] leading-relaxed text-ink/85 select-text",dangerouslySetInnerHTML:{__html:e}})}else t=(0,i.Y)("pre",{className:"max-h-72 overflow-auto rounded-lg border border-ink/8 bg-paper px-3 py-2.5 font-mono text-[11px] leading-relaxed whitespace-pre-wrap break-words text-ink/80 select-text",dangerouslySetInnerHTML:{__html:u}});return(0,i.FD)("div",{className:"space-y-1.5",children:[(0,i.FD)("div",{className:"flex items-center justify-between",children:[(0,i.FD)("div",{className:"flex items-center gap-1.5 text-[9.5px] font-semibold uppercase tracking-[0.14em] text-ink/40",children:[(0,i.Y)(tW.A,{size:11,className:"text-ink/40"}),(0,i.Y)("span",{children:"Output"}),(0,i.Y)("span",{className:"rounded bg-ink/5 px-1.5 py-0.2 font-mono text-[9px] text-ink/45",children:l}),o>1&&(0,i.FD)("span",{className:"font-mono text-[9px] text-ink/35",children:[o," lines"]})]}),(0,i.Y)(rB,{text:m,className:"flex cursor-pointer items-center gap-1 rounded-md px-1.5 py-0.5 text-[10px] text-ink/45 transition-colors hover:bg-ink/5 hover:text-ink",onClick:e=>e.stopPropagation(),label:"Copy"})]}),c.skipped>0&&(0,i.FD)("div",{className:"font-mono text-[10px] text-ink/45",children:["… ",c.skipped," earlier lines hidden"]}),t]})}function ap(e){let{tool:t}=e,{groups:n,totalDone:r,totalInProgress:l,totalPending:s,totalTasks:o,opBadge:c}=(0,a.Kr)(()=>ar(t),[t]);if(0===n.length&&!c){let e=t.output||"";return e.trim()?(0,i.Y)(ad,{text:e}):null}let d=o>0?Math.round(r/o*100):0;return(0,i.FD)("div",{className:"space-y-2",children:[(0,i.FD)("div",{className:"rounded-lg border border-ink/8 bg-paper p-3",children:[(0,i.FD)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,i.FD)("div",{className:"flex items-center gap-2",children:[(0,i.Y)(rV.A,{size:13,className:"text-ink/60"}),(0,i.Y)("span",{className:"text-[11px] font-semibold text-ink",children:"Todo"}),c&&(0,i.Y)("span",{className:"rounded bg-success/10 px-2 py-0.5 font-mono text-[9.5px] font-medium text-success",children:c})]}),o>0&&(0,i.FD)("div",{className:"flex items-center gap-2 font-mono text-[10.5px]",children:[(0,i.FD)("span",{className:"text-ink/50",children:[r," of ",o," completed"]}),(0,i.FD)("span",{className:"rounded bg-ink/5 px-1.5 py-0.2 font-semibold text-ink",children:[d,"%"]})]})]}),o>0&&(r>0||l>0||s>0)&&(0,i.FD)("div",{className:"mt-2.5 flex flex-wrap items-center gap-1.5 font-mono text-[10px]",children:[r>0&&(0,i.FD)("span",{className:"inline-flex items-center gap-1 rounded bg-success/10 px-2 py-0.5 text-success",children:[(0,i.Y)(th.A,{size:11}),(0,i.FD)("span",{children:[r," complete"]})]}),l>0&&(0,i.FD)("span",{className:"inline-flex items-center gap-1 rounded bg-ink/8 px-2 py-0.5 text-ink/70",children:[(0,i.Y)(tf.A,{size:11,className:"animate-spin"}),(0,i.FD)("span",{children:[l," in progress"]})]}),s>0&&(0,i.FD)("span",{className:"inline-flex items-center gap-1 rounded bg-ink/5 px-2 py-0.5 text-ink/50",children:[(0,i.Y)(ra.A,{size:11}),(0,i.FD)("span",{children:[s," pending"]})]})]}),o>0&&(0,i.Y)("div",{className:"mt-2 h-1.5 overflow-hidden rounded-full bg-ink/8",children:(0,i.Y)("div",{className:"h-full rounded-full bg-success transition-all duration-300",style:{width:`${d}%`}})})]}),(0,i.Y)("div",{className:"space-y-2",children:n.map((e,t)=>(0,i.FD)("div",{className:"overflow-hidden rounded-lg border border-ink/8 bg-paper",children:[(0,i.FD)("div",{className:"flex items-center justify-between border-b border-ink/6 bg-canvas/40 px-3 py-1.5",children:[(0,i.Y)("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-ink/50",children:e.phase}),(0,i.FD)("span",{className:"font-mono text-[9.5px] text-ink/40",children:[e.tasks.filter(e=>"done"===e.status).length,"/",e.tasks.length]})]}),(0,i.Y)("div",{className:"divide-y divide-ink/[0.04] p-1",children:e.tasks.map((e,t)=>{let n="done"===e.status,r="in_progress"===e.status;return(0,i.FD)("div",{className:`flex items-start gap-2.5 px-2.5 py-1.5 text-[11.5px] transition-colors ${r?"bg-ink/[0.03]":""}`,children:[n?(0,i.Y)(th.A,{size:13,className:"mt-0.5 shrink-0 text-success"}):r?(0,i.Y)(tf.A,{size:13,className:"mt-0.5 shrink-0 animate-spin text-ink"}):(0,i.Y)(ra.A,{size:13,className:"mt-0.5 shrink-0 text-ink/25"}),(0,i.Y)("span",{className:`min-w-0 flex-1 leading-snug ${n?"text-ink/40 line-through":r?"font-medium text-ink":"text-ink/80"}`,children:e.text}),r&&(0,i.Y)("span",{className:"shrink-0 rounded bg-ink/8 px-1.5 py-0.2 font-mono text-[9px] uppercase tracking-wider text-ink/70",children:"In Progress"})]},t)})})]},t))})]})}var au=n("E6");function am(e){if(e&&"object"==typeof e&&"string"==typeof e.path)return e.path}function ah(e){let t="string"==typeof e.severity?e.severity.toLowerCase():"";return"error"===t||"1"===t?"error":"warning"===t||"2"===t?"warning":"info"}let ab={error:{Icon:e7.A,color:"text-error",text:"text-error",badge:"bg-error/10 text-error"},warning:{Icon:au.A,color:"text-warning",text:"text-warning",badge:"bg-warning/10 text-warning"},info:{Icon:eC.A,color:"text-ink/40",text:"text-ink/70",badge:"bg-ink/5 text-ink/50"}};function af(e){let{tool:t}=e,n=t.details??{},r=t.output??"",l=n.xdev?.args?.action==="capabilities"||"capabilities"===function(e){if(e&&"object"==typeof e&&"string"==typeof e.action)return e.action}(t.input)||r.includes("capabilities:"),s=(0,a.Kr)(()=>l?function(e){if(!e||!e.includes("capabilities:"))return[];let t=[];for(let n of e.split(/^(?=[A-Za-z0-9_-]+:)/m)){let e=n.trim();if(!e)continue;let i=e.match(/^([A-Za-z0-9_-]+):\s*capabilities:\s*(\{[\s\S]*\})/m);if(i){let e=i[1];try{let n=JSON.parse(i[2]);t.push({name:e,capabilities:n})}catch{t.push({name:e,capabilities:{}})}}}return t}(r):[],[l,r]),o=(0,a.Kr)(()=>l?[]:Array.isArray(n.diagnostics)?n.diagnostics:function(e){if(!e)return[];try{let t=JSON.parse(e);if(Array.isArray(t))return t;if(t&&"object"==typeof t){if(Array.isArray(t.diagnostics))return t.diagnostics;if(Array.isArray(t.errors))return t.errors}}catch{}let t=e.split(/\r?\n/).filter(Boolean),n=[],i=[],r="";for(let e of t){let t=e.trim();if(/^\d+\s+(?:error|warning|hint|info)\(s\):/i.test(t))continue;let a=t.match(/^(#{1,6})\s+(.+)$/);if(a){let e=a[1].length,t=a[2].trim();if(i.length=Math.min(i.length,e-1),t.endsWith("/"))i[e-1]=t;else{let e=i.filter(Boolean).join("");r=e?`${e.replace(/\/+$/,"")}/${t}`:t}continue}let l=e.match(/^\s*(\d+):(\d+)\s+\[(error|warning|info|hint)\]\s*(?:\[([^\]]+)\])?\s*(.*?)(?:\s*\((\d+|TS\d+)\))?$/i);if(l){n.push({file:r||void 0,line:parseInt(l[1],10),column:parseInt(l[2],10),severity:"hint"===l[3].toLowerCase()?"info":l[3].toLowerCase(),source:l[4]||void 0,message:l[5].trim(),code:l[6]||void 0});continue}let s=e.match(/^([^:\n]+):(\d+)(?::(\d+))?\s*[-:]?\s*(error|warning|info|hint)?\s*(?:(TS\d+|[A-Za-z0-9_-]+):)?\s*(.*)$/i);s&&n.push({file:s[1].trim(),line:parseInt(s[2],10),column:s[3]?parseInt(s[3],10):void 0,severity:s[4]?"hint"===s[4].toLowerCase()?"info":s[4].toLowerCase():"error",code:s[5]||void 0,message:s[6]?.trim()||e})}return n}(r),[n.diagnostics,l,r]);if(l&&s.length>0)return(0,i.Y)("div",{className:"space-y-2 select-text",children:(0,i.FD)("div",{className:"overflow-hidden rounded-lg border border-ink/8 bg-paper",children:[(0,i.FD)("div",{className:"flex items-center justify-between border-b border-ink/6 bg-canvas/40 px-3 py-1.5",children:[(0,i.FD)("div",{className:"flex items-center gap-2",children:[(0,i.Y)(ef.A,{size:13,className:"text-ink/60"}),(0,i.Y)("span",{className:"font-mono text-[10.5px] font-semibold text-ink",children:"Language Servers"}),(0,i.Y)("span",{className:"rounded bg-ink/5 px-1.5 py-0.2 font-mono text-[9px] uppercase tracking-wider text-ink/50",children:"Capabilities"})]}),(0,i.FD)("span",{className:"font-mono text-[10px] text-ink/40",children:[s.length," active"]})]}),(0,i.Y)("div",{className:"divide-y divide-ink/6 bg-canvas/30",children:s.map((e,t)=>{let n=Object.entries(e.capabilities).filter(e=>{let[,t]=e;return!!t}).map(e=>{let[t]=e;return t.replace(/Provider$/,"")});return(0,i.FD)("div",{className:"p-3 text-[11px]",children:[(0,i.FD)("div",{className:"flex items-center gap-2",children:[(0,i.Y)(j.A,{size:12,className:"text-ink/50"}),(0,i.Y)("span",{className:"font-mono font-medium text-ink",children:e.name}),(0,i.FD)("span",{className:"ml-auto inline-flex items-center gap-1 font-mono text-[9.5px] text-success",children:[(0,i.Y)(th.A,{size:10}),"Connected"]})]}),n.length>0&&(0,i.Y)("div",{className:"mt-2 flex flex-wrap gap-1",children:n.map((e,t)=>(0,i.Y)("span",{className:"rounded bg-ink/5 px-1.5 py-0.5 font-mono text-[9px] text-ink/60",children:e},t))})]},t)})})]})});if(0===o.length)return r?(0,i.Y)(ad,{text:r}):null;let c=e=>o.filter(t=>ah(t)===e),d=c("error").length,p=c("warning").length,u=c("info").length;return(0,i.FD)("div",{className:"overflow-hidden rounded-lg border border-ink/8 select-text",children:[(0,i.FD)("div",{className:"flex items-center gap-2 border-b border-ink/8 bg-paper px-2.5 py-1.5",children:[(0,i.Y)("span",{className:"text-[9.5px] font-semibold uppercase tracking-[0.14em] text-ink/40",children:"Diagnostics"}),(0,i.FD)("span",{className:"ml-auto flex items-center gap-2 font-mono text-[10px]",children:[d>0&&(0,i.FD)("span",{className:"flex items-center gap-1 text-error",children:[(0,i.Y)(e7.A,{size:9}),d]}),p>0&&(0,i.FD)("span",{className:"flex items-center gap-1 text-warning",children:[(0,i.Y)(au.A,{size:9}),p]}),u>0&&(0,i.FD)("span",{className:"flex items-center gap-1 text-ink/50",children:[(0,i.Y)(eC.A,{size:9}),u]})]})]}),(0,i.Y)("div",{className:"divide-y divide-ink/6 bg-canvas/40 py-1 max-h-72 overflow-auto",children:o.map((e,t)=>{let n,r,a,l=ab[ah(e)],s=(n="string"==typeof e.file?e.file:"string"==typeof e.path?e.path:"",r="number"==typeof e.line?e.line:void 0,a="number"==typeof e.column?e.column:void 0,n?void 0===r?n:void 0===a?`${n}:${r}`:`${n}:${r}:${a}`:""),o="string"==typeof e.message?e.message:"",c="string"==typeof e.code?e.code:void 0,d="string"==typeof e.source?e.source:void 0,{Icon:p,color:u,text:m}=l;return(0,i.FD)("div",{className:"flex items-start gap-2 px-2.5 py-1.5 text-[11.5px]",children:[(0,i.Y)("span",{className:"flex h-5 w-3.5 shrink-0 items-center justify-center",children:(0,i.Y)(p,{size:12,className:u})}),(0,i.FD)("span",{className:"min-w-0 flex-1 break-words leading-5",children:[s&&(0,i.FD)("span",{className:"font-mono text-[10px] text-ink/45 mr-1",children:[s,":"]}),(0,i.Y)("span",{className:m,children:o}),d&&(0,i.FD)("span",{className:"ml-1.5 font-mono text-[9px] text-ink/35",children:["[",d,"]"]}),c&&(0,i.FD)("span",{className:"ml-1 font-mono text-[9px] text-ink/35",children:["(",c,")"]})]})]},t)})})]})}function ax(e){return"string"==typeof e.url?e.url:"string"==typeof e.link?e.link:""}function ag(e){return"string"==typeof e.snippet&&e.snippet?e.snippet:"string"==typeof e.description?e.description:""}function av(e){let{tool:t}=e,n=t.details??{},r="string"==typeof n.response?.provider?n.response.provider:"string"==typeof n.provider?n.provider:void 0,a=Array.isArray(n.results)?n.results:Array.isArray(n.sources)?n.sources:Array.isArray(n.response?.sources)?n.response.sources:function(e){if(!e)return[];try{let t=JSON.parse(e);if(Array.isArray(t))return t;if(t&&"object"==typeof t){if(Array.isArray(t.results))return t.results;if(Array.isArray(t.sources))return t.sources;if(Array.isArray(t.organic))return t.organic;if(Array.isArray(t.items))return t.items;if(t.response&&Array.isArray(t.response.sources))return t.response.sources}}catch{}return[]}(t.output??"");return 0===a.length?t.output?(0,i.Y)(ad,{text:t.output}):null:(0,i.FD)("div",{className:"overflow-hidden rounded-lg border border-ink/8 bg-canvas/40",children:[r&&(0,i.FD)("div",{className:"flex items-center justify-between border-b border-ink/6 bg-paper px-2.5 py-1 text-[9.5px]",children:[(0,i.Y)("span",{className:"font-semibold uppercase tracking-wider text-ink/40",children:"Sources"}),(0,i.Y)("span",{className:"rounded bg-ink/5 px-1.5 py-0.2 font-mono text-ink/50 uppercase",children:r})]}),(0,i.Y)("ol",{className:"divide-y divide-ink/6",children:a.map((e,t)=>{let n=ax(e),r="string"==typeof e.publishedDate?e.publishedDate:void 0;return(0,i.FD)("li",{className:"px-2.5 py-2 text-[11.5px]",children:[(0,i.FD)("div",{className:"flex items-center gap-1.5",children:[(0,i.Y)("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center rounded bg-ink/5 font-mono text-[9px] text-ink/45",children:t+1}),(0,i.Y)("span",{className:"min-w-0 flex-1 truncate font-medium text-ink",children:"string"==typeof e.title&&e.title?e.title:ax(e)||"Result"}),n&&(0,i.Y)("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:"flex shrink-0 items-center rounded-md p-0.5 text-ink/40 transition-colors hover:bg-ink/5 hover:text-ink",title:n,children:(0,i.Y)(nm.A,{size:10})})]}),(0,i.FD)("div",{className:"flex items-center gap-2 pl-[22px] font-mono text-[9.5px] text-ink/40",children:[n&&(0,i.Y)("span",{className:"truncate",children:n}),r&&(0,i.Y)("span",{className:"shrink-0 rounded bg-ink/5 px-1 py-0.2 text-[8.5px] text-ink/50",children:r})]}),ag(e)&&(0,i.Y)("div",{className:"mt-0.5 pl-[22px] leading-snug text-ink/65",children:ag(e)})]},t)})})]})}var ak=n("sJ");function ay(e){let{tool:t}=e,n=t.input,r="object"==typeof n&&null!==n?n:void 0,l="string"==typeof r?.code?r.code:"string"==typeof n?n:"",s=("string"==typeof r?.language?r.language:"js").toUpperCase(),o="number"==typeof r?.timeout?`${r.timeout}s`:void 0,c="string"==typeof r?.title?r.title:void 0,d=t.output||(t.error?`Error: ${t.error}`:""),p="error"===t.status||d.includes("ToolError:")||d.includes("Command exited with code"),u=d.includes("Command aborted")||"aborted"===t.status,m=(0,r5.w)(),h=(0,a.Kr)(()=>p||u?{isValid:!1}:(0,r2.Bl)(d),[d,p,u]),b=(0,a.Kr)(()=>ac(l,1e3),[l]),f=(0,a.Kr)(()=>(0,r2.wY)(b.text,"javascript"),[b,m]),g=(0,a.Kr)(()=>ac(d,1e3),[d]),v=(0,a.Kr)(()=>h.isValid&&h.pretty?ac(h.pretty,1e3):null,[h]),k=(0,a.Kr)(()=>v?(0,r2.PH)(v.text):"",[v,m]);return(0,i.FD)("div",{className:"space-y-2",children:[l&&(0,i.FD)("div",{className:"overflow-hidden rounded-lg border border-ink/8 bg-paper",children:[(0,i.FD)("div",{className:"flex items-center justify-between border-b border-ink/6 bg-canvas/40 px-3 py-1.5",children:[(0,i.FD)("div",{className:"flex items-center gap-2",children:[(0,i.Y)(eo.A,{size:12,className:"text-ink/60"}),(0,i.Y)("span",{className:"font-mono text-[10.5px] font-semibold text-ink",children:c||"Script Evaluation"}),(0,i.Y)("span",{className:"rounded bg-ink/5 px-1.5 py-0.2 font-mono text-[9px] uppercase tracking-wider text-ink/50",children:s}),o&&(0,i.FD)("span",{className:"flex items-center gap-1 font-mono text-[9.5px] text-ink/40",children:[(0,i.Y)(x.A,{size:10}),(0,i.Y)("span",{children:o})]})]}),(0,i.Y)(rB,{text:l,className:"flex cursor-pointer items-center gap-1 rounded px-1.5 py-0.5 text-[9.5px] text-ink/45 transition-colors hover:bg-ink/5 hover:text-ink",label:"Copy"})]}),b.skipped>0&&(0,i.FD)("div",{className:"border-b border-ink/6 bg-canvas/40 px-3 py-1 font-mono text-[9.5px] text-ink/45",children:["… ",b.skipped," earlier lines hidden"]}),(0,i.FD)("div",{className:"flex max-h-56 items-start overflow-x-auto font-mono text-[11px] leading-relaxed select-text",children:[(0,i.Y)("div",{className:"sticky left-0 flex-shrink-0 select-none border-r border-ink/6 bg-canvas/50 py-2.5 pl-2.5 pr-2 text-right text-[10px] text-ink/25",children:b.text.split("\n").map((e,t)=>(0,i.Y)("div",{children:t+1},t))}),(0,i.Y)("pre",{className:"flex-1 overflow-x-auto p-2.5 whitespace-pre text-ink/85 font-mono",dangerouslySetInnerHTML:{__html:f}})]})]}),d&&(0,i.FD)("div",{className:`overflow-hidden rounded-lg border ${p?"border-error/25 bg-error/[0.03]":u?"border-warning/25 bg-warning/[0.03]":"border-ink/8 bg-paper"}`,children:[(0,i.FD)("div",{className:`flex items-center justify-between border-b px-3 py-1.5 ${p?"border-error/15 bg-error/[0.06]":u?"border-warning/15 bg-warning/[0.06]":"border-ink/6 bg-canvas/30"}`,children:[(0,i.Y)("div",{className:"flex items-center gap-1.5",children:p?(0,i.FD)(i.FK,{children:[(0,i.Y)(e7.A,{size:11,className:"text-error"}),(0,i.Y)("span",{className:"text-[9.5px] font-semibold uppercase tracking-wider text-error",children:"Execution Error"})]}):u?(0,i.FD)(i.FK,{children:[(0,i.Y)(e8.A,{size:11,className:"text-warning"}),(0,i.Y)("span",{className:"text-[9.5px] font-semibold uppercase tracking-wider text-warning",children:"Evaluation Aborted"})]}):(0,i.FD)(i.FK,{children:[(0,i.Y)(ak.A,{size:11,className:"text-success"}),(0,i.Y)("span",{className:"text-[9.5px] font-semibold uppercase tracking-wider text-ink/50",children:"Evaluation Result"}),h.isValid&&(0,i.FD)(i.FK,{children:[(0,i.Y)("span",{className:"rounded bg-ink/5 px-1.5 py-0.2 font-mono text-[9px] uppercase tracking-wider text-ink/50",children:"JSON"}),h.linesCount&&h.linesCount>1&&(0,i.FD)("span",{className:"font-mono text-[9.5px] text-ink/40",children:[h.linesCount," lines"]})]})]})}),(0,i.Y)(rB,{text:h.isValid&&h.pretty?h.pretty:d,className:"flex cursor-pointer items-center gap-1 rounded px-1.5 py-0.5 text-[9.5px] text-ink/45 transition-colors hover:bg-ink/5 hover:text-ink",label:"Copy"})]}),h.isValid&&h.pretty?(0,i.FD)(i.FK,{children:[v&&v.skipped>0&&(0,i.FD)("div",{className:"border-b border-ink/6 bg-canvas/40 px-3 py-1 font-mono text-[9.5px] text-ink/45",children:["… ",v.skipped," earlier lines hidden"]}),(0,i.FD)("div",{className:"flex max-h-56 items-start overflow-x-auto font-mono text-[11px] leading-relaxed select-text",children:[(0,i.Y)("div",{className:"sticky left-0 flex-shrink-0 select-none border-r border-ink/6 bg-canvas/50 py-2 pl-2.5 pr-2 text-right text-[10px] text-ink/25",children:(v?v.text:h.pretty).split("\n").map((e,t)=>(0,i.Y)("div",{children:t+1},t))}),(0,i.Y)("pre",{className:"flex-1 overflow-x-auto p-2.5 whitespace-pre text-ink/85 font-mono",dangerouslySetInnerHTML:{__html:k}})]})]}):(0,i.FD)(i.FK,{children:[g.skipped>0&&(0,i.FD)("div",{className:"border-b border-ink/6 bg-canvas/40 px-3 py-1 font-mono text-[9.5px] text-ink/45",children:["… ",g.skipped," earlier lines hidden"]}),(0,i.Y)("pre",{className:`max-h-48 overflow-y-auto p-3 font-mono text-[11px] leading-relaxed whitespace-pre-wrap break-words select-text ${p?"text-error":u?"text-warning":"text-ink/80"}`,children:g.text})]})]})]})}var aw=n("DB");let aN={open:"bg-success/10 text-success",merged:"bg-ink/10 text-ink/60",closed:"bg-error/10 text-error"};function aY(e){let{tool:t}=e,n=t.details??{},r=Array.isArray(n.items)?n.items:function(e){if(!e)return[];try{let t=JSON.parse(e);if(Array.isArray(t))return t;if(t&&"object"==typeof t){if(Array.isArray(t.items))return t.items;if(Array.isArray(t.pullRequests))return t.pullRequests;if(Array.isArray(t.issues))return t.issues}}catch{}return[]}(t.output??"");return 0===r.length?t.output?(0,i.Y)(ad,{text:t.output}):null:(0,i.Y)("ul",{className:"divide-y divide-ink/6 overflow-hidden rounded-lg border border-ink/8 bg-canvas/40",children:r.map((e,t)=>{let n=!0===e.merged||"merged"===e.state?"merged":"closed"===e.state?"closed":"open",r="string"==typeof e.title?e.title:"",a="number"==typeof e.number?`#${e.number}`:"",l="string"==typeof e.author?e.author:"",s="number"==typeof e.additions?e.additions:void 0,o="number"==typeof e.deletions?e.deletions:void 0;return(0,i.FD)("li",{className:"px-2.5 py-2 text-[11.5px]",children:[(0,i.FD)("div",{className:"flex items-center gap-1.5",children:["merged"===n?(0,i.Y)(aw.A,{size:12,className:"shrink-0 text-success"}):"closed"===n?(0,i.Y)(rZ.A,{size:12,className:"shrink-0 text-error"}):(0,i.Y)(nu.A,{size:12,className:"shrink-0 text-success"}),(0,i.Y)("span",{className:"min-w-0 flex-1 truncate font-medium text-ink",children:r}),a&&(0,i.Y)("span",{className:"shrink-0 font-mono text-[10px] text-ink/45",children:a})]}),(0,i.FD)("div",{className:"mt-1 flex items-center gap-1.5 pl-[18px] text-[10px] text-ink/50",children:[(0,i.Y)("span",{className:`rounded-full px-1.5 py-px font-mono ${aN[n]}`,children:n}),l&&(0,i.Y)("span",{children:l}),(void 0!==s||void 0!==o)&&(0,i.FD)("span",{className:"ml-auto font-mono",children:[void 0!==s&&(0,i.FD)("span",{className:"text-success",children:["+",s]}),void 0!==o&&(0,i.FD)("span",{className:"ml-1 text-error",children:["-",o]})]})]})]},t)})})}function aD(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date;return new Date(e).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"})}function aA(e){if(!e.startsWith("Today,"))return null;let t=e.slice(6).trim(),n=new Date(`${new Date().toDateString()} ${t}`);return Number.isNaN(n.getTime())?null:n.getTime()}function aF(e){let{tool:t}=e,n=t.details??{},r=n&&"object"==typeof n?n:{},a="rewind"===t.type,l="string"==typeof r.id?r.id:void 0,s=function(e){if("number"==typeof e){let t=new Date(e);return Number.isNaN(t.getTime())?"":t.toLocaleTimeString()}return"string"==typeof e?e:""}(r.timestamp),o="number"==typeof r.fileCount?r.fileCount:void 0,c="string"==typeof r.branch?r.branch:void 0,d="string"==typeof r.message?r.message:"string"==typeof r.description?r.description:"";return l||s||o||c||d?(0,i.FD)("div",{className:"flex items-start gap-2.5 rounded-lg border border-ink/8 bg-canvas/40 px-3 py-2.5",children:[(0,i.Y)("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-ink/5 text-ink/60",children:a?(0,i.Y)(tK.A,{size:12}):(0,i.Y)(ey.A,{size:12})}),(0,i.FD)("div",{className:"min-w-0 flex-1 space-y-0.5",children:[d&&(0,i.Y)("div",{className:"text-[11.5px] text-ink/85",children:d}),(0,i.FD)("div",{className:"flex flex-wrap gap-x-2 gap-y-0.5 font-mono text-[9.5px] text-ink/45",children:[l&&(0,i.Y)("span",{children:l}),s&&(0,i.Y)("span",{children:s}),void 0!==o&&(0,i.FD)("span",{children:[o," files"]}),c&&(0,i.Y)("span",{children:c})]})]})]}):t.output?.trim()?(0,i.Y)(ad,{text:t.output}):null}function aC(e){var t;let n,{tool:r}=e,l=r.details??{},s="object"==typeof r.input&&null!==r.input?r.input:void 0,o=r.command||("string"==typeof s?.command?s.command:void 0)||("string"==typeof s?.cmd?s.cmd:void 0)||("string"==typeof s?.CommandLine?s.CommandLine:void 0)||("string"==typeof s?.commandLine?s.commandLine:void 0)||("string"==typeof r.input?r.input:""),{cleanText:c,wallTime:d}=(n=(t=r.output||(r.error?`Error: ${r.error}`:"")).match(/\n*Wall time:\s*([^\n\r]+)$/))?{cleanText:t.replace(/\n*Wall time:\s*[^\n\r]+$/,""),wallTime:n[1].trim()}:{cleanText:t},p="number"==typeof l.exitCode?l.exitCode:r.isError?1:void 0,u=("string"==typeof l.cwd?l.cwd:void 0)||("string"==typeof s?.cwd?s.cwd:void 0)||("string"==typeof s?.Cwd?s.Cwd:void 0),m="number"==typeof l.durationMs?l.durationMs:r.durationMs,h=r.duration||d||(m?`${m}ms`:void 0),b=!c||"(no output)"===c,f=(0,a.Kr)(()=>b||r.isError?{isValid:!1}:(0,r2.Bl)(c),[c,b,r.isError]),g=(0,a.Kr)(()=>as(c),[c]),v=(0,a.Kr)(()=>ac(g,1e3),[g]),k=(0,a.Kr)(()=>f.isValid&&f.pretty?f.pretty:g,[f,g]),y=(0,a.Kr)(()=>(0,r2.rw)(g),[g]),w=(0,a.Kr)(()=>g.trim().startsWith("{")||g.trim().startsWith("[")?"json":"javascript",[g]),N=(0,a.Kr)(()=>f.isValid&&f.pretty?ac(f.pretty,1e3):null,[f]),Y=(0,r5.w)(),A=(0,a.Kr)(()=>o?(0,r2.wY)(o,"bash"):"",[o,Y]),F=(0,a.Kr)(()=>y?(0,r2.wY)(v.text,w):"",[y,v,w,Y]);return(0,i.FD)("div",{className:"space-y-2",children:[o&&(0,i.FD)("div",{className:"overflow-hidden rounded-lg border border-ink/10 bg-paper",children:[(0,i.FD)("div",{className:"flex items-center justify-between border-b border-ink/6 bg-canvas/60 px-3 py-1.5",children:[(0,i.FD)("div",{className:"flex items-center gap-2",children:[(0,i.FD)("div",{className:"flex items-center gap-1",children:[(0,i.Y)("span",{className:"h-2 w-2 rounded-full bg-ink/20"}),(0,i.Y)("span",{className:"h-2 w-2 rounded-full bg-ink/20"}),(0,i.Y)("span",{className:"h-2 w-2 rounded-full bg-ink/20"})]}),(0,i.Y)("span",{className:"font-mono text-[10px] font-semibold text-ink/50",children:"bash"}),u&&(0,i.Y)("span",{className:"truncate font-mono text-[9.5px] text-ink/40",title:u,children:u})]}),(0,i.FD)("div",{className:"flex items-center gap-2",children:[void 0!==p&&(0,i.FD)("span",{className:`rounded-full px-1.5 py-0.2 font-mono text-[9px] font-semibold ${0===p?"bg-success/10 text-success":"bg-error/10 text-error"}`,children:["exit ",p]}),h&&(0,i.FD)("span",{className:"flex items-center gap-1 font-mono text-[9.5px] text-ink/45",children:[(0,i.Y)(x.A,{size:10}),(0,i.Y)("span",{children:h})]}),(0,i.Y)(rB,{text:o,className:"flex cursor-pointer items-center gap-1 rounded px-1.5 py-0.5 text-[9.5px] text-ink/45 transition-colors hover:bg-ink/5 hover:text-ink",title:"Copy command",label:"Copy"})]})]}),(0,i.FD)("div",{className:"flex items-start gap-2.5 px-3 py-2 font-mono text-[11.5px] leading-relaxed",children:[(0,i.Y)("span",{className:"select-none font-bold text-ink/40",children:"$"}),(0,i.Y)("pre",{className:"min-w-0 flex-1 overflow-x-auto whitespace-pre-wrap break-all text-ink/90 select-text",dangerouslySetInnerHTML:{__html:A}})]})]}),b?(0,i.FD)("div",{className:"flex items-center justify-between rounded-lg border border-dashed border-ink/15 bg-canvas/30 px-3 py-2 font-mono text-[11px] text-ink/50",children:[(0,i.FD)("div",{className:"flex items-center gap-2",children:[(0,i.Y)(D.A,{size:12,className:"text-success"}),(0,i.Y)("span",{children:"Command executed successfully with no output"})]}),h&&(0,i.FD)("span",{className:"text-[10px] text-ink/40",children:["Wall time: ",h]})]}):f.isValid&&f.pretty?(0,i.FD)("div",{className:"overflow-hidden rounded-lg border border-ink/8 bg-paper",children:[(0,i.FD)("div",{className:"flex items-center justify-between border-b border-ink/6 bg-canvas/30 px-3 py-1.5",children:[(0,i.FD)("div",{className:"flex items-center gap-1.5",children:[(0,i.Y)("span",{className:"text-[9.5px] font-semibold uppercase tracking-[0.14em] text-ink/40",children:"Console Output"}),(0,i.Y)("span",{className:"rounded bg-ink/5 px-1.5 py-0.2 font-mono text-[9px] uppercase tracking-wider text-ink/50",children:"JSON"}),f.linesCount&&f.linesCount>1&&(0,i.FD)("span",{className:"font-mono text-[9.5px] text-ink/40",children:[f.linesCount," lines"]})]}),(0,i.Y)(rB,{text:f.isValid&&f.pretty?f.pretty:c,className:"flex cursor-pointer items-center gap-1 rounded px-1.5 py-0.5 text-[9.5px] text-ink/45 transition-colors hover:bg-ink/5 hover:text-ink",label:"Copy"})]}),N&&N.skipped>0&&(0,i.FD)("div",{className:"border-b border-ink/6 bg-canvas/40 px-3 py-1 font-mono text-[9.5px] text-ink/45",children:["… ",N.skipped," earlier lines hidden"]}),(0,i.Y)(r7,{jsonString:N?N.text:f.pretty,maxHeightClass:"max-h-72",showHeader:!1})]}):(0,i.FD)("div",{className:"overflow-hidden rounded-lg border border-ink/8 bg-paper",children:[(0,i.FD)("div",{className:"flex items-center justify-between border-b border-ink/6 bg-canvas/30 px-3 py-1.5",children:[(0,i.Y)("span",{className:"text-[9.5px] font-semibold uppercase tracking-[0.14em] text-ink/40",children:"Console Output"}),(0,i.Y)(rB,{text:k,className:"flex cursor-pointer items-center gap-1 rounded px-1.5 py-0.5 text-[9.5px] text-ink/45 transition-colors hover:bg-ink/5 hover:text-ink",label:"Copy"})]}),v.skipped>0&&(0,i.FD)("div",{className:"border-b border-ink/6 bg-canvas/40 px-3 py-1 font-mono text-[9.5px] text-ink/45",children:["… ",v.skipped," earlier lines hidden"]}),(0,i.Y)("div",{className:"max-h-72 overflow-y-auto overscroll-contain p-3 font-mono text-[11px] leading-relaxed select-text",children:y?(0,i.Y)("pre",{className:"overflow-x-auto whitespace-pre text-ink/85 leading-relaxed",dangerouslySetInnerHTML:{__html:F}}):v.text.split("\n").map((e,t)=>{let n=e.includes("✓")||e.includes("built in")||e.includes("ready: 0 errors"),r=e.includes("Error:")||e.includes("error:")||e.includes("FAILED"),a=e.includes("warning:")||e.includes("warn:");return(0,i.Y)("div",{className:`whitespace-pre-wrap break-words ${n?"text-success font-medium":r?"text-error font-medium":a?"text-warning font-medium":"text-ink/80"}`,children:e||" "},t)})})]})]})}var aS=n("W0"),aT=n("jx");function aM(e){let{tool:t}=e,[n,r]=(0,a.J0)(""),l=t.details??{},s=t.output||("string"==typeof l.displayContent?l.displayContent:""),o=function(e){let t=e.input;if(t&&"object"==typeof t){if("string"==typeof t.pattern)return t.pattern;if("string"==typeof t.path)return t.path;if("string"==typeof t.glob)return t.glob;if("string"==typeof t.query)return t.query;if("string"==typeof t.regex)return t.regex;if("string"==typeof t.search)return t.search;if("string"==typeof t.text)return t.text}return"string"==typeof e.target&&"."!==e.target?e.target:""}(t),c="glob"===t.type||"glob"===t.name,d=(0,a.Kr)(()=>ac(s,1e3),[s]),{files:p,totalMatches:u,isGlobList:m}=(0,a.Kr)(()=>(function(e){let t=e.split(/\r?\n/),n=[],i=[],r=null,a=!0;for(let e of t){let t=e.trimEnd();if(!t||t.startsWith("[")&&t.endsWith("]")||/^Showing files \d+/i.test(t)||/^Found \d+ matches/i.test(t))continue;let l=t.match(/^([^:\n]+(?:\.[a-zA-Z0-9_-]+|\/[^:\n]+)):(\d+)(?::\d+)?:(.*)$/);if(l){a=!1;let e=l[1].trim(),t=parseInt(l[2],10)||1,i=l[3],s=n.find(t=>t.path===e);s||(r&&r.lines.length>0&&!n.includes(r)&&n.push(r),s={path:e,lines:[],matchCount:0},n.push(s),r=s),s.lines.push({lineNum:t,text:i,isMatch:!0}),s.matchCount++;continue}let s=t.match(/^([^:\n]+(?:\.[a-zA-Z0-9_-]+|\/[^:\n]+))-(\d+)-(.*)$/);if(s){a=!1;let e=s[1].trim(),t=parseInt(s[2],10)||1,i=s[3],l=n.find(t=>t.path===e);l||(r&&r.lines.length>0&&!n.includes(r)&&n.push(r),l={path:e,lines:[],matchCount:0},n.push(l),r=l),l.lines.push({lineNum:t,text:i,isMatch:!1});continue}let o=t.match(/^(#{1,6})\s+(.+)$/);if(o){let e=o[1].length,t=o[2].trim();if(i.length=Math.min(i.length,e-1),t.endsWith("/"))i[e-1]=t;else{r&&r.lines.length>0&&!n.includes(r)&&n.push(r);let e=i.filter(Boolean).join("");r={path:e?`${e.replace(/\/+$/,"")}/${t}`:t,lines:[],matchCount:0}}continue}let c=t.match(/^(\*?)(\s*\d+)[|:\u2502](.*)$/);if(c){a=!1;let e="*"===c[1],t=parseInt(c[2].trim(),10)||1,i=c[3];r||(r={path:"Results",lines:[],matchCount:0},n.push(r)),r.lines.push({lineNum:t,text:i,isMatch:e}),e&&r.matchCount++;continue}if(!t.startsWith("#")&&!c){(t.includes("|")||t.includes(":")||t.includes("│"))&&(a=!1);let e=i.filter(Boolean).join(""),r=e?`${e.replace(/\/+$/,"")}/${t}`:t;n.push({path:r,lines:[],matchCount:1})}}r&&r.lines.length>0&&!n.includes(r)&&n.push(r);let l=n.reduce((e,t)=>e+(t.matchCount||t.lines.length||1),0);return{files:n,totalMatches:l,isGlobList:a}})(d.text),[d.text]),h=(0,a.Kr)(()=>{if(!n)return p;let e=n.toLowerCase();return p.map(t=>{let n=t.path.toLowerCase().includes(e),i=t.lines.filter(t=>t.text.toLowerCase().includes(e));return n?t:i.length>0?{...t,lines:i}:null}).filter(e=>null!==e)},[p,n]),b=(0,r5.w)(),f=(0,a.Kr)(()=>h.map(e=>{let t=(0,r2.sQ)(e.path);return(0,r2.O9)(e.lines.map(e=>e.text).join("\n"),t)}),[h,b]);return s||0!==p.length?(0,i.FD)("div",{className:"space-y-2",children:[(0,i.FD)("div",{className:"flex flex-wrap items-center justify-between gap-2 rounded-lg border border-ink/8 bg-paper px-3 py-2",children:[(0,i.FD)("div",{className:"flex flex-wrap items-center gap-2 text-[11px]",children:[(0,i.Y)("span",{className:"flex h-5 w-5 items-center justify-center rounded bg-ink/5 text-ink/60",children:c||m?(0,i.Y)(aS.A,{size:12}):(0,i.Y)(aT.A,{size:12})}),(0,i.Y)("span",{className:"font-semibold text-ink",children:c||m?"Files Found":"Search Matches"}),(0,i.FD)("span",{className:"rounded-full bg-ink/5 px-2 py-0.5 font-mono text-[10px] text-ink/60",children:[u," ",1===u?"match":"matches"]}),p.length>1&&(0,i.FD)("span",{className:"font-mono text-[10px] text-ink/40",children:["in ",p.length," ",1===p.length?"file":"files"]}),o&&(0,i.FD)("span",{className:"rounded border border-ink/10 bg-canvas px-1.5 py-0.5 font-mono text-[10px] text-ink/75",children:['"',o,'"']})]}),(0,i.FD)("div",{className:"flex items-center gap-2",children:[p.length>4&&(0,i.Y)("input",{type:"text",placeholder:"Filter paths...",value:n,onChange:e=>r(e.currentTarget.value),className:"h-6 w-28 rounded border border-ink/10 bg-canvas px-2 text-[10.5px] text-ink placeholder:text-ink/30 focus:border-ink/30 focus:outline-none"}),(0,i.Y)(rB,{text:s,className:"flex cursor-pointer items-center gap-1 rounded px-1.5 py-0.5 text-[10px] text-ink/45 transition-colors hover:bg-ink/5 hover:text-ink",label:"Copy"})]})]}),d.skipped>0&&(0,i.FD)("div",{className:"rounded-lg border border-dashed border-ink/15 bg-canvas/50 px-3 py-1.5 font-mono text-[10.5px] text-ink/55",children:["… ",d.skipped," earlier lines hidden"]}),(0,i.FD)("div",{className:"max-h-80 space-y-2 overflow-y-auto overscroll-contain pr-0.5",children:[h.map((e,t)=>(0,i.FD)("div",{className:"overflow-hidden rounded-lg border border-ink/8 bg-paper",children:[(0,i.FD)("div",{className:"flex items-center justify-between border-b border-ink/6 bg-canvas/40 px-2.5 py-1.5",children:[(0,i.FD)("div",{className:"flex min-w-0 items-center gap-1.5",children:[(0,i.Y)(rG.A,{size:12,className:"shrink-0 text-ink/40"}),(0,i.Y)("span",{className:"truncate font-mono text-[11px] font-medium text-ink/85",children:e.path})]}),e.matchCount>0&&!m&&(0,i.FD)("span",{className:"ml-2 shrink-0 rounded bg-ink/5 px-1.5 py-0.2 font-mono text-[9.5px] text-ink/50",children:[e.matchCount," ",1===e.matchCount?"hit":"hits"]})]}),e.lines.length>0&&(0,i.Y)("div",{className:"overflow-x-auto overscroll-x-contain",children:(0,i.Y)("div",{className:"w-max min-w-full divide-y divide-ink/[0.04] font-mono text-[11px] leading-relaxed select-text",children:e.lines.map((e,n)=>(0,i.FD)("div",{className:`flex items-start gap-2.5 px-2.5 py-1 transition-colors ${e.isMatch?"bg-warning/[0.08] text-ink":"bg-paper text-ink/60 hover:bg-ink/[0.02]"}`,children:[(0,i.FD)("span",{className:`sticky left-0 z-10 flex w-9 shrink-0 select-none items-center justify-end bg-inherit font-mono text-[10px] ${e.isMatch?"font-semibold text-warning-dark dark:text-warning":"text-ink/30"}`,children:[e.isMatch&&(0,i.Y)(nl.A,{size:10,className:"mr-0.5 text-warning"}),e.lineNum]}),(0,i.Y)("pre",{className:"shiki whitespace-pre font-mono",dangerouslySetInnerHTML:{__html:f[t]?.[n]||" "}})]},n))})})]},t)),0===h.length&&(0,i.FD)("div",{className:"rounded-lg border border-dashed border-ink/15 p-4 text-center font-mono text-[11px] text-ink/40",children:['No results match filter "',n,'"']})]})]}):(0,i.FD)("div",{className:"flex items-center gap-2 rounded-lg border border-dashed border-ink/15 px-3 py-2.5 text-[11.5px] text-ink/45",children:[c?(0,i.Y)(aS.A,{size:13,className:"shrink-0"}):(0,i.Y)(aT.A,{size:13,className:"shrink-0"}),(0,i.FD)("span",{children:["No ",c?"files":"matches"," found",o?` for "${o}"`:""]})]})}var az=n("gk");function aP(e){let t="string"==typeof e.severity?e.severity.toLowerCase():"";return"high"===t||"critical"===t||"error"===t?"high":"medium"===t||"warning"===t?"medium":"low"===t?"low":"info"}let aL={high:"bg-error/10 text-error",medium:"bg-warning/10 text-warning",low:"bg-ink/8 text-ink/60",info:"bg-ink/5 text-ink/50"};function aj(e){let{tool:t}=e,n=t.details??{},r=Array.isArray(n.findings)?n.findings:function(e){if(!e)return[];try{let t=JSON.parse(e);if(Array.isArray(t))return t;if(t&&"object"==typeof t){if(Array.isArray(t.findings))return t.findings;if(Array.isArray(t.vulnerabilities))return t.vulnerabilities;if(Array.isArray(t.issues))return t.issues}}catch{}return[]}(t.output??"");if(0===r.length)return t.output?(0,i.Y)(ad,{text:t.output}):(0,i.FD)("div",{className:"flex items-center gap-2 rounded-lg border border-success/20 bg-success/[0.04] px-3 py-2.5 text-[11.5px] text-success",children:[(0,i.Y)(tv.A,{size:13,className:"shrink-0"}),(0,i.Y)("span",{children:"No issues found"})]});let a=function(e){let t={high:0,medium:0,low:0,info:0};for(let n of e)t[aP(n)]++;return t}(r);return(0,i.FD)("div",{className:"overflow-hidden rounded-lg border border-ink/8",children:[(0,i.FD)("div",{className:"flex items-center gap-2 border-b border-ink/8 bg-paper px-2.5 py-1.5",children:[(0,i.Y)("span",{className:"text-[9.5px] font-semibold uppercase tracking-[0.14em] text-ink/40",children:"Findings"}),(0,i.FD)("span",{className:"ml-auto flex items-center gap-1.5 font-mono text-[9.5px]",children:[a.high>0&&(0,i.FD)("span",{className:"rounded-full bg-error/10 px-1.5 py-px text-error",children:[a.high," high"]}),a.medium>0&&(0,i.FD)("span",{className:"rounded-full bg-warning/10 px-1.5 py-px text-warning",children:[a.medium," med"]}),a.low>0&&(0,i.FD)("span",{className:"rounded-full bg-ink/8 px-1.5 py-px text-ink/55",children:[a.low," low"]})]})]}),(0,i.Y)("div",{className:"divide-y divide-ink/6 bg-canvas/40 py-1",children:r.map((e,t)=>{let n=aP(e),r="string"==typeof e.message?e.message:"",a="string"==typeof e.file?e.file:"string"==typeof e.path?e.path:"",l="number"==typeof e.line?e.line:void 0,s="string"==typeof e.rule?e.rule:void 0;return(0,i.FD)("div",{className:"flex items-start gap-2 px-2.5 py-1.5 text-[11.5px]",children:[(0,i.Y)(az.A,{size:11,className:`mt-0.5 shrink-0 ${"high"===n?"text-error":"medium"===n?"text-warning":"text-ink/40"}`}),(0,i.FD)("span",{className:"min-w-0 flex-1 break-words",children:[(0,i.Y)("span",{className:`mr-1.5 rounded-full px-1.5 py-px font-mono text-[9px] ${aL[n]}`,children:n}),a&&(0,i.FD)("span",{className:"font-mono text-[10px] text-ink/45",children:[a,void 0!==l?`:${l}`:"",": "]}),(0,i.Y)("span",{className:"text-ink/80",children:r}),s&&(0,i.FD)("span",{className:"ml-1 font-mono text-[9.5px] text-ink/35",children:["(",s,")"]})]})]},t)})})]})}let aR={running:"bg-ink/8 text-ink/60",done:"bg-success/10 text-success",failed:"bg-error/10 text-error",idle:"bg-ink/5 text-ink/45"};function aI(e){let{tool:t}=e,n=t.details??{},r=Array.isArray(n.jobs)?n.jobs:Array.isArray(n.items)?n.items:[],l=t.input,s="object"==typeof l&&null!==l?l:void 0,o=t.output||"";if(s?.op==="wait"){let e=Array.isArray(s.ids)?s.ids:[],t="string"==typeof s.name?s.name:void 0,n="string"==typeof s.for?s.for:void 0,r="number"==typeof s.timeout?`${s.timeout}s`:"number"==typeof s.timeoutMs?`${Math.round(s.timeoutMs/1e3)}s`:void 0;return(0,i.FD)("div",{className:"space-y-2 rounded-lg border border-ink/8 bg-paper p-3 text-[11.5px]",children:[(0,i.FD)("div",{className:"flex items-center justify-between border-b border-ink/6 pb-2",children:[(0,i.FD)("div",{className:"flex items-center gap-2",children:[(0,i.Y)(ei.A,{size:13,className:"text-ink/60"}),(0,i.Y)("span",{className:"font-mono font-semibold text-ink",children:t?`Hub Wait: ${t}`:"Hub Wait"}),(0,i.Y)("span",{className:"rounded bg-ink/5 px-1.5 py-0.2 font-mono text-[9px] uppercase tracking-wider text-ink/50",children:n?`wait (${n})`:"job wait"})]}),r&&(0,i.FD)("span",{className:"font-mono text-[9.5px] text-ink/40",children:["timeout: ",r]})]}),e.length>0&&(0,i.FD)("div",{className:"pt-1",children:[(0,i.Y)("span",{className:"text-[9.5px] font-semibold uppercase tracking-wider text-ink/40",children:"Waiting for Job IDs"}),(0,i.Y)("div",{className:"mt-1 flex flex-wrap gap-1.5 font-mono text-[10.5px]",children:e.map((e,t)=>(0,i.Y)("span",{className:"rounded bg-ink/5 px-2 py-0.5 text-ink/80",children:e},t))})]}),o&&(0,i.Y)(ad,{text:o})]})}if(s?.op==="logs"){let e="string"==typeof s.name?s.name:"Process";return(0,i.FD)("div",{className:"space-y-2 rounded-lg border border-ink/8 bg-paper p-3 text-[11.5px]",children:[(0,i.Y)("div",{className:"flex items-center justify-between border-b border-ink/6 pb-2",children:(0,i.FD)("div",{className:"flex items-center gap-2",children:[(0,i.Y)(ef.A,{size:13,className:"text-ink/60"}),(0,i.Y)("span",{className:"font-mono font-semibold text-ink",children:e}),(0,i.Y)("span",{className:"rounded bg-ink/5 px-1.5 py-0.2 font-mono text-[9px] uppercase tracking-wider text-ink/50",children:"logs"})]})}),(0,i.Y)("div",{className:"rounded border border-ink/6 bg-canvas/40 p-2 font-mono text-[10.5px] text-ink/85 whitespace-pre-wrap",children:o||"// No log output"})]})}let c=(0,a.Kr)(()=>{let e="string"==typeof s?.op?s.op.toLowerCase():"",t=["start","stop","restart","status"].includes(e),n=o.includes("pid=");if(!t&&!n)return null;let i=s?.name||"Service",r=s?.application,a=Array.isArray(s?.args)?s.args.join(" "):"",l=r?`${r} ${a}`.trim():a,c=s?.ready?.port,d=o.match(/pid=(\d+)/i),p=o.match(/uptime=([^\s]+)/i),u=o.match(/restarts=(\d+)/i),m=o.toLowerCase().includes("ready")||o.toLowerCase().includes("started")||o.toLowerCase().includes("running");return{op:e||"process",name:i,cmd:l,port:c,pid:d?d[1]:void 0,uptime:p?p[1]:void 0,restarts:u?u[1]:void 0,isReady:m,outputLines:o.split(/\r?\n/).filter(Boolean)}},[s,o]);return c?(0,i.Y)("div",{className:"space-y-2",children:(0,i.FD)("div",{className:"overflow-hidden rounded-lg border border-ink/8 bg-paper",children:[(0,i.FD)("div",{className:"flex items-center justify-between border-b border-ink/6 bg-canvas/40 px-3 py-2",children:[(0,i.FD)("div",{className:"flex items-center gap-2",children:[(0,i.Y)(ef.A,{size:13,className:"text-ink/60"}),(0,i.Y)("span",{className:"font-mono text-[11px] font-semibold text-ink",children:c.name}),(0,i.Y)("span",{className:"rounded bg-ink/5 px-1.5 py-0.2 font-mono text-[9.5px] uppercase tracking-wider text-ink/50",children:c.op})]}),c.isReady&&(0,i.FD)("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-success/10 px-2 py-0.5 font-mono text-[9.5px] font-semibold text-success",children:[(0,i.Y)("span",{className:"h-1.5 w-1.5 rounded-full bg-success animate-pulse"}),"Active"]})]}),(0,i.FD)("div",{className:"divide-y divide-ink/[0.04] p-3 text-[11px]",children:[c.cmd&&(0,i.FD)("div",{className:"flex items-center justify-between py-1 font-mono",children:[(0,i.Y)("span",{className:"text-ink/45",children:"Command"}),(0,i.Y)("span",{className:"rounded bg-ink/5 px-2 py-0.5 text-ink/85",children:c.cmd})]}),(0,i.FD)("div",{className:"flex flex-wrap items-center gap-4 py-1.5 font-mono text-[10.5px]",children:[c.port&&(0,i.FD)("span",{className:"text-ink/60",children:["Port: ",(0,i.Y)("strong",{className:"text-ink",children:c.port})]}),c.pid&&(0,i.FD)("span",{className:"text-ink/60",children:["PID: ",(0,i.Y)("strong",{className:"text-ink",children:c.pid})]}),c.uptime&&(0,i.FD)("span",{className:"text-ink/60",children:["Uptime: ",(0,i.Y)("strong",{className:"text-ink",children:c.uptime})]})]}),c.outputLines.length>0&&(0,i.FD)("div",{className:"pt-2",children:[(0,i.Y)("span",{className:"text-[9.5px] font-semibold uppercase tracking-wider text-ink/40",children:"Log Output"}),(0,i.Y)("div",{className:"mt-1 rounded border border-ink/6 bg-canvas/40 p-2 font-mono text-[10.5px] text-ink/75",children:c.outputLines.map((e,t)=>(0,i.Y)("div",{children:e},t))})]})]})]})}):0===r.length?o?(0,i.Y)(ad,{text:o}):(0,i.FD)("div",{className:"flex items-center gap-2 rounded-lg border border-dashed border-ink/15 px-3 py-2.5 text-[11.5px] text-ink/45",children:[(0,i.Y)(t5.A,{size:13,className:"shrink-0"}),(0,i.Y)("span",{children:"No hub activities"})]}):(0,i.FD)("div",{className:"space-y-2",children:[(0,i.FD)("div",{className:"overflow-hidden rounded-lg border border-ink/8",children:[(0,i.FD)("div",{className:"flex items-center gap-2 border-b border-ink/8 bg-paper px-3 py-1.5",children:[(0,i.Y)("span",{className:"text-[9.5px] font-semibold uppercase tracking-[0.14em] text-ink/40",children:"Hub Jobs"}),(0,i.Y)("span",{className:"rounded-full bg-ink/5 px-1.5 py-px font-mono text-[9.5px] text-ink/45",children:r.length})]}),(0,i.Y)("div",{className:"divide-y divide-ink/6 bg-canvas/40 py-1",children:r.map((e,t)=>{let n,r="running"===(n="string"==typeof e.status?e.status.toLowerCase():"string"==typeof e.state?e.state.toLowerCase():"")||"started"===n||"pending"===n?"running":"done"===n||"completed"===n||"success"===n?"done":"failed"===n||"error"===n?"failed":"idle",a="string"==typeof e.id?e.id:"string"==typeof e.name?e.name:`job-${t}`,l="string"==typeof e.label?e.label:"string"==typeof e.task?e.task:"string"==typeof e.message?e.message:"",s="string"==typeof e.type?e.type:void 0,o="number"==typeof e.durationMs?`${(e.durationMs/1e3).toFixed(1)}s`:void 0,c="string"==typeof e.resolvedModel?e.resolvedModel:void 0;return(0,i.FD)("div",{className:"flex items-center gap-2 px-3 py-1.5 text-[11.5px]",children:["running"===r?(0,i.Y)(ei.A,{size:11,className:"shrink-0 animate-pulse text-ink/50"}):"done"===r?(0,i.Y)(th.A,{size:11,className:"shrink-0 text-success"}):(0,i.Y)(ak.A,{size:11,className:"shrink-0 text-ink/40"}),(0,i.Y)("span",{className:"shrink-0 font-mono text-[10px] font-semibold text-ink/80",children:a}),s&&(0,i.Y)("span",{className:"rounded bg-ink/5 px-1 py-0.2 font-mono text-[8.5px] uppercase tracking-wider text-ink/45",children:s}),(0,i.Y)("span",{className:"min-w-0 flex-1 truncate text-ink/85",children:l}),c&&(0,i.Y)("span",{className:"hidden sm:inline-block font-mono text-[9px] text-ink/40 truncate max-w-[120px]",children:c}),o&&(0,i.Y)("span",{className:"font-mono text-[9px] text-ink/40",children:o}),(0,i.Y)("span",{className:`shrink-0 rounded-full px-1.5 py-px font-mono text-[9px] ${aR[r]}`,children:r})]},t)})})]}),o&&(0,i.Y)(ad,{text:o})]})}var aE=n("jI"),a$=n("rY"),aO=n("Os");function aJ(e){let{tool:t}=e,n=t.details??{},r=Array.isArray(n.notes)?n.notes:[],a="new_context"===t.type;return 0===r.length?t.output?(0,i.Y)(ad,{text:t.output}):(0,i.FD)("div",{className:"flex items-center gap-2 rounded-lg border border-dashed border-ink/15 px-3 py-2.5 text-[11.5px] text-ink/45",children:[a?(0,i.Y)(aE.A,{size:13,className:"shrink-0"}):(0,i.Y)(a$.A,{size:13,className:"shrink-0"}),(0,i.FD)("span",{children:["No ",a?"notes created":"notes"]})]}):(0,i.FD)("div",{className:"overflow-hidden rounded-lg border border-ink/8",children:[(0,i.FD)("div",{className:"border-b border-ink/8 bg-paper px-2.5 py-1.5",children:[(0,i.Y)("span",{className:"text-[9.5px] font-semibold uppercase tracking-[0.14em] text-ink/40",children:a?"New Context":"Notes"}),(0,i.Y)("span",{className:"ml-2 rounded-full bg-ink/5 px-1.5 py-px font-mono text-[9.5px] text-ink/45",children:r.length})]}),(0,i.Y)("div",{className:"divide-y divide-ink/6 bg-canvas/40 py-1",children:r.map((e,t)=>{let n="string"==typeof e.title&&e.title?e.title:"string"==typeof e.text&&e.text?e.text:"string"==typeof e.content&&e.content?e.content:"string"==typeof e.note?e.note:"";return n?(0,i.FD)("div",{className:"flex items-start gap-2 px-2.5 py-1.5 text-[11.5px]",children:[a?(0,i.Y)(aO.A,{size:11,className:"mt-0.5 shrink-0 text-ink/40"}):(0,i.Y)(a$.A,{size:11,className:"mt-0.5 shrink-0 text-ink/40"}),(0,i.Y)("span",{className:"min-w-0 flex-1 break-words text-ink/80",children:n})]},"string"==typeof e.id?e.id:`note-${t}`):null})})]})}var a_=n("Y0");let aU={memory_edit:{label:"Memory Edit",icon:(0,i.Y)(rX.A,{size:11})},retain:{label:"Retained",icon:(0,i.Y)(J.A,{size:11})},recall:{label:"Recalled",icon:(0,i.Y)(rp.A,{size:11})},reflect:{label:"Reflections",icon:(0,i.Y)(rp.A,{size:11})},learn:{label:"Learned",icon:(0,i.Y)(a_.A,{size:11})}};function aK(e){let{tool:t}=e,n=t.details??{},r=Array.isArray(n.items)?n.items:function(e){if(!e)return[];try{let t=JSON.parse(e);if(Array.isArray(t))return t;if(t&&"object"==typeof t){if(Array.isArray(t.items))return t.items;if(Array.isArray(t.memories))return t.memories;if(Array.isArray(t.results))return t.results}}catch{}return[]}(t.output??""),a=aU[t.type]??{label:"Memory",icon:(0,i.Y)(rp.A,{size:11})};return 0===r.length?t.output?(0,i.Y)(ad,{text:t.output}):(0,i.FD)("div",{className:"flex items-center gap-2 rounded-lg border border-dashed border-ink/15 px-3 py-2.5 text-[11.5px] text-ink/45",children:[(0,i.Y)(eg.A,{size:13,className:"shrink-0"}),(0,i.Y)("span",{children:"No memories"})]}):(0,i.FD)("div",{className:"overflow-hidden rounded-lg border border-ink/8",children:[(0,i.FD)("div",{className:"border-b border-ink/8 bg-paper px-2.5 py-1.5",children:[(0,i.Y)("span",{className:"text-[9.5px] font-semibold uppercase tracking-[0.14em] text-ink/40",children:a.label}),(0,i.Y)("span",{className:"ml-2 rounded-full bg-ink/5 px-1.5 py-px font-mono text-[9.5px] text-ink/45",children:r.length})]}),(0,i.Y)("div",{className:"divide-y divide-ink/6 bg-canvas/40 py-1",children:r.map((e,t)=>{let n="string"==typeof e.text&&e.text?e.text:"string"==typeof e.content?e.content:"";if(!n)return null;let r="number"==typeof e.score&&Number.isFinite(e.score)?e.score:void 0;return(0,i.FD)("div",{className:"flex items-start gap-2 px-2.5 py-1.5 text-[11.5px]",children:[(0,i.Y)("span",{className:"mt-0.5 shrink-0 text-ink/40",children:a.icon}),(0,i.Y)("span",{className:"min-w-0 flex-1 break-words text-ink/80",children:n}),void 0!==r&&(0,i.FD)("span",{className:"shrink-0 rounded-full bg-ink/5 px-1.5 py-px font-mono text-[9px] text-ink/45",children:[Math.round(100*r),"%"]})]},"string"==typeof e.id?e.id:`mem-${t}`)})})]})}var aB=n("ND"),aW=n("u8");function aH(e){let t="string"==typeof e.state?e.state.toLowerCase():"";return"attached"===t||"running"===t?t:"detached"===t?"detached":"stopped"}let aq={attached:"bg-success/10 text-success",running:"bg-ink/8 text-ink/60",stopped:"bg-ink/5 text-ink/45",detached:"bg-error/10 text-error"};function aG(e){let{tool:t}=e,n=t.details??{},r=Array.isArray(n.items)?n.items:[];if(0===r.length)return t.output?(0,i.Y)(ad,{text:t.output}):(0,i.FD)("div",{className:"flex items-center gap-2 rounded-lg border border-dashed border-ink/15 px-3 py-2.5 text-[11.5px] text-ink/45",children:[(0,i.Y)(aB.A,{size:13,className:"shrink-0"}),(0,i.Y)("span",{children:"No debug session"})]});let a=function(e){let t={attached:0,running:0,stopped:0,detached:0};for(let n of e)t[aH(n)]++;return t}(r);return(0,i.FD)("div",{className:"overflow-hidden rounded-lg border border-ink/8",children:[(0,i.FD)("div",{className:"flex items-center gap-2 border-b border-ink/8 bg-paper px-2.5 py-1.5",children:[(0,i.Y)("span",{className:"text-[9.5px] font-semibold uppercase tracking-[0.14em] text-ink/40",children:"Debug Session"}),(0,i.FD)("span",{className:"ml-auto flex items-center gap-1.5 font-mono text-[9.5px]",children:[a.attached>0&&(0,i.FD)("span",{className:"rounded-full bg-success/10 px-1.5 py-px text-success",children:[a.attached," attached"]}),a.running>0&&(0,i.FD)("span",{className:"rounded-full bg-ink/8 px-1.5 py-px text-ink/60",children:[a.running," run"]}),a.detached>0&&(0,i.FD)("span",{className:"rounded-full bg-error/10 px-1.5 py-px text-error",children:[a.detached," detach"]})]})]}),(0,i.Y)("div",{className:"divide-y divide-ink/6 bg-canvas/40 py-1",children:r.map((e,t)=>{let n=aH(e),r="string"==typeof e.target&&e.target?e.target:"number"==typeof e.pid?`pid ${e.pid}`:"string"==typeof e.message?e.message:"";return(0,i.FD)("div",{className:"flex items-center gap-2 px-2.5 py-1.5 text-[11.5px]",children:["attached"===n?(0,i.Y)(th.A,{size:11,className:"shrink-0 text-success"}):"running"===n?(0,i.Y)(aW.A,{size:11,className:"shrink-0 animate-pulse text-ink/50"}):(0,i.Y)(r6.A,{size:11,className:"shrink-0 text-ink/40"}),(0,i.Y)("span",{className:"min-w-0 flex-1 truncate font-mono text-[10.5px] text-ink/75",children:r}),(0,i.Y)("span",{className:`shrink-0 rounded-full px-1.5 py-px font-mono text-[9px] ${aq[n]}`,children:n})]},`${r}-${t}`)})})]})}var aV=n("vBE"),aQ=n("qd"),aZ=n("Sy");let aX={active:"bg-ink/8 text-ink/60",done:"bg-success/10 text-success",paused:"bg-warning/10 text-warning"};function a0(e){let{tool:t}=e,n=t.details??{},r=Array.isArray(n.items)?n.items:[],a="yield"===t.type||"yield"===t.name,l="error"===t.status;if(a){let e=function(e){let t=(0,ig.u)(e.details)?e.details:void 0,n=(0,ig.u)(e.input)?e.input:void 0,i=(t&&(0,ig.u)(t.data)?t.data:void 0)??(n&&(0,ig.u)(n.data)?n.data:void 0)??t??n;if(!i)return null;let r="string"==typeof i.summary?i.summary:void 0,a="string"==typeof i.report?i.report:void 0,l="string"==typeof i.architecture?i.architecture:void 0,s=Array.isArray(i.files)?i.files:void 0,o=[];if(s)for(let e of s)"string"==typeof e&&e?o.push(e):(0,ig.u)(e)&&"string"==typeof e.path&&o.push({path:e.path,description:"string"==typeof e.description?e.description:void 0});let c="string"==typeof t?.status?t.status:"string"==typeof i.status?i.status:void 0,d="string"==typeof i.error?i.error:null;return r||a||l||0!==o.length||d?{summary:r,report:a,architecture:l,files:o.length>0?o:void 0,status:c,error:d}:null}(t);if(e)return(0,i.FD)("div",{className:"overflow-hidden rounded-lg border border-ink/10 bg-paper text-[12px] text-ink select-text",children:[(0,i.FD)("div",{className:"flex items-center justify-between border-b border-ink/8 bg-canvas/40 px-3 py-2",children:[(0,i.FD)("div",{className:"flex items-center gap-2",children:[(0,i.Y)("span",{className:`flex h-5 w-5 items-center justify-center rounded-md ${l||e.error?"bg-error/10 text-error":"bg-success/10 text-success"}`,children:l||e.error?(0,i.Y)(au.A,{size:12}):(0,i.Y)(th.A,{size:12})}),(0,i.Y)("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-ink/70",children:l||e.error?"Yield Error":"Yield Result"})]}),(e.status||(l?"error":"success"))&&(0,i.Y)("span",{className:`rounded-full px-2 py-0.5 font-mono text-[9.5px] font-medium uppercase ${l||e.error?"bg-error/10 text-error":"bg-success/10 text-success"}`,children:e.status||(l?"failed":"success")})]}),(0,i.FD)("div",{className:"space-y-2.5 p-3",children:[(e.error||l&&t.output)&&(0,i.FD)("div",{className:"flex items-start gap-2 rounded-md bg-error/10 p-2.5 text-error text-[11.5px]",children:[(0,i.Y)(au.A,{size:13,className:"shrink-0 mt-0.5"}),(0,i.Y)("span",{className:"font-mono leading-relaxed",children:e.error||t.output})]}),e.summary&&(0,i.FD)("div",{children:[(0,i.Y)("span",{className:"text-[10px] font-mono text-ink/45 uppercase tracking-wider",children:"Summary"}),(0,i.Y)("p",{className:"mt-0.5 font-sans text-[12px] text-ink font-medium leading-relaxed",children:e.summary})]}),e.report&&e.report!==e.summary&&(0,i.FD)("div",{className:"rounded-md border border-ink/8 bg-canvas/30 p-2.5",children:[(0,i.Y)("span",{className:"text-[10px] font-mono text-ink/45 uppercase tracking-wider",children:"Report"}),(0,i.Y)("div",{className:"mt-1 text-[11.5px] text-ink/85 leading-relaxed",children:(0,i.Y)(rU.T,{content:e.report})})]}),e.architecture&&(0,i.FD)("div",{children:[(0,i.Y)("span",{className:"text-[10px] font-mono text-ink/45 uppercase tracking-wider",children:"Evidence / Architecture"}),(0,i.Y)("div",{className:"mt-0.5 text-[11px] text-ink/75 leading-relaxed bg-ink/[0.03] p-2 rounded border border-ink/6",children:(0,i.Y)(rU.T,{content:e.architecture})})]}),e.files&&e.files.length>0&&(0,i.FD)("div",{children:[(0,i.FD)("span",{className:"text-[10px] font-mono text-ink/45 uppercase tracking-wider",children:["Files Inspected (",e.files.length,")"]}),(0,i.Y)("div",{className:"mt-1 grid grid-cols-1 gap-1 sm:grid-cols-2",children:e.files.map((e,t)=>{let n="string"==typeof e?e:e.path,r="string"==typeof e?void 0:e.description;return(0,i.FD)("div",{className:"flex flex-col justify-between rounded border border-ink/6 bg-canvas/40 p-1.5",children:[(0,i.FD)("span",{className:"inline-flex items-center gap-1 font-mono text-[10.5px] font-medium text-ink truncate",children:[(0,i.Y)(rG.A,{size:10,className:"shrink-0 text-ink/50"}),(0,i.Y)("span",{className:"truncate",children:n})]}),r&&(0,i.Y)("span",{className:"text-[10px] text-ink/60 leading-tight mt-0.5 truncate",children:r})]},t)})})]})]})]})}return 0===r.length?t.output?(0,i.Y)(ad,{text:t.output}):(0,i.FD)("div",{className:"flex items-center gap-2 rounded-lg border border-dashed border-ink/15 px-3 py-2.5 text-[11.5px] text-ink/45",children:[(0,i.Y)(r6.A,{size:13,className:"shrink-0"}),(0,i.Y)("span",{children:a?"No yield":"No goals"})]}):(0,i.FD)("div",{className:"overflow-hidden rounded-lg border border-ink/8",children:[(0,i.FD)("div",{className:"border-b border-ink/8 bg-paper px-2.5 py-1.5",children:[(0,i.Y)("span",{className:"text-[9.5px] font-semibold uppercase tracking-[0.14em] text-ink/40",children:a?"Yield":"Goals"}),(0,i.Y)("span",{className:"ml-2 rounded-full bg-ink/5 px-1.5 py-px font-mono text-[9.5px] text-ink/45",children:r.length})]}),(0,i.Y)("div",{className:"divide-y divide-ink/6 bg-canvas/40 py-1",children:r.map((e,t)=>{let n,r="string"==typeof e.title&&e.title?e.title:"string"==typeof e.description?e.description:"";if(!r)return null;let l="number"==typeof e.progress&&Number.isFinite(e.progress)?e.progress:void 0,s="done"===(n="string"==typeof e.status?e.status.toLowerCase():"")||"completed"===n?"done":"paused"===n||"yielded"===n?"paused":"active";return(0,i.FD)("div",{className:"px-2.5 py-1.5",children:[(0,i.FD)("div",{className:"flex items-start gap-2 text-[11.5px]",children:[a?(0,i.Y)(aV.A,{size:11,className:"mt-0.5 shrink-0 text-ink/40"}):(0,i.Y)(aQ.A,{size:11,className:"mt-0.5 shrink-0 text-ink/40"}),(0,i.Y)("span",{className:"min-w-0 flex-1 break-words text-ink/80",children:r}),(0,i.Y)("span",{className:`shrink-0 rounded-full px-1.5 py-px font-mono text-[9px] ${aX[s]}`,children:s})]}),void 0!==l&&(0,i.FD)("div",{className:"mt-1.5 flex items-center gap-1.5 pl-[18px]",children:[(0,i.Y)("div",{className:"h-1 flex-1 overflow-hidden rounded-full bg-ink/8",children:(0,i.Y)("div",{className:"h-full rounded-full bg-ink/60 transition-all duration-300",style:{width:`${Math.min(100,Math.max(0,Math.round(100*l)))}%`}})}),(0,i.FD)("span",{className:"flex shrink-0 items-center gap-0.5 font-mono text-[9px] text-ink/45",children:[(0,i.Y)(aZ.A,{size:8}),Math.round(100*l),"%"]})]})]},"string"==typeof e.id?e.id:`goal-${t}`)})})]})}var a1=n("fj"),a2=n("qw");function a5(e){let{tool:t}=e,n=t.details??{},r=n.xdev??{},l=r.inner??{},s=r.args??{},o=t.output??"",c=!1===l.applied||o.toLowerCase().includes("staged as a proposal")||o.toLowerCase().includes("files not modified yet"),d=Array.isArray(s.ops)?s.ops:[],p=Array.isArray(s.paths)?s.paths:l.scopePath?[l.scopePath]:[],u=l.displayContent||(o.includes("-")&&o.includes("+")?o:""),m=u?u.split(/\r?\n/).filter(e=>!e.startsWith("Staged as a proposal")&&!!e.trim()):[],h=Array.isArray(n.changes)?n.changes:function(e){if(!e)return[];try{let t=JSON.parse(e);if(Array.isArray(t))return t;if(t&&"object"==typeof t){if(Array.isArray(t.changes))return t.changes;if(Array.isArray(t.edits))return t.edits}}catch{}return[]}(o),b=(0,r5.w)(),f=(0,r2.sQ)(p[0]),g=(0,a.Kr)(()=>{let e=m.map(e=>e.startsWith("+")||e.startsWith("-")||e.startsWith(" ")?e.slice(1):e);return(0,r2.O9)(e.join("\n"),f)},[m,f,b]);if(c||d.length>0||m.length>0)return(0,i.Y)("div",{className:"space-y-2 select-text",children:(0,i.FD)("div",{className:"overflow-hidden rounded-lg border border-ink/10 bg-paper",children:[(0,i.FD)("div",{className:"flex items-center justify-between border-b border-ink/6 bg-canvas/40 px-3 py-2",children:[(0,i.FD)("div",{className:"flex items-center gap-2",children:[(0,i.Y)(a1.A,{size:13,className:"text-ink/60"}),(0,i.Y)("span",{className:"font-mono text-[11px] font-semibold text-ink",children:"AST Edit"}),p.length>0&&(0,i.Y)("span",{className:"font-mono text-[10px] text-ink/50 truncate max-w-[200px]",children:p[0]})]}),(0,i.FD)("span",{className:`inline-flex items-center gap-1 rounded-full px-2 py-0.5 font-mono text-[9px] font-semibold ${c?"bg-warning/10 text-warning":"bg-success/10 text-success"}`,children:[c?(0,i.Y)(x.A,{size:10}):(0,i.Y)(th.A,{size:10}),c?"STAGED PROPOSAL":"APPLIED"]})]}),d.length>0&&(0,i.FD)("div",{className:"border-b border-ink/6 p-2.5 bg-canvas/20",children:[(0,i.Y)("span",{className:"text-[9px] font-semibold uppercase tracking-wider text-ink/40",children:"Pattern Transformation"}),(0,i.Y)("div",{className:"mt-1 space-y-1",children:d.map((e,t)=>(0,i.FD)("div",{className:"flex items-center gap-2 rounded border border-ink/6 bg-paper px-2 py-1 font-mono text-[10.5px]",children:[(0,i.Y)("span",{className:"text-error/90 line-through truncate",children:e.pat}),(0,i.Y)(a2.A,{size:10,className:"shrink-0 text-ink/35"}),(0,i.Y)("span",{className:"text-success/90 font-medium truncate",children:e.out||"/* removed */"})]},t))})]}),m.length>0&&(0,i.Y)("div",{className:"p-2.5 font-mono text-[10.5px] leading-relaxed bg-canvas/30 space-y-0.5",children:m.map((e,t)=>{let n=e.startsWith("-"),r=e.startsWith("+"),a=g[t]||"";return(0,i.FD)("div",{className:`rounded px-1.5 py-0.5 ${n?"bg-error/10 text-error font-medium":r?"bg-success/10 text-success font-medium":"text-ink/70"}`,children:[(n||r)&&e[0],a?(0,i.Y)("span",{className:"shiki",dangerouslySetInnerHTML:{__html:a}}):n||r?e.slice(1):e]},t)})}),c&&(0,i.FD)("div",{className:"border-t border-ink/6 bg-paper px-3 py-1.5 text-[10px] text-ink/50",children:["Proposal staged in memory. Apply with ",(0,i.Y)("code",{className:"font-mono text-ink/75",children:"xd://resolve"})," or discard with ",(0,i.Y)("code",{className:"font-mono text-ink/75",children:"xd://reject"}),"."]})]})});if(h.length>0)return(0,i.FD)("div",{className:"overflow-hidden rounded-lg border border-ink/8 select-text",children:[(0,i.FD)("div",{className:"border-b border-ink/8 bg-paper px-2.5 py-1.5",children:[(0,i.Y)("span",{className:"text-[9.5px] font-semibold uppercase tracking-[0.14em] text-ink/40",children:"AST Changes"}),(0,i.Y)("span",{className:"ml-2 rounded-full bg-ink/5 px-1.5 py-px font-mono text-[9.5px] text-ink/45",children:h.length})]}),(0,i.Y)("div",{className:"divide-y divide-ink/6 bg-canvas/40 py-1",children:h.map((e,t)=>{let n="string"==typeof e.file?e.file:"string"==typeof e.path?e.path:"",r="string"==typeof e.message?e.message:"",a="string"==typeof e.nodeKind?e.nodeKind:"",l="number"==typeof e.changes?e.changes:void 0;return(0,i.FD)("div",{className:"flex items-start gap-2 px-2.5 py-1.5 text-[11.5px]",children:[(0,i.Y)(a1.A,{size:11,className:"mt-0.5 shrink-0 text-ink/40"}),(0,i.FD)("span",{className:"min-w-0 flex-1 break-words",children:[n&&(0,i.FD)("span",{className:"font-mono text-[10px] text-ink/45",children:[n,": "]}),(0,i.Y)("span",{className:"text-ink/80",children:r}),a&&(0,i.FD)("span",{className:"ml-1 font-mono text-[9.5px] text-ink/35",children:["(",a,")"]})]}),void 0!==l&&(0,i.FD)("span",{className:"shrink-0 rounded-full bg-ink/5 px-1.5 py-px font-mono text-[9px] text-ink/45",children:[l," changes"]})]},t)})})]});let v=o.split(/\r?\n/).filter(Boolean);return 0===v.length?null:(0,i.Y)("ul",{className:"divide-y divide-ink/6 overflow-hidden rounded-lg border border-ink/8 bg-canvas/40 select-text",children:v.map((e,t)=>(0,i.Y)("li",{className:"px-2.5 py-1.5 font-mono text-[11px] break-words text-ink/75",children:e},t))})}function a3(e){let{tool:t}=e,n=(t.details??{}).xdev??{},r=n.inner??{},a="object"==typeof t.input&&null!==t.input?t.input:void 0,l="reject"===t.name||t.target?.includes("reject")||"reject"===n.tool||"reject"===r.action||"discard"===r.action,s=r.reason||n.args?.reason||("string"==typeof a?.content?a.content:"")||("string"==typeof t.input?t.input:""),o=r.sourceToolName||"ast_edit",c=r.label||t.output||(l?"Proposal discarded":"Proposal applied"),d=Array.isArray(r.sourceResultDetails?.files)?r.sourceResultDetails.files:[],p=r.sourceResultDetails?.totalReplacements??r.totalReplacements;return(0,i.Y)("div",{className:"space-y-2 select-text",children:(0,i.FD)("div",{className:"rounded-lg border border-ink/10 bg-paper p-3",children:[(0,i.FD)("div",{className:"flex items-center justify-between gap-2 border-b border-ink/6 pb-2",children:[(0,i.FD)("div",{className:"flex items-center gap-2",children:[l?(0,i.Y)(r4.A,{size:14,className:"text-warning shrink-0"}):(0,i.Y)(th.A,{size:14,className:"text-success shrink-0"}),(0,i.Y)("span",{className:"font-mono text-[11px] font-semibold text-ink",children:l?"Proposal Discarded":"Proposal Applied"}),(0,i.Y)("span",{className:"rounded bg-ink/5 px-1.5 py-0.5 font-mono text-[9px] uppercase tracking-wider text-ink/50",children:o})]}),(0,i.Y)("span",{className:`rounded-full px-2 py-0.5 font-mono text-[9.5px] font-semibold ${l?"bg-warning/10 text-warning":"bg-success/10 text-success"}`,children:l?"REJECTED":"RESOLVED"})]}),s&&(0,i.FD)("div",{className:"pt-2.5",children:[(0,i.Y)("span",{className:"text-[9.5px] font-semibold uppercase tracking-wider text-ink/40",children:"Reason"}),(0,i.FD)("p",{className:"mt-0.5 text-[12px] leading-relaxed text-ink/85 italic",children:["“",s,"”"]})]}),c&&(0,i.Y)("div",{className:"mt-2 text-[11.5px] font-medium text-ink/80",children:c}),d.length>0&&(0,i.FD)("div",{className:"mt-2.5 space-y-1 border-t border-ink/6 pt-2",children:[(0,i.FD)("div",{className:"flex items-center justify-between text-[9.5px] font-semibold uppercase tracking-wider text-ink/40",children:[(0,i.FD)("span",{children:["Touched Files (",d.length,")"]}),"number"==typeof p&&(0,i.FD)("span",{children:[p," replacement",1===p?"":"s"]})]}),(0,i.Y)("div",{className:"space-y-1",children:d.map((e,t)=>(0,i.FD)("div",{className:"flex items-center gap-1.5 font-mono text-[10.5px] text-ink/70",children:[(0,i.Y)(rG.A,{size:11,className:"shrink-0 text-ink/40"}),(0,i.Y)("span",{className:"truncate",children:e})]},t))})]})]})})}var a4=n("xn"),a6=n("JH");let a8={enabled:"bg-success/10 text-success",installed:"bg-ink/8 text-ink/60",disabled:"bg-ink/5 text-ink/45",removed:"bg-error/10 text-error"};function a7(e){let{tool:t}=e,n=t.details??{},r=Array.isArray(n.skills)?n.skills:function(e){if(!e)return[];try{let t=JSON.parse(e);if(Array.isArray(t))return t;if(t&&"object"==typeof t){if(Array.isArray(t.skills))return t.skills;if(Array.isArray(t.items))return t.items}}catch{}return[]}(t.output??"");return 0===r.length?t.output?(0,i.Y)(ad,{text:t.output}):null:(0,i.FD)("div",{className:"overflow-hidden rounded-lg border border-ink/8",children:[(0,i.FD)("div",{className:"border-b border-ink/8 bg-paper px-2.5 py-1.5",children:[(0,i.Y)("span",{className:"text-[9.5px] font-semibold uppercase tracking-[0.14em] text-ink/40",children:"Skills"}),(0,i.Y)("span",{className:"ml-2 rounded-full bg-ink/5 px-1.5 py-px font-mono text-[9.5px] text-ink/45",children:r.length})]}),(0,i.Y)("div",{className:"divide-y divide-ink/6 bg-canvas/40 py-1",children:r.map((e,t)=>{let n,r="string"==typeof e.name?e.name:"string"==typeof e.slug?e.slug:"";if(!r)return null;let a="enabled"===(n="string"==typeof e.status?e.status.toLowerCase():"")||"installed"===n?n:"removed"===n||"uninstalled"===n||"deleted"===n?"removed":"disabled",l="string"==typeof e.scope?e.scope:void 0,s="string"==typeof e.version?e.version:void 0,o="string"==typeof e.message?e.message:"";return(0,i.FD)("div",{className:"flex items-center gap-2 px-2.5 py-1.5 text-[11.5px]",children:["removed"===a?(0,i.Y)(a4.A,{size:11,className:"shrink-0 text-error"}):(0,i.Y)(a6.A,{size:11,className:"shrink-0 text-ink/40"}),(0,i.Y)("span",{className:"shrink-0 font-mono text-[10px] font-semibold text-ink/70",children:r}),l&&(0,i.Y)("span",{className:"rounded-full bg-ink/5 px-1.5 py-px font-mono text-[9px] text-ink/45",children:l}),s&&(0,i.FD)("span",{className:"font-mono text-[9px] text-ink/35",children:["v",s]}),o&&(0,i.Y)("span",{className:"min-w-0 flex-1 truncate text-ink/65",children:o}),(0,i.Y)("span",{className:`ml-auto shrink-0 rounded-full px-1.5 py-px font-mono text-[9px] ${a8[a]}`,children:a})]},t)})})]})}function a9(e){return"string"==typeof e.path?e.path:"string"==typeof e.name?e.name:""}function le(e){let{tool:t}=e,[n,r]=(0,a.J0)(""),l=t.details??{},s=Array.isArray(l.results)?l.results:[],o=(0,a.Kr)(()=>{if(s.length>0)return s;if(t.output)try{let e=JSON.parse(t.output);if(Array.isArray(e))return e;if(e&&"object"==typeof e){if(Array.isArray(e.results))return e.results;if(Array.isArray(e.items))return e.items;if(Array.isArray(e.files))return e.files}}catch{}return(t.output??"").split(/\r?\n/).filter(Boolean).map(e=>{let t=e.endsWith("/");return{path:e,type:t?"dir":"file"}})},[s,t.output]),c=(0,a.Kr)(()=>{if(!n)return o;let e=n.toLowerCase();return o.filter(t=>a9(t).toLowerCase().includes(e))},[o,n]);return 0===o.length?(0,i.FD)("div",{className:"flex items-center gap-2 rounded-lg border border-dashed border-ink/15 px-3 py-2.5 text-[11.5px] text-ink/45",children:[(0,i.Y)(aS.A,{size:13,className:"shrink-0"}),(0,i.Y)("span",{children:"No filesystem matches found"})]}):(0,i.FD)("div",{className:"space-y-2",children:[(0,i.FD)("div",{className:"flex items-center justify-between rounded-lg border border-ink/8 bg-paper px-3 py-2",children:[(0,i.FD)("div",{className:"flex items-center gap-2",children:[(0,i.Y)(aS.A,{size:13,className:"text-ink/60"}),(0,i.Y)("span",{className:"text-[11px] font-semibold text-ink",children:"Filesystem Search"}),(0,i.FD)("span",{className:"rounded-full bg-ink/5 px-2 py-0.5 font-mono text-[9.5px] text-ink/50",children:[o.length," ",1===o.length?"entry":"entries"]})]}),(0,i.FD)("div",{className:"flex items-center gap-2",children:[o.length>5&&(0,i.Y)("input",{type:"text",placeholder:"Filter...",value:n,onChange:e=>r(e.currentTarget.value),className:"h-6 w-24 rounded border border-ink/10 bg-canvas px-2 text-[10.5px] text-ink focus:outline-none"}),(0,i.Y)(rB,{text:o.map(e=>a9(e)).join("\n"),className:"flex cursor-pointer items-center gap-1 rounded px-1.5 py-0.5 text-[10px] text-ink/45 transition-colors hover:bg-ink/5 hover:text-ink",label:"Copy"})]})]}),(0,i.Y)("div",{className:"max-h-64 divide-y divide-ink/6 overflow-y-auto rounded-lg border border-ink/8 bg-paper",children:c.map((e,t)=>{let n,r=a9(e);if(!r)return null;let a="file"===(n="string"==typeof e.type?e.type.toLowerCase():"")||"directory"===n||"dir"===n?"directory"===n||"dir"===n?"dir":"file":"unknown",l="number"==typeof e.size&&e.size>0?tl(e.size):"";return(0,i.FD)("div",{className:"flex items-center gap-2 px-3 py-1.5 text-[11.5px] transition-colors hover:bg-ink/[0.02]",children:["dir"===a?(0,i.Y)(es.A,{size:12,className:"shrink-0 text-ink/50"}):(0,i.Y)(rj.A,{size:12,className:"shrink-0 text-ink/40"}),(0,i.Y)("span",{className:"min-w-0 flex-1 truncate font-mono text-[11px] text-ink/80",children:r}),"unknown"!==a&&(0,i.Y)("span",{className:`shrink-0 rounded px-1.5 py-0.5 font-mono text-[9px] uppercase tracking-wider ${"dir"===a?"bg-ink/8 text-ink/60":"bg-ink/5 text-ink/45"}`,children:a}),l&&(0,i.Y)("span",{className:"shrink-0 font-mono text-[10px] text-ink/40",children:l})]},t)})})]})}function lt(e){let{tool:t}=e,n=t.input,r="object"==typeof n&&null!==n?n:void 0,l=Array.isArray(r?.questions)&&r.questions.length>0?r.questions[0]:void 0,s=l?.header,o=l?.question||("string"==typeof r?.question?r.question:"string"==typeof r?.prompt?r.prompt:"string"==typeof r?.message?r.message:"string"==typeof n?n:t.detail||"Question from agent"),c=l?.options||r?.options||r?.choices||[],d=Array.isArray(c)?c.map(e=>"string"==typeof e?{label:e}:"object"==typeof e&&null!==e?{label:"string"==typeof e.label?e.label:"string"==typeof e.text?e.text:String(e),description:"string"==typeof e.description?e.description:void 0}:{label:String(e)}):[],p=(0,a.Kr)(()=>"string"==typeof t.output?t.output:t.output&&"object"==typeof t.output?JSON.stringify(t.output,null,2):"string"==typeof r?.answer?r.answer:r?.answer&&"object"==typeof r?.answer?JSON.stringify(r.answer,null,2):"",[t.output,r?.answer]),u="string"==typeof p&&/cancelled|aborted|interrupted|disconnected/i.test(p)||"aborted"===t.status||"error"===t.status&&"string"==typeof p&&/disconnect|error/i.test(p),m="string"==typeof p?p.match(/selected:\s*(.+)$/i):null,h=m?m[1].trim():p,b=(0,a.Kr)(()=>!u&&p?(0,r2.Bl)(p):{isValid:!1},[p,u]),f="string"==typeof p&&p.includes("\n")&&!m,x=(0,r5.w)(),g=(0,a.Kr)(()=>"string"==typeof p&&(0,r2.rw)(p)?(0,r2.wY)(p,"javascript"):"",[p,x]);return(0,i.FD)("div",{className:"space-y-2",children:[(0,i.FD)("div",{className:"rounded-lg border border-ink/10 bg-paper p-3 shadow-xs",children:[(0,i.FD)("div",{className:"flex items-start gap-2 min-w-0",children:[(0,i.Y)(rQ.A,{size:14,className:"mt-0.5 shrink-0 text-ink/60"}),(0,i.FD)("div",{className:"min-w-0 flex-1",children:[(0,i.Y)("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-ink/40",children:s?`Agent Question \xb7 ${s}`:"Agent Question"}),(0,i.Y)("div",{className:"mt-1 text-[12.5px] leading-relaxed text-ink/90 select-text",children:(0,i.Y)(rU.T,{content:o})})]})]}),d.length>0&&(0,i.FD)("div",{className:"mt-3 space-y-1.5 border-t border-ink/6 pt-2.5",children:[(0,i.Y)("span",{className:"text-[9.5px] font-semibold uppercase tracking-wider text-ink/40",children:"Options"}),(0,i.Y)("div",{className:"grid gap-1.5",children:d.map((e,t)=>{let n=!u&&!!h&&h.toLowerCase().includes(e.label.toLowerCase());return(0,i.FD)("div",{className:`flex flex-col gap-0.5 rounded-md px-2.5 py-1.5 text-[11px] transition-colors ${n?"border border-ink/30 bg-ink/5 font-medium text-ink":"border border-ink/6 bg-canvas/30 text-ink/75"}`,children:[(0,i.FD)("div",{className:"flex items-center gap-2",children:[(0,i.Y)("span",{className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded bg-ink/5 font-mono text-[9px] text-ink/60 font-semibold",children:t+1}),(0,i.Y)("span",{className:"min-w-0 flex-1 truncate font-medium text-ink/90",children:e.label}),n&&(0,i.Y)(th.A,{size:12,className:"shrink-0 text-success"})]}),e.description&&(0,i.Y)("div",{className:"pl-5.5 text-[10px] leading-relaxed text-ink/50",children:e.description})]},t)})})]})]}),u&&p&&(0,i.FD)("div",{className:"flex items-center gap-2 rounded-md border border-ink/8 bg-ink/[0.02] px-2.5 py-1 text-[10.5px] text-ink/60",children:[(0,i.Y)(r4.A,{size:11,className:"shrink-0 text-ink/40"}),(0,i.Y)("span",{className:"text-[9px] font-semibold uppercase tracking-wider text-ink/40 shrink-0",children:"Status:"}),(0,i.Y)("span",{className:"font-mono text-ink/60 truncate select-text",children:p})]}),!u&&b.isValid&&b.pretty&&(0,i.Y)(r7,{jsonString:b.pretty,title:"User Response",maxHeightClass:"max-h-40",compact:!0,icon:(0,i.Y)(th.A,{size:10.5,className:"text-success shrink-0"}),showHeader:!0}),!u&&!b.isValid&&p&&(f?(0,i.FD)("div",{className:"overflow-hidden rounded-md border border-ink/8 bg-paper",children:[(0,i.FD)("div",{className:"flex items-center justify-between border-b border-ink/6 bg-canvas/40 px-2.5 py-1",children:[(0,i.FD)("div",{className:"flex items-center gap-1.5",children:[(0,i.Y)(th.A,{size:10.5,className:"shrink-0 text-success"}),(0,i.Y)("span",{className:"text-[9px] font-semibold uppercase tracking-wider text-ink/50",children:"User Response"})]}),(0,i.Y)(rB,{text:p,className:"flex cursor-pointer items-center gap-1 rounded px-1.5 py-0.5 text-[9px] text-ink/45 transition-colors hover:bg-ink/5 hover:text-ink shrink-0",title:"Copy response",label:"Copy"})]}),(0,i.Y)("pre",{className:"max-h-32 overflow-y-auto p-2 font-mono text-[10.5px] leading-snug whitespace-pre-wrap break-words text-ink/85 select-text",children:g?(0,i.Y)("span",{dangerouslySetInnerHTML:{__html:g}}):p})]}):(0,i.FD)("div",{className:"flex items-center gap-2 rounded-md border border-ink/8 bg-canvas/30 px-2.5 py-1 text-[10.5px]",children:[(0,i.Y)(th.A,{size:11,className:"shrink-0 text-success"}),(0,i.Y)("span",{className:"text-[9px] font-semibold uppercase tracking-wider text-ink/40 shrink-0",children:"User Response:"}),(0,i.Y)("span",{className:"font-mono text-ink/90 font-medium truncate select-text",children:m?m[1].trim().replace(/^["']|["']$/g,""):p})]}))]})}function ln(e){let{tool:t}=e,n=t.input,r="object"==typeof n&&null!==n?n:void 0,a="string"==typeof r?.thought?r.thought:"string"==typeof r?.reasoning?r.reasoning:"string"==typeof r?.notes?r.notes:"string"==typeof n?n:t.output||t.detail||"";return a?(0,i.FD)("div",{className:"overflow-hidden rounded-lg border border-ink/8 bg-paper",children:[(0,i.FD)("div",{className:"flex items-center justify-between border-b border-ink/6 bg-canvas/40 px-3 py-1.5",children:[(0,i.FD)("div",{className:"flex items-center gap-1.5",children:[(0,i.Y)(r_.A,{size:12,className:"text-ink/50"}),(0,i.Y)("span",{className:"text-[9.5px] font-semibold uppercase tracking-[0.14em] text-ink/40",children:"Internal Reasoning"})]}),(0,i.Y)(rB,{text:a,className:"flex cursor-pointer items-center gap-1 rounded px-1.5 py-0.5 text-[9.5px] text-ink/45 transition-colors hover:bg-ink/5 hover:text-ink",label:"Copy"})]}),(0,i.Y)("div",{className:"max-h-64 overflow-y-auto p-3 text-[11.5px] leading-relaxed text-ink/80 select-text",children:(0,i.Y)(rU.T,{content:a})})]}):(0,i.Y)("div",{className:"rounded-lg border border-dashed border-ink/15 p-3 font-mono text-[11px] text-ink/40",children:"No thought details recorded."})}function li(e){let{tool:t,targetFilePath:n,output:r}=e,[l,s]=(0,a.J0)(null),[o,c]=(0,a.J0)(!1),d=am(t?.input),p=n||d||t?.target||"",u=p.split("?")[0].split("#")[0].replace(/:\d+(?:-\d+)?$/,"");(0,a.vJ)(()=>{!u||r||null!==l||o||(c(!0),fetch(`/api/fs/read?path=${encodeURIComponent(u)}`).then(e=>e.json()).then(e=>{s(e&&void 0!==e.content?e.content:`// Loaded file: ${u}`)}).catch(()=>{s(`// Loaded file: ${u}`)}).finally(()=>{c(!1)}))},[u,r,l,o]);let m=t?.details??{},h=r||("object"==typeof m?.displayContent&&"string"==typeof m.displayContent?.text?m.displayContent.text:"")||l||"",b=(0,a.Kr)(()=>(function(e){let t,n=e.split(/\r?\n/).filter(Boolean);if(0===n.length)return{isDirectory:!1,entries:[]};let i=n[0].trim(),r=n.some(e=>e.trimStart().startsWith("- ")||e.trimStart().startsWith("├──")||e.trimStart().startsWith("└──"));if("."!==i&&!r)return{isDirectory:!1,entries:[]};let a=[];for(let e of n){if(e.startsWith("[")&&e.endsWith("]")){t=e.slice(1,-1);continue}if("."===e.trim()){a.push({indent:0,isDir:!0,name:"."});continue}let n=e.match(/^(\s*)-\s+([^\s]+)\s*(.*)$/);if(n){let e,t,i=Math.floor(n[1].length/2),r=n[2],l=n[3].trim(),s=r.endsWith("/"),o=s?r.slice(0,-1):r,c=l.split(/\s{2,}|\t+/).filter(Boolean);2===c.length?(e=c[0],t=c[1]):1===c.length&&(c[0].endsWith("ago")?t=c[0]:e=c[0]),a.push({indent:i,isDir:s,name:o,size:e,time:t})}}return{isDirectory:a.length>0,entries:a,notice:t}})(h),[h]),x=(0,a.Kr)(()=>(function(e,t,n){let i=e?.details??{},r=e?.input&&"object"==typeof e.input?e.input:{},a=i.displayContent;if(a&&Array.isArray(a.lineNumbers)&&a.lineNumbers.length>0)return{startLine:"number"==typeof a.startLine?a.startLine:void 0,lineNumbers:a.lineNumbers};if(Array.isArray(i.lineNumbers)&&i.lineNumbers.length>0)return{startLine:"number"==typeof i.startLine?i.startLine:void 0,lineNumbers:i.lineNumbers};if("number"==typeof a?.startLine&&a.startLine>0)return{startLine:a.startLine};if("number"==typeof i.startLine&&i.startLine>0)return{startLine:i.startLine};if("number"==typeof i.start_line&&i.start_line>0)return{startLine:i.start_line};if("number"==typeof i.offset&&i.offset>0)return{startLine:i.offset};let l=i.meta?.truncation?.shownRange?.start??i.truncation?.shownRange?.start??i.meta?.shownRange?.start??i.shownRange?.start;if("number"==typeof l&&l>0)return{startLine:l};let s=r.start_line??r.startLine??r.offset??r.StartLine??r.from;if("number"==typeof s&&s>0)return{startLine:s};if("string"==typeof s&&/^\d+$/.test(s.trim())){let e=parseInt(s.trim(),10);if(e>0)return{startLine:e}}for(let n of["string"==typeof r.path?r.path:"",e?.target||"",e?.title||"",t||""]){let e=n.match(/:(\d+)(?:-\d+)?(?:\s|$)/);if(e){let t=parseInt(e[1],10);if(t>0)return{startLine:t}}}if(n){let e=n.match(/\[(?:Showing\s+)?lines?\s+(\d+)(?:-\d+)?/i);if(e){let t=parseInt(e[1],10);if(t>0)return{startLine:t}}}return{}})(t,p,h),[t,p,h]),{displayContent:g,elisionNotices:v}=(0,a.Kr)(()=>{if(b.isDirectory)return{displayContent:h,elisionNotices:[]};let e=h.split(/\r?\n/),t=[],n=[];for(let i of e){let e=i.trim();(e.startsWith("[…")||e.startsWith("[Showing lines ")||e.startsWith("[1 results limit"))&&e.endsWith("]")?t.push(e.slice(1,-1)):n.push(i)}return 0===t.length&&m.summary&&"number"==typeof m.summary.elidedLines&&m.summary.elidedLines>0&&t.push(`…${m.summary.elidedLines}ln elided (${m.summary.lines??n.length} lines shown)`),x.lineNumbers&&n.length>x.lineNumbers.length&&""===n[n.length-1].trim()&&n.pop(),{displayContent:n.join("\n"),elisionNotices:t}},[h,b.isDirectory,x.lineNumbers,m.summary]),k=(0,a.Kr)(()=>b.isDirectory||!g?{lines:[],cleanCode:"",hasLineNumbers:!1}:function(e,t){let n=e.replace(/\r?\n$/,"").split(/\r?\n/);if(0===n.length)return{lines:[],cleanCode:"",hasLineNumbers:!1};let i=[],r=0,a=0;for(let e of n){if(!e.trim()){i.push(null);continue}let t=e.match(/^(\s*(\d+):)/);if(t){let n=parseInt(t[2],10);i.push({lineNum:n,rawLine:e}),r++;continue}let n=e.match(/^(\s*(\d+)\s*[|│][ \t]?)/);if(n){let t=parseInt(n[2],10);i.push({lineNum:t,rawLine:e,pipePrefixLen:n[1].length}),a++;continue}i.push(null)}let l=n.filter(e=>e.trim().length>0),s=a>=2&&a>=.7*l.length,o=!s&&r>=2&&r>=.7*l.length&&(()=>{let e=i.filter(e=>null!==e).map(e=>e.lineNum);for(let t=1;t<e.length;t++)if(e[t]<e[t-1])return!1;return!0})();if(!s&&!o){let e=t?.lineNumbers,i="number"==typeof t?.startLine&&!isNaN(t.startLine)&&t.startLine>0?t.startLine:1;return{lines:n.map((t,n)=>{let r;if(e&&n<e.length){let t=e[n];r=null==t||""===t?"…":t}else r=i+n;return{lineNum:r,code:t}}),cleanCode:n.join("\n"),hasLineNumbers:!!(e&&e.length>0||i>1)}}if(s){let e=i.find(e=>null!==e)?.lineNum??1,t=[];for(let r=0;r<n.length;r++){let a=n[r],l=i[r];a.trim()?l&&void 0!==l.pipePrefixLen?(t.push({lineNum:l.lineNum,code:a.slice(l.pipePrefixLen)}),e=l.lineNum+1):(t.push({lineNum:e,code:a}),e++):(t.push({lineNum:e,code:""}),e++)}return{lines:t,cleanCode:t.map(e=>e.code).join("\n"),hasLineNumbers:!0}}let c=i.filter(e=>null!==e),d=String(Math.max(...c.map(e=>e.lineNum))).length+1,p=c.filter(e=>e.rawLine.length>d);p.length>0&&p.every(e=>" "===e.rawLine[d]||" "===e.rawLine[d])&&d++;let u=c[0]?.lineNum??1,m=[];for(let e=0;e<n.length;e++){let t=n[e],r=i[e];if(!t.trim()){m.push({lineNum:u,code:""}),u++;continue}if(r){u=r.lineNum;let e=t.length<=d?"":t.slice(d);m.push({lineNum:r.lineNum,code:e}),u=r.lineNum+1}else m.push({lineNum:u,code:t}),u++}return{lines:m,cleanCode:m.map(e=>e.code).join("\n"),hasLineNumbers:!0}}(g,x),[g,b.isDirectory,x]),y=b.isDirectory,w=(0,r2.sQ)(p),N=b.entries.slice(-1e3),Y=b.entries.length-N.length,D=(0,a.Kr)(()=>ac(k.cleanCode,1e3),[k.cleanCode]),A=D.skipped>0?k.lines.slice(D.skipped):k.lines,F=(0,r5.w)(),C=(0,a.Kr)(()=>D.text?(0,r2.wY)(D.text,w):"",[D,w,F]);return(0,i.FD)("div",{className:"space-y-2",children:[(0,i.FD)("div",{className:"flex items-center justify-between rounded-lg border border-ink/8 bg-paper px-3 py-2",children:[(0,i.FD)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,i.Y)("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded bg-ink/5 text-ink/70",children:y?(0,i.Y)(f.A,{size:12}):(0,i.Y)(rq.A,{size:12})}),(0,i.Y)("span",{className:"truncate font-mono text-[11px] font-medium text-ink",children:p||(y?"Directory Listing":"File Content")}),(0,i.Y)("span",{className:"rounded bg-ink/5 px-1.5 py-0.5 font-mono text-[9px] uppercase tracking-wider text-ink/50",children:y?"Directory":w})]}),h&&(0,i.Y)(rB,{text:k.hasLineNumbers?k.cleanCode:h||"",className:"flex shrink-0 cursor-pointer items-center gap-1 rounded px-1.5 py-0.5 text-[10.5px] text-ink/50 transition-colors hover:bg-ink/5 hover:text-ink",iconSize:11,label:"Copy"})]}),o?(0,i.FD)("div",{className:"flex items-center gap-2 rounded-lg border border-ink/8 bg-paper px-3 py-3 font-mono text-[11px] text-ink/50",children:[(0,i.Y)(tf.A,{size:12,className:"animate-spin"}),(0,i.Y)("span",{children:"Loading file content..."})]}):y?(0,i.FD)("div",{className:"overflow-hidden rounded-lg border border-ink/8 bg-paper",children:[Y>0&&(0,i.FD)("div",{className:"flex items-center gap-1.5 border-b border-ink/8 bg-canvas/60 px-3 py-1.5 text-[10px] text-ink/50",children:[(0,i.Y)(eC.A,{size:11,className:"shrink-0"}),(0,i.FD)("span",{children:["… ",Y," earlier entries hidden"]})]}),(0,i.Y)("div",{className:"max-h-72 divide-y divide-ink/[0.04] overflow-y-auto font-mono text-[11px]",children:N.map((e,t)=>(0,i.FD)("div",{className:"flex items-center gap-2 px-3 py-1.5 transition-colors hover:bg-ink/[0.02]",style:{paddingLeft:`${Math.max(12,(e.indent+1)*16)}px`},children:[e.isDir?(0,i.Y)(es.A,{size:12,className:"shrink-0 text-ink/60"}):(0,i.Y)(rG.A,{size:12,className:"shrink-0 text-ink/40"}),(0,i.FD)("span",{className:`min-w-0 flex-1 truncate ${e.isDir?"font-semibold text-ink":"text-ink/80"}`,children:[e.name,e.isDir&&"/"]}),e.size&&(0,i.Y)("span",{className:"shrink-0 font-mono text-[9.5px] text-ink/40",children:e.size}),e.time&&(0,i.Y)("span",{className:"shrink-0 rounded bg-ink/5 px-1 py-0.2 font-mono text-[9px] text-ink/45",children:e.time})]},t))}),b.notice&&(0,i.FD)("div",{className:"flex items-center gap-1.5 border-t border-ink/8 bg-canvas/60 px-3 py-1.5 text-[10px] text-ink/50",children:[(0,i.Y)(eC.A,{size:11,className:"shrink-0"}),(0,i.Y)("span",{children:b.notice})]})]}):h?(0,i.FD)("div",{className:"space-y-1.5",children:[D.skipped>0&&(0,i.FD)("div",{className:"flex items-center gap-2 rounded-lg border border-dashed border-ink/15 bg-canvas/50 px-3 py-1.5 font-mono text-[10.5px] text-ink/55",children:[(0,i.Y)(eC.A,{size:12,className:"shrink-0 text-ink/40"}),(0,i.FD)("span",{children:["… ",D.skipped," earlier lines hidden"]})]}),(0,i.FD)("div",{className:"relative flex max-h-80 items-start overflow-auto rounded-lg border border-ink/8 bg-paper font-mono text-[11px] leading-[20px] select-text overscroll-contain",children:[(0,i.Y)("div",{className:"sticky left-0 z-10 flex-shrink-0 select-none border-r border-ink/8 bg-canvas/90 py-2.5 pl-3 pr-2.5 text-right font-mono text-[11px] leading-[20px] tabular-nums text-ink/35 backdrop-blur-xs","aria-hidden":"true",children:A.map((e,t)=>(0,i.Y)("div",{className:"h-[20px] leading-[20px]",children:e.lineNum},t))}),(0,i.Y)("pre",{className:"m-0 flex-1 min-w-max overflow-visible py-2.5 pl-3 pr-4 font-mono text-[11px] leading-[20px] whitespace-pre text-ink/85 focus:outline-none",dangerouslySetInnerHTML:{__html:C}})]}),v.map((e,t)=>(0,i.FD)("div",{className:"flex items-center gap-2 rounded-lg border border-dashed border-ink/15 bg-canvas/50 px-3 py-1.5 font-mono text-[10.5px] text-ink/55",children:[(0,i.Y)(eC.A,{size:12,className:"shrink-0 text-ink/40"}),(0,i.Y)("span",{children:e})]},t))]}):(0,i.Y)("div",{className:"rounded-lg border border-dashed border-ink/15 px-3 py-3 font-mono text-[11px] text-ink/45",children:"File is ready for inspection."})]})}var lr=n("fQ"),la=n("BE");function ll(e){let{sections:t}=e,n=(0,r5.w)(),r=(0,a.Kr)(()=>t.map(e=>{let t=(0,r2.sQ)(e.path);return e.ops.map(e=>(0,r2.O9)(e.body.join("\n"),t))}),[t,n]);return(0,i.FD)("div",{className:"space-y-1.5",children:[(0,i.FD)("div",{className:"flex items-center justify-between text-[9.5px] font-semibold uppercase tracking-[0.14em] text-ink/40",children:[(0,i.Y)("span",{children:"Hashline Patch"}),t[0].tag&&(0,i.FD)("span",{className:"font-mono text-[9px] font-normal tracking-normal text-ink/50",children:["snapshot ",t[0].tag]})]}),(0,i.Y)("div",{className:"overflow-hidden rounded-lg border border-ink/8",children:t.map((e,t)=>(0,i.FD)("div",{className:"border-b border-ink/6 last:border-b-0",children:[(0,i.FD)("div",{className:"flex min-w-0 items-center gap-2 bg-canvas/40 px-2.5 py-1.5",children:[(0,i.Y)("span",{className:"truncate font-mono text-[10.5px] font-medium text-ink",children:e.path}),e.moveTo&&(0,i.FD)("span",{className:"shrink-0 font-mono text-[10px] text-ink/50",children:["→ ",e.moveTo]}),e.removed&&(0,i.Y)("span",{className:"shrink-0 rounded bg-error/10 px-1.5 font-mono text-[9px] uppercase tracking-wider text-error",children:"Removes file"})]}),(0,i.Y)("div",{className:"overflow-x-auto",children:e.ops.map((e,n)=>(0,i.FD)("div",{children:[(0,i.FD)("div",{className:"flex items-center gap-2 px-2.5 py-1",children:[(0,i.Y)("span",{className:`shrink-0 rounded px-1.5 font-mono text-[9px] font-semibold ${"CUT"===e.verb?"bg-error/10 text-error":"bg-success/10 text-success"}`,children:e.verb}),e.spec&&(0,i.Y)("span",{className:"font-mono text-[10.5px] text-ink/70",children:e.spec})]}),e.body.map((e,a)=>{let l=r[t]?.[n]?.[a]||"";return l?(0,i.Y)("div",{className:"shiki whitespace-pre bg-success/[0.05] px-2.5 font-mono text-[11px] leading-relaxed",dangerouslySetInnerHTML:{__html:l}},a):(0,i.Y)("div",{className:"whitespace-pre bg-success/[0.05] px-2.5 font-mono text-[11px] leading-relaxed text-success/90",children:e},a)})]},`${e.verb}-${e.spec}-${n}`))})]},e.path))})]})}var ls=n("e");function lo(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"diff",i=e?e.split(/\r?\n/):[],r=t?t.split(/\r?\n/):[],a=0;for(;a<i.length&&a<r.length&&i[a]===r[a];)a++;let l=0;for(;l<i.length-a&&l<r.length-a&&i[i.length-1-l]===r[r.length-1-l];)l++;let s=i.slice(Math.max(0,a-2),a),o=i.slice(a,i.length-l),c=r.slice(a,r.length-l),d=i.slice(i.length-l,i.length-l+2),p=n||"diff",u=[`--- a/${p}`,`+++ b/${p}`,`@@ -1,${i.length||1} +1,${r.length||1} @@`];for(let e of s)u.push(` ${e}`);for(let e of o)u.push(`-${e}`);for(let e of c)u.push(`+${e}`);for(let e of d)u.push(` ${e}`);return u.join("\n")}function lc(e){let{tool:t}=e,n="write"===t.type||"write"===t.name||"create_file"===t.type,r=t.input,l="object"==typeof r&&null!==r?r:void 0,s=(0,a.Kr)(()=>(0,ls.I)(l),[l]),o=t.target||s?.sections[0].path||l?.path||l?.TargetFile||l?.targetFile||l?.FilePath||l?.filePath||l?.AbsolutePath||l?.absolutePath||("string"==typeof t.details?.path?t.details.path:void 0)||("string"==typeof r&&(r.includes("/")||r.includes("."))?r:void 0)||"",c="string"==typeof l?.content?l.content:"string"==typeof l?.Content?l.Content:void 0,d="string"==typeof l?.old_string?l.old_string:"string"==typeof l?.oldString?l.oldString:"string"==typeof l?.TargetContent?l.TargetContent:"string"==typeof l?.targetContent?l.targetContent:void 0,p="string"==typeof l?.new_string?l.new_string:"string"==typeof l?.newString?l.newString:"string"==typeof l?.ReplacementContent?l.ReplacementContent:"string"==typeof l?.replacementContent?l.replacementContent:void 0,u=Array.isArray(l?.ReplacementChunks)?l.ReplacementChunks:void 0,m=t.diff?.diffText||("string"==typeof t.details?.diff?t.details.diff:void 0)||("string"==typeof t.details?.patch?t.details.patch:void 0),h=(0,a.Kr)(()=>m||(u&&u.length>0?u.map(e=>lo(e.TargetContent||"",e.ReplacementContent||"",o)).join("\n"):d||p?lo(d||"",p||"",o):void 0),[m,u,d,p,o]),b=t.output||"",f=(0,r2.sQ)(o),x=(0,a.Kr)(()=>d?ac(d,1e3):null,[d]),g=(0,a.Kr)(()=>p?ac(p,1e3):null,[p]),v=(0,r5.w)(),k=(0,a.Kr)(()=>x?(0,r2.wY)(x.text,f):"",[x,f,v]),y=(0,a.Kr)(()=>g?(0,r2.wY)(g.text,f):"",[g,f,v]),w=(0,a.Kr)(()=>c?c.split("\n").length:0,[c]),N=(0,a.Kr)(()=>c?(0,r2.wY)(c.split("\n").slice(0,80).join("\n"),f):"",[c,f,v]),Y=(0,a.Kr)(()=>ac(b,1e3),[b]),D=(0,a.Kr)(()=>(0,r2.rw)(b)?(0,r2.wY)(Y.text,f):"",[b,Y,f,v]);return(0,i.FD)("div",{className:"space-y-2.5",children:[(0,i.FD)("div",{className:"flex items-center justify-between rounded-lg border border-ink/8 bg-paper px-3 py-2",children:[(0,i.FD)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,i.Y)("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded bg-ink/5 text-ink/70",children:n?(0,i.Y)(lr.A,{size:12}):(0,i.Y)(la.A,{size:12})}),(0,i.Y)("span",{className:"truncate font-mono text-[11px] font-medium text-ink",children:o||"File modification"}),(0,i.Y)("span",{className:"rounded bg-ink/5 px-1.5 py-0.5 font-mono text-[9px] uppercase tracking-wider text-ink/50",children:n?"Write":"Edit"})]}),(c||p||s)&&(0,i.Y)(rB,{text:s?.text||c||p||b,className:"flex shrink-0 cursor-pointer items-center gap-1 rounded px-1.5 py-0.5 text-[10.5px] text-ink/50 transition-colors hover:bg-ink/5 hover:text-ink",iconSize:11,label:"Copy"})]}),h&&(0,i.FD)("div",{className:"space-y-1",children:[(0,i.Y)("div",{className:"text-[9.5px] font-semibold uppercase tracking-[0.14em] text-ink/40",children:"Diff Changes"}),(0,i.Y)(r3,{text:h})]}),!h&&s&&(0,i.Y)(ll,{sections:s.sections}),!h&&(d||p)&&(0,i.FD)("div",{className:"space-y-1.5",children:[(0,i.Y)("div",{className:"text-[9.5px] font-semibold uppercase tracking-[0.14em] text-ink/40",children:"Replacement Changes"}),(0,i.FD)("div",{className:"overflow-hidden rounded-lg border border-ink/8",children:[d&&(0,i.FD)("div",{className:"border-b border-ink/6 bg-error/[0.04] p-2.5",children:[(0,i.Y)("div",{className:"mb-1 flex items-center gap-1 text-[9.5px] font-semibold uppercase tracking-wider text-error",children:(0,i.Y)("span",{children:"- Original Content"})}),x&&x.skipped>0&&(0,i.FD)("div",{className:"mb-1 font-mono text-[9.5px] text-ink/45",children:["… ",x.skipped," earlier lines hidden"]}),(0,i.Y)("pre",{className:"max-h-40 overflow-x-auto font-mono text-[11px] leading-relaxed text-error/90 whitespace-pre-wrap break-words",dangerouslySetInnerHTML:{__html:k}})]}),p&&(0,i.FD)("div",{className:"bg-success/[0.04] p-2.5",children:[(0,i.Y)("div",{className:"mb-1 flex items-center gap-1 text-[9.5px] font-semibold uppercase tracking-wider text-success",children:(0,i.Y)("span",{children:"+ Replaced With"})}),g&&g.skipped>0&&(0,i.FD)("div",{className:"mb-1 font-mono text-[9.5px] text-ink/45",children:["… ",g.skipped," earlier lines hidden"]}),(0,i.Y)("pre",{className:"max-h-48 overflow-x-auto font-mono text-[11px] leading-relaxed text-success/90 whitespace-pre-wrap break-words",dangerouslySetInnerHTML:{__html:y}})]})]})]}),!h&&!d&&!p&&c&&(0,i.FD)("div",{className:"space-y-1.5",children:[(0,i.FD)("div",{className:"flex items-center justify-between text-[9.5px] font-semibold uppercase tracking-[0.14em] text-ink/40",children:[(0,i.FD)("span",{className:"flex items-center gap-1",children:[(0,i.Y)(rq.A,{size:11}),(0,i.Y)("span",{children:"Written File Preview"})]}),(0,i.FD)("span",{className:"font-mono text-[9px] text-ink/50",children:[w," lines · ",tl(c.length)]})]}),(0,i.FD)("div",{className:"flex max-h-64 items-start overflow-x-auto rounded-lg border border-ink/8 bg-paper font-mono text-[11px] leading-[20px] select-text overscroll-contain",children:[(0,i.FD)("div",{className:"sticky left-0 z-10 flex-shrink-0 select-none border-r border-ink/8 bg-canvas/60 py-2.5 pl-2.5 pr-2 text-right font-mono text-[11px] leading-[20px] tabular-nums text-ink/25","aria-hidden":"true",children:[Array.from({length:Math.min(w,80)},(e,t)=>(0,i.Y)("div",{className:"h-[20px] leading-[20px]",children:t+1},t)),w>80&&(0,i.Y)("div",{className:"h-[20px] leading-[20px]",children:"…"})]}),(0,i.Y)("div",{className:"m-0 flex-1 min-w-max overflow-visible py-2.5 pl-3 pr-4 leading-[20px] whitespace-pre text-ink/85",dangerouslySetInnerHTML:{__html:N}})]})]}),b&&(0,i.FD)("div",{className:"rounded-lg border border-ink/8 bg-paper p-2.5 text-[11px] font-mono select-text",children:[(0,i.FD)("div",{className:"flex items-center gap-1.5 mb-1.5 text-[9.5px] font-semibold uppercase tracking-wider text-ink/40",children:[(0,i.Y)(a2.A,{size:11,className:"text-success"}),(0,i.Y)("span",{children:"Execution Output"})]}),(0,r2.rw)(b)?(0,i.FD)(i.FK,{children:[Y.skipped>0&&(0,i.FD)("div",{className:"mb-1 font-mono text-[9.5px] text-ink/45",children:["… ",Y.skipped," earlier lines hidden"]}),(0,i.Y)("pre",{className:"max-h-56 overflow-auto rounded bg-canvas/40 p-2 text-ink/85 whitespace-pre leading-relaxed scrollbar-overlay-container scrollbar-overlay-static",dangerouslySetInnerHTML:{__html:D}})]}):(0,i.Y)("div",{className:"text-ink/75 leading-relaxed whitespace-pre-wrap",children:Y.text})]})]})}function ld(e){let{value:t}=e;return Array.isArray(t)?(0,i.Y)(lp,{items:t}):(0,ig.u)(t)?(0,i.Y)(lu,{data:t}):"string"==typeof t?t.length>120||t.includes("\n")?(0,i.Y)("div",{className:"prose-content max-h-60 overflow-auto rounded-lg border border-ink/8 bg-paper px-3 py-2.5 text-[12px] leading-relaxed text-ink/85 select-text",children:(0,i.Y)(rU.T,{content:t})}):(0,i.Y)("span",{className:"break-words text-[12px] leading-relaxed text-ink/85",children:t}):(0,i.Y)("span",{className:"font-mono text-[12px] text-ink/85",children:JSON.stringify(t)??""})}function lp(e){let{items:t}=e,n=t.slice(0,50);return(0,i.FD)("div",{className:"space-y-1",children:[(0,i.Y)("ol",{className:"divide-y divide-ink/6 overflow-hidden rounded-lg border border-ink/8 bg-canvas/40",children:n.map((e,t)=>(0,i.FD)("li",{className:"flex items-start gap-2 px-2.5 py-1.5",children:[(0,i.Y)("span",{className:"mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded bg-ink/5 font-mono text-[9px] text-ink/45",children:t+1}),(0,i.Y)("div",{className:"min-w-0 flex-1",children:(0,i.Y)(ld,{value:e})})]},t))}),t.length>n.length&&(0,i.FD)("div",{className:"font-mono text-[10px] text-ink/45",children:["… ",t.length-n.length," more items"]})]})}function lu(e){let{data:t}=e,n=Object.entries(t);return 0===n.length?(0,i.Y)("div",{className:"rounded-lg border border-ink/8 bg-canvas/40 px-2.5 py-2 text-[11px] text-ink/45",children:"Empty object"}):(0,i.Y)("div",{className:"divide-y divide-ink/6 overflow-hidden rounded-lg border border-ink/8 bg-canvas/40",children:n.map(e=>{let[t,n]=e,r=Array.isArray(n)?`list \xb7 ${n.length}`:(0,ig.u)(n)?"json":"string"==typeof n?"markdown":typeof n;return(0,i.FD)("div",{className:"px-2.5 py-2",children:[(0,i.FD)("div",{className:"mb-1 flex items-center gap-1.5",children:[(0,i.Y)(r8.A,{size:10.5,className:"shrink-0 text-ink/45"}),(0,i.Y)("span",{className:"truncate font-mono text-[10.5px] font-semibold text-ink",title:t,children:t}),(0,i.Y)("span",{className:"shrink-0 rounded bg-ink/5 px-1.5 py-0.2 font-mono text-[8.5px] uppercase tracking-wider text-ink/50",children:r})]}),(0,i.Y)(ld,{value:n})]},t)})})}function lm(e){let{tool:t}=e,n="object"==typeof t.input&&null!==t.input?t.input:void 0,r="string"==typeof n?.path?n.path:t.target||"",l="string"==typeof t.name?t.name:"",s=(r?r.replace(/^xd:\/\//,""):l).replace(/^mcp__/,""),o="string"==typeof n?.content?n.content:"",c=(0,a.Kr)(()=>o?(0,r2.Bl)(o):{isValid:!1},[o]),d=c.isValid?c.data:void 0,p=(0,ig.u)(d)||Array.isArray(d),u=(0,a.Kr)(()=>t.output?(0,r2.Bl)(t.output):{isValid:!1},[t.output]),m=u.isValid?u.data:void 0,h=(0,ig.u)(m)||Array.isArray(m);return(0,i.FD)("div",{className:"space-y-2",children:[(0,i.FD)("div",{className:"flex items-center gap-1.5 rounded-lg border border-ink/8 bg-paper px-2.5 py-1.5",children:[(0,i.Y)($.A,{size:12,className:"shrink-0 text-ink/60"}),(0,i.Y)("span",{className:"truncate font-mono text-[10.5px] font-semibold text-ink",children:s||"MCP Tool"}),(0,i.Y)("span",{className:"shrink-0 rounded bg-ink/5 px-1.5 py-0.2 font-mono text-[8.5px] uppercase tracking-wider text-ink/50",children:"MCP"})]}),o&&p?(0,i.Y)(ld,{value:d}):o?(0,i.Y)("div",{className:"prose-content max-h-72 overflow-auto rounded-lg border border-ink/8 bg-paper px-3 py-2.5 text-[12px] leading-relaxed text-ink/85 select-text",children:(0,i.Y)(rU.T,{content:o})}):null,t.output&&h?(0,i.FD)("div",{className:"space-y-1",children:[(0,i.Y)("div",{className:"text-[9.5px] font-semibold uppercase tracking-[0.14em] text-ink/40",children:"Result"}),(0,i.Y)(ld,{value:m})]}):t.output?(0,i.Y)(ad,{text:t.output}):null]})}function lh(e){if(e.target)return e.target;if(e.diff?.file)return e.diff.file;if(e.input&&"object"==typeof e.input){let t=e.input;if("string"==typeof t.path)return t.path;if("string"==typeof t.TargetFile)return t.TargetFile;if("string"==typeof t.targetFile)return t.targetFile;if("string"==typeof t.FilePath)return t.FilePath;if("string"==typeof t.filePath)return t.filePath;if("string"==typeof t.AbsolutePath)return t.AbsolutePath;if("string"==typeof t.absolutePath)return t.absolutePath;if("string"==typeof t.file)return t.file;let n=(0,ls.f$)(t);if(n)return n}return"string"==typeof e.details?.path?e.details.path:"string"==typeof e.input&&(e.input.includes(".")||e.input.includes("/"))?e.input:e.detail&&(e.detail.includes(".")||e.detail.includes("/"))?e.detail:void 0}function lb(e){let t=e.details;if(t?.xdev?.tool&&"string"==typeof t.xdev.tool)return t.xdev.tool.toLowerCase();let n=(e.target||"").toLowerCase(),i=am(e.input)?.toLowerCase()??"",r=n.startsWith("xd://")?n.slice(5):i.startsWith("xd://")?i.slice(5):"";if(r){let e=r.split(/[/?#]/)[0].trim();if(e)return e}let a=(e.name||"").toLowerCase(),l=(e.type||"").toLowerCase(),s=(e.title||"").toLowerCase();if(a&&"tool"!==a&&"custom"!==a)return a;let o=s.split(/[\s—\-:]+/)[0]?.trim();return["grep","glob","read","write","edit","bash","terminal","run_command","todo","eval","hub","lsp","github","task","resolve","reject"].includes(o)?o:l}function lf(e){let{tool:t}=e,n=lb(t);if("read"===n||"read_file"===n||"view_file"===n||"read_file_content"===n){let e=lh(t);return(0,i.Y)(li,{tool:t,targetFilePath:e,output:t.output||""})}return"edit"===n||"write"===n||"edit_file"===n||"create_file"===n||"write_to_file"===n||"replace_file_content"===n||"multi_edit_file"===n?(0,i.Y)(lc,{tool:t}):"task"===n?(0,i.Y)(an,{tool:t}):"todo"===n?(0,i.Y)(ap,{tool:t}):"grep"===n||"glob"===n||"ast_grep"===n?(0,i.Y)(aM,{tool:t}):"search_fs"===n?(0,i.Y)(le,{tool:t}):"web_search"===n?(0,i.Y)(av,{tool:t}):"bash"===n||"terminal"===n||"run_command"===n?(0,i.Y)(aC,{tool:t}):"eval"===n?(0,i.Y)(ay,{tool:t}):"lsp"===n?(0,i.Y)(af,{tool:t}):"ast_edit"===n?(0,i.Y)(a5,{tool:t}):"resolve"===n||"reject"===n?(0,i.Y)(a3,{tool:t}):"hub"===n?(0,i.Y)(aI,{tool:t}):"github"===n?(0,i.Y)(aY,{tool:t}):"checkpoint"===n||"rewind"===n?(0,i.Y)(aF,{tool:t}):"security_scan"===n?(0,i.Y)(aj,{tool:t}):"debug"===n?(0,i.Y)(aG,{tool:t}):"manage_skill"===n?(0,i.Y)(a7,{tool:t}):"context_notes"===n||"new_context"===n?(0,i.Y)(aJ,{tool:t}):"memory_edit"===n||"retain"===n||"recall"===n||"reflect"===n||"learn"===n?(0,i.Y)(aK,{tool:t}):"goal"===n||"yield"===n?(0,i.Y)(a0,{tool:t}):"ask"===n?(0,i.Y)(lt,{tool:t}):"think"===n?(0,i.Y)(ln,{tool:t}):n.startsWith("mcp__")||"string"==typeof t.name&&t.name.startsWith("mcp__")?(0,i.Y)(lm,{tool:t}):null}let lx={github:"GitHub",openai:"OpenAI",gitlab:"GitLab",sqlite:"SQLite",postgresql:"PostgreSQL",mysql:"MySQL",mongodb:"MongoDB",redis:"Redis",docker:"Docker",kubernetes:"Kubernetes",vercel:"Vercel",bun:"Bun",node:"Node",deno:"Deno",react:"React",vue:"Vue",svelte:"Svelte",angular:"Angular",next:"Next",nuxt:"Nuxt",remix:"Remix",tailwind:"Tailwind",prisma:"Prisma",zod:"Zod",axios:"Axios",express:"Express",fastify:"Fastify",koa:"Koa",hono:"Hono",elysia:"Elysia",drizzle:"Drizzle",kysely:"Kysely",biome:"Biome",oxc:"Oxc",rolldown:"Rolldown",turbopack:"Turbopack",vite:"Vite",webpack:"Webpack",rollup:"Rollup",esbuild:"Esbuild",babel:"Babel",swc:"SWC",typescript:"TypeScript",javascript:"JavaScript",coffeescript:"CoffeeScript",dart:"Dart",kotlin:"Kotlin",swift:"Swift",rust:"Rust",python:"Python",ruby:"Ruby",php:"PHP",perl:"Perl",lua:"Lua",scala:"Scala",haskell:"Haskell",elixir:"Elixir",erlang:"Erlang",clojure:"Clojure",ocaml:"OCaml",zig:"Zig",nim:"Nim",crystal:"Crystal",julia:"Julia",groovy:"Groovy",powershell:"PowerShell",bash:"Bash",zsh:"Zsh",fish:"Fish",grep:"Grep",find:"Find",glob:"Glob",ls:"Ls",cat:"Cat",echo:"Echo",mkdir:"Mkdir",rm:"Rm",cp:"Cp",mv:"Mv",touch:"Touch",chmod:"Chmod",chown:"Chown",sudo:"Sudo",apt:"Apt",brew:"Brew",npm:"Npm",pnpm:"Pnpm",yarn:"Yarn",playwright:"Playwright",cypress:"Cypress",puppeteer:"Puppeteer",selenium:"Selenium",jest:"Jest",vitest:"Vitest",mocha:"Mocha",chai:"Chai",sinon:"Sinon",karma:"Karma",jasmine:"Jasmine",qunit:"QUnit",ava:"Ava",tape:"Tape",lodash:"Lodash",underscore:"Underscore",ramda:"Ramda",rxjs:"RxJS",redux:"Redux",zustand:"Zustand",jotai:"Jotai",recoil:"Recoil",mobx:"MobX",xstate:"XState",framer:"Framer",motion:"Motion",gsap:"GSAP",anime:"Anime",three:"Three",babylon:"Babylon",pixi:"Pixi",phaser:"Phaser",matter:"Matter",planck:"Planck",rapier:"Rapier",cannon:"Cannon",ammo:"Ammo",bullet:"Bullet",box2d:"Box2D",chipmunk:"Chipmunk",verlet:"Verlet",ode:"ODE",physx:"PhysX",havok:"Havok",unity:"Unity",unreal:"Unreal",godot:"Godot",bevy:"Bevy",amethyst:"Amethyst",macroquad:"Macroquad",miniquad:"Miniquad",sdl:"SDL",sfml:"SFML",glfw:"GLFW",opengl:"OpenGL",vulkan:"Vulkan",directx:"DirectX",metal:"Metal",webgpu:"WebGPU",webgl:"WebGL",canvas:"Canvas",webaudio:"WebAudio",webmidi:"WebMIDI",webrtc:"WebRTC",websocket:"WebSocket",sse:"SSE",eventsource:"EventSource",fetch:"Fetch",xhr:"XHR",ky:"Ky",got:"Got",undici:"Undici",superagent:"Superagent",request:"Request",needle:"Needle",bent:"Bent",r2:"R2",s3:"S3",gcs:"GCS",azure:"Azure",blob:"Blob",storage:"Storage",firebase:"Firebase",supabase:"Supabase",pocketbase:"PocketBase",appwrite:"Appwrite",nhost:"Nhost",hasura:"Hasura",graphql:"GraphQL",rest:"REST",grpc:"gRPC",trpc:"tRPC",soap:"SOAP",mqtt:"MQTT",amqp:"AMQP",kafka:"Kafka",rabbitmq:"RabbitMQ",pubsub:"PubSub",nats:"NATS",zeromq:"ZeroMQ",dds:"DDS",coap:"CoAP",ble:"BLE",zigbee:"Zigbee",lora:"LoRa",nbiot:"NB-IoT",lte:"LTE",wifi:"Wi-Fi",ethernet:"Ethernet",usb:"USB",hdmi:"HDMI",displayport:"DisplayPort",thunderbolt:"Thunderbolt",pcie:"PCIe",nvme:"NVMe",sata:"SATA",ddr:"DDR",ecc:"ECC",xmp:"XMP",docsis:"DOCSIS",gpon:"GPON",epon:"EPON",pon:"PON",olt:"OLT",ont:"ONT",onu:"ONU",odn:"ODN",p2mp:"P2MP",p2p:"P2P",ftth:"FTTH",fttb:"FTTB",fttc:"FTTC",fttn:"FTTN",hfc:"HFC",dsl:"DSL",adsl:"ADSL",vdsl:"VDSL",sdsl:"SDSL",shdsl:"SHDSL",isdn:"ISDN",pstn:"PSTN",pots:"POTS",voip:"VoIP",sip:"SIP",rtp:"RTP",rtcp:"RTCP",rtsp:"RTSP",hls:"HLS",dash:"DASH",mpeg:"MPEG",av1:"AV1",vp9:"VP9",vp8:"VP8",hevc:"HEVC",avc:"AVC",mp4:"MP4",mkv:"MKV",avi:"AVI",mov:"MOV",wmv:"WMV",flv:"FLV",webm:"WebM",ogg:"OGG",mp3:"MP3",wav:"WAV",flac:"FLAC",aac:"AAC",midi:"MIDI",opus:"OPUS",alac:"ALAC",ape:"APE",wavpack:"WavPack"},lg=new Set(["MCP","AST","LSP","DAP","RPC","SSH","TTS","STT","URL","API","JSON","SQL","CSS","HTML","JS","TS","PDF","PR","UI","UX","DB","CLI","TUI","IDE","HTTP","HTTPS","OAUTH","YAML","XML","CSV","PNG","SVG","WASM","AI","ML","LLM","RAG","SDK","GUI","DOM","ESM","CJS","UMD","IIFE","XHR","TCP","UDP","DNS","IP","GPU","CPU","RAM","SSD","HDD","FIFO","PTY","TTY","WEB"]);function lv(e){if(!e)return e;let t=e.split("__"),n=t.length>1?t[0]:null,i=t[t.length-1].split(/[_\-\s]+/).filter(Boolean).map(e=>{let t=lx[e.toLowerCase()];if(t)return t;let n=e.toUpperCase();return lg.has(n)?n:e.charAt(0).toUpperCase()+e.slice(1)}).join(" ");return n?`${n.toUpperCase()} ${i}`:i}function lk(e){let t="object"==typeof e.input&&null!==e.input?e.input:void 0,n="string"==typeof t?.path?t.path:e.target||"",i=(n.startsWith("xd://")?n.slice(5):"string"==typeof e.name&&e.name.startsWith("mcp__")?e.name:"").split(/[/?#]/)[0].trim();return i.startsWith("mcp__")?i.slice(5):void 0}function ly(e){let t=e.details?.xdev;return t&&"object"==typeof t?t:void 0}function lw(e){let{children:t}=e;return(0,i.Y)("div",{className:"text-[9.5px] font-semibold uppercase tracking-[0.14em] text-ink/40",children:t})}let lN=(0,s.ph)(function(e){let t,{tool:n,isOpen:r,onToggle:l,defaultExpanded:s=!1}=e,o=lb(n),c=(0,a.Kr)(()=>null!==lf({tool:n}),[n]),d=n.command?n.command:"string"==typeof n.input?n.input:n.input&&"object"==typeof n.input?JSON.stringify(n.input,null,2):(n.target||n.detail)&&(n.target||n.detail)||"",p=n.output||(n.error?`Error: ${n.error}`:""),u=function(e){if(e.diff?.diffText)return e.diff.diffText;let t=e.details;if(t&&"object"==typeof t){if("string"==typeof t.patch)return t.patch;if("string"==typeof t.diff)return t.diff}}(n),m=(0,a.hb)(()=>{l?.(n.id)},[l,n.id]),h=(0,a.Kr)(()=>!c&&d?(0,r2.Bl)(d):null,[c,d]),b="";if("lsp"===o){b="LSP";let e=ly(n);e?.args?.action&&(t=`${e.args.action}${e.args.file?` \xb7 ${e.args.file}`:""}`)}else if("ast_edit"===o){b="AST Edit";let e=ly(n);e?.args?.paths?.[0]&&(t=e.args.paths[0])}else if("resolve"===o)b="Resolve Proposal";else if("reject"===o)b="Reject Proposal";else if("yield"===o)b="error"===n.status?"Yield":p?`Yield - ${p}`:"Yield";else if("todo"===o||"todo"===n.name||"todo"===n.type||n.title&&n.title.toLowerCase().startsWith("todo")){b="Todo";let e=function(e){let t=ar(e);if(t.totalTasks>0||t.groups.length>0)return t.summaryText}(n);if(e)t=e;else if(n.title&&(n.title.includes("—")||n.title.includes(" - ")||n.title.includes(": "))){let e=n.title.split(/\s+[—\-:]\s+/).slice(1).join(" — ").trim();t=e.split(/\s*·\s*/).filter(e=>!/^0\s+(complete|in progress|pending)/i.test(e)).join(" · ")||e}}else if(lk(n)){let e="object"==typeof n.input&&null!==n.input?n.input:void 0;b=lv(lk(n));let i=function(e,t){if(e.intent)return e.intent;let n="string"==typeof t?.content?t.content:"",i=n?(0,r2.Bl)(n):{isValid:!1,data:void 0},r=i.isValid?i.data:t;if(r&&"object"==typeof r){let e=["query","q","pattern","pat","name","sql","path","symbol","url","command"].find(e=>"string"==typeof r[e]&&r[e]);if(e)return r[e]}}(n,e);i&&(t=i.length>80?`${i.slice(0,79)}…`:i)}else if(n.title&&(n.title.includes("—")||n.title.includes(" - ")||n.title.includes(": "))){let e=n.title.split(/\s+[—\-:]\s+/);b=lv(e[0].trim()),t=e.slice(1).join(" — ").trim()}else b=n.title?lv(n.title):lv(o||n.name||"Tool Call");if(("task"===o||"task"===n.name)&&!t){let e="object"==typeof n.input&&null!==n.input?n.input:void 0,i=Array.isArray(e?.tasks)?e.tasks[0]:void 0;i?.name&&(t=`${i.name}${i.agent?` \xb7 ${i.agent}`:""}`)}let f=lh(n),x=t&&!t.startsWith("xd://")?t:f&&!f.startsWith("xd://")?f:t||(n.detail&&!f?n.detail:void 0),g=n.duration||n.time?(0,i.Y)("span",{className:"font-mono text-[10px] text-ink/40",children:n.duration||n.time}):null;return(0,i.FD)(r1,{tool:n,icon:n.icon||function(e){switch(e){case"bash":case"terminal":return(0,i.Y)(w.A,{size:14});case"edit":case"write":case"edit_file":case"create_file":case"ast_edit":return(0,i.Y)(rq.A,{size:14});case"read":case"read_file":case"view_file":return(0,i.Y)(rG.A,{size:14});case"glob":case"grep":case"search_fs":case"ast_grep":return(0,i.Y)(_.A,{size:14});case"web_search":return(0,i.Y)(em.A,{size:14});case"todo":case"task":return(0,i.Y)(rV.A,{size:14});case"eval":return(0,i.Y)(eo.A,{size:14});case"lsp":return(0,i.Y)(j.A,{size:14});case"resolve":case"reject":return(0,i.Y)(D.A,{size:14});case"hub":return(0,i.Y)(ef.A,{size:14});case"ask":return(0,i.Y)(rQ.A,{size:14});case"think":return(0,i.Y)(r_.A,{size:14});case"security_scan":return(0,i.Y)(eb.A,{size:14});case"checkpoint":case"rewind":return(0,i.Y)(ey.A,{size:14});case"github":return(0,i.Y)(rZ.A,{size:14});case"memory_edit":case"retain":case"recall":case"reflect":case"learn":return(0,i.Y)(rp.A,{size:14});default:if(e.startsWith("mcp__"))return(0,i.Y)($.A,{size:14});return(0,i.Y)(rX.A,{size:14})}}(o),title:b,subtitle:x,meta:g,isOpen:r,onToggle:l?m:void 0,defaultExpanded:s,alwaysExpanded:"yield"===o&&c,children:[(0,i.Y)(lf,{tool:n}),!c&&d&&(0,i.FD)("div",{className:"space-y-1.5 code-surface",children:[(0,i.FD)("div",{className:"flex items-center justify-between",children:[(0,i.FD)("div",{className:"flex items-center gap-1.5",children:[(0,i.Y)(lw,{children:"Input"}),h?.isValid&&(0,i.Y)("span",{className:"rounded bg-ink/5 px-1.5 py-0.2 font-mono text-[9px] uppercase tracking-wider text-ink/45",children:"JSON"})]}),(0,i.Y)(rB,{text:h?.isValid&&h.pretty?h.pretty:d,className:"flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[10px] text-ink/45 transition-colors hover:bg-ink/5 hover:text-ink",onClick:e=>e.stopPropagation(),label:"Copy"})]}),h?.isValid&&h.pretty?(0,i.Y)(r7,{jsonString:h.pretty,maxHeightClass:"max-h-60",showHeader:!1}):(0,i.Y)("pre",{className:"overflow-x-auto rounded-lg border border-ink/8 bg-paper px-3 py-2.5 font-mono text-[11px] leading-relaxed whitespace-pre-wrap break-all text-ink/80 select-text",children:d})]}),!c&&u&&(0,i.FD)("div",{className:"space-y-1.5",children:[(0,i.Y)(lw,{children:"Diff"}),(0,i.Y)(r3,{text:u})]}),!c&&p&&(0,i.Y)(ad,{text:p})]})});function lY(e){let{tools:t,title:n,defaultExpanded:r=!1}=e,l=(0,a.Kr)(()=>(t||[]).map((e,t)=>(function(e,t){if("id"in e&&e.id)return e;let n=e.title||"",i=n.toLowerCase(),r="terminal";i.includes("shell")||i.includes("command")||i.includes("bun")||i.includes("git")?r="bash":i.includes("edit")||i.includes("write")?r="edit_file":i.includes("read")||i.includes("view")||i.includes("cat")||i.includes("inspect")?r="read_file":(i.includes("search")||i.includes("find")||i.includes("grep"))&&(r="search_fs");let a=n.replace(/[^a-zA-Z0-9]/g,"-").toLowerCase()||"tool",l="type"in e&&e.type?e.type:r;return{id:`stable-tool-${t}-${a}`,type:l,title:e.title,duration:e.time,time:e.time,detail:e.detail,target:"target"in e&&e.target?e.target:"read_file"===l||"edit_file"===l||"create_file"===l?e.detail:void 0,command:e.command||("bash"===l?e.detail:void 0),output:e.output,status:e.status||"success",icon:e.icon,diff:"diff"in e?e.diff:void 0,input:"input"in e?e.input:void 0}})(e,t)),[t]),[s,o]=(0,a.J0)(()=>{let e={};return l.forEach((t,n)=>{let i=!rH(t)&&("error"===t.status||r&&0===n);e[t.id]=i}),e}),c=(0,a.hb)(e=>{o(t=>({...t,[e]:!t[e]}))},[]);return l&&0!==l.length?(0,i.FD)("div",{className:"mx-3 space-y-1.5",children:[n&&(0,i.FD)("div",{className:"flex items-center gap-2 px-1 pt-0.5",children:[(0,i.Y)("span",{className:"text-[9.5px] font-semibold uppercase tracking-[0.14em] text-ink/35",children:n}),(0,i.Y)("span",{className:"h-px flex-1 bg-ink/8"})]}),l.map(e=>(0,i.Y)(lN,{tool:e,isOpen:!!s[e.id],onToggle:c},e.id))]}):null}var lD=n("Sb");function lA(e){let{task:t}=e;(0,r5.w)();let n=t.structuredOutput,r=!t.formattedJson&&(0,r2.rw)(t.rawOutput),[l,s]=(0,a.J0)(n||!r?"formatted":"raw");return(0,i.FD)("div",{className:"space-y-3",children:[(0,i.FD)("div",{className:"flex items-center justify-between border-b border-ink/8 pb-2",children:[(0,i.FD)("div",{className:"flex items-center gap-1.5",children:[(n||!r)&&(0,i.FD)("button",{type:"button",onClick:()=>s("formatted"),className:`flex items-center gap-1.5 rounded-md px-2.5 py-1 text-[11px] font-medium transition-colors ${"formatted"===l?"bg-ink/10 text-ink":"text-ink/60 hover:bg-ink/5 hover:text-ink"}`,children:[(0,i.Y)(tn.A,{size:12}),(0,i.Y)("span",{children:n?"Overview":"Markdown"})]}),(0,i.FD)("button",{type:"button",onClick:()=>s("raw"),className:`flex items-center gap-1.5 rounded-md px-2.5 py-1 text-[11px] font-medium transition-colors ${"raw"===l?"bg-ink/10 text-ink":"text-ink/60 hover:bg-ink/5 hover:text-ink"}`,children:[(0,i.Y)(tW.A,{size:12}),(0,i.Y)("span",{children:t.formattedJson?"Raw JSON":r?"Code":"Raw Text"})]})]}),(0,i.Y)(rB,{text:t.formattedJson||t.rawOutput,className:"flex items-center gap-1 rounded-md px-2 py-1 text-[10.5px] font-medium text-ink/60 transition-colors hover:bg-ink/5 hover:text-ink",iconSize:12,title:"Copy payload",resetMs:1800,wrapLabel:!0,copiedLabelClassName:"text-success",label:"Copy"})]}),"formatted"===l&&(n?(0,i.FD)("div",{className:"space-y-3 text-[11.5px]",children:[n.summary&&(0,i.FD)("div",{className:"rounded-lg border border-ink/10 bg-canvas/60 p-2.5",children:[(0,i.FD)("div",{className:"mb-1 flex items-center gap-1.5 font-mono text-[10px] font-semibold uppercase tracking-wider text-ink/70",children:[(0,i.Y)(lD.A,{size:11,className:"text-ink/60"}),(0,i.Y)("span",{children:"Summary"})]}),(0,i.Y)("div",{className:"leading-relaxed text-ink/85",children:(0,i.Y)(rU.T,{content:n.summary,className:"text-[11.5px]"})})]}),n.architecture&&(0,i.FD)("div",{className:"rounded-lg border border-ink/8 bg-paper p-2.5",children:[(0,i.FD)("div",{className:"mb-1 flex items-center gap-1.5 font-mono text-[10px] font-semibold text-ink/70 uppercase tracking-wider",children:[(0,i.Y)(tc.A,{size:11,className:"text-ink/60"}),(0,i.Y)("span",{children:"Architecture"})]}),(0,i.Y)("p",{className:"leading-relaxed text-ink/80",children:n.architecture})]}),Array.isArray(n.files)&&n.files.length>0&&(0,i.FD)("div",{className:"rounded-lg border border-ink/8 bg-paper p-2.5",children:[(0,i.FD)("div",{className:"mb-2 flex items-center justify-between",children:[(0,i.FD)("div",{className:"flex items-center gap-1.5 font-mono text-[10px] font-semibold text-ink/70 uppercase tracking-wider",children:[(0,i.Y)(rq.A,{size:11,className:"text-ink/60"}),(0,i.Y)("span",{children:"Files Inspected"})]}),(0,i.FD)("span",{className:"rounded bg-ink/5 px-1.5 py-0.2 font-mono text-[9px] text-ink/50",children:[n.files.length," items"]})]}),(0,i.Y)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-2",children:n.files.map((e,t)=>(0,i.FD)("div",{className:"flex flex-col justify-between rounded border border-ink/6 bg-canvas/40 p-1.5 transition-colors hover:border-ink/15",children:[(0,i.Y)("span",{className:"font-mono text-[10.5px] font-medium text-ink truncate",children:e.path}),e.description&&(0,i.Y)("span",{className:"text-[10px] text-ink/60 leading-tight line-clamp-2 mt-0.5",children:e.description})]},t))})]}),n.report&&(0,i.FD)("div",{className:"rounded-lg border border-ink/8 bg-paper p-2.5",children:[(0,i.FD)("div",{className:"mb-2 flex items-center gap-1.5 font-mono text-[10px] font-semibold text-ink/70 uppercase tracking-wider",children:[(0,i.Y)(rG.A,{size:11,className:"text-ink/60"}),(0,i.Y)("span",{children:"Report"})]}),(0,i.Y)("div",{className:"max-h-72 overflow-auto rounded border border-ink/6 bg-canvas/30 p-2 text-ink/85 scrollbar-overlay-container",children:(0,i.Y)(rU.T,{content:n.report,className:"text-[11.5px] leading-relaxed"})})]})]}):(0,i.Y)("div",{className:"rounded-lg border border-ink/8 bg-paper p-3 text-[11.5px] leading-relaxed text-ink/85 max-h-72 overflow-auto scrollbar-overlay-container",children:(0,i.Y)(rU.T,{content:t.rawOutput})})),"raw"===l&&(0,i.Y)("pre",{className:"max-h-64 overflow-auto rounded-lg border border-ink/8 bg-paper p-3 font-mono text-[11px] leading-relaxed whitespace-pre-wrap break-words text-ink/80 scrollbar-overlay-container scrollbar-overlay-static",dangerouslySetInnerHTML:{__html:(0,r2.wY)(t.formattedJson||t.rawOutput,t.formattedJson?"json":r?"javascript":"markdown")}}),t.outro&&(0,i.FD)("div",{className:"rounded-lg border border-ink/10 bg-canvas/60 p-2.5 text-[11px] text-ink/75",children:[(0,i.FD)("div",{className:"mb-1.5 flex items-center gap-1.5 font-mono text-[9.5px] font-semibold uppercase tracking-wider text-ink/50",children:[(0,i.Y)(w.A,{size:11}),(0,i.Y)("span",{children:"Follow-up & Transcript"})]}),(0,i.Y)("div",{className:"text-[11.5px] leading-relaxed text-ink/85",children:(0,i.Y)(rU.T,{content:t.outro})})]})]})}function lF(e){let{notice:t}=e,[n,r]=(0,a.J0)(!1);(0,r5.w)();let l=(0,a.Kr)(()=>(function(e){let t,n,i;if(!e)return null;let r=e.match(/([\s\S]*?)<task-result\b([^>]*)>([\s\S]*?)<\/task-result>([\s\S]*)/i);if(!r)return null;let a=r[1].trim(),l=r[2],s=r[3].trim(),o=r[4].trim(),c=l.match(/\bid=["']([^"']+)["']/i)?.[1],d=l.match(/\bagent=["']([^"']+)["']/i)?.[1],p=l.match(/\bstatus=["']([^"']+)["']/i)?.[1],u=l.match(/\bduration=["']([^"']+)["']/i)?.[1],m=s.match(/<meta\b([^>]*)\/?>/i);if(m){let e=m[1],n=e.match(/\blines=["']([^"']+)["']/i)?.[1],i=e.match(/\bsize=["']([^"']+)["']/i)?.[1];(n||i)&&(t={lines:n,size:i})}let h="",b=s.match(/<output\b[^>]*>([\s\S]*?)<\/output>/i);if(b)h=b[1].trim();else{let e=s.match(/<preview\b[^>]*>([\s\S]*?)<\/preview>/i),t=e?.[1].trim();h=t||s.replace(/<meta\b[^>]*\/?>(?:\s*<\/meta>)?|<\/?preview\b[^>]*>/gi,"").trim()}if(h.startsWith("{")||h.startsWith("["))try{let e=JSON.parse(h);e&&"object"==typeof e&&!Array.isArray(e)&&(n=e,i=JSON.stringify(e,null,2))}catch{let e=function(e){let t=e;for(let e=0;e<16;e+=1){let{stack:e,inString:n,escaped:i}=function(e){let t=[],n=!1,i=!1;for(let r of e){if(n){i?i=!1:"\\"===r?i=!0:'"'===r&&(n=!1);continue}'"'===r?n=!0:"{"===r||"["===r?t.push("{"===r?"}":"]"):("}"===r||"]"===r)&&t.pop()}return{stack:t,inString:n,escaped:i}}(t),r=t;n&&(i&&(r=r.slice(0,-1)),r+='"'),r=(r=r.replace(/,\s*"[^"]*"\s*:\s*$/,"").replace(/"[^"]*"\s*:\s*$/,"").replace(/,\s*$/,"")+[...e].reverse().join("")).replace(/,\s*(?=[}\]])/g,"");try{return JSON.parse(r),r}catch{let e=t.lastIndexOf(",");if(e<=0)return null;t=t.slice(0,e)}}return null}(h);if(e){let t=JSON.parse(e);t&&"object"==typeof t&&!Array.isArray(t)&&(n=t,i=JSON.stringify(t,null,2),h=e)}}return{intro:a||(c?`Background job ${c} completed`:"System notice"),id:c,agent:d,status:p,duration:u,meta:t,rawOutput:h,formattedJson:i,structuredOutput:n,outro:o||void 0}})(t),[t]),s=(0,a.Kr)(()=>{if(!(/<\/?system-reminder[^>]*>/i.test(t)||t.includes("xd://resolve")||t.includes("`ast_edit` result")))return null;let e=t.replace(/<\/?system-reminder[^>]*>/gi,"").trim();if(!e)return null;let n=(e.split(/\r?\n/).map(e=>e.trim()).find(Boolean)??e).replace(/`([^`]+)`/g,"$1");return{content:e,title:n}},[t]),o=(0,a.Kr)(()=>{let e=t.replace(/<\/?system-notice[^>]*>/gi,"").trim(),n=e.split(/\r?\n/),i=(n.find(e=>e.trim())??"").trim(),r=n.findIndex(e=>e.trim()===i),a=n.slice(r+1).join("\n").trim(),l=(0,r2.rw)(a);return{clean:e,firstLine:i,rest:a,isCode:l}},[t]),c=l?.intro||s?.title||o.firstLine||t,d=c.length>100,p=c.slice(0,100)+(d?"...":""),u=(0,a.Kr)(()=>{if(l)return!0;let e=t.replace(/<\/?(?:system-notice|system-reminder)[^>]*>/gi,"").trim();return e.split(/\r?\n/).map(e=>e.trim()).filter(Boolean).length>1||e.length>100||c.length>100},[l,t,c]),m=(0,a.Kr)(()=>l?"failed"===l.status||"error"===l.status?{icon:(0,i.Y)(e7.A,{size:13}),badgeClass:"bg-error/10 text-error",label:"Task Result",isError:!0}:{icon:(0,i.Y)(th.A,{size:13}),badgeClass:"bg-success/10 text-success",label:"Task Result",isError:!1}:s?{icon:(0,i.Y)(M.A,{size:13}),badgeClass:"bg-warning/10 text-warning",label:"System Reminder",isError:!1}:{icon:(0,i.Y)(eC.A,{size:13}),badgeClass:"bg-info/10 text-info",label:"System Notice",isError:!1},[l,s]);return(0,i.FD)("div",{className:`mx-3 overflow-hidden rounded-xl border border-ink/10 bg-paper text-[12px] text-ink transition-colors ${u?"hover:border-ink/20":""} select-text`,children:[(0,i.FD)("button",{type:"button",onClick:()=>{u&&r(e=>!e)},disabled:!u,"aria-expanded":u?n:void 0,className:`flex w-full items-center gap-2.5 px-3 py-2.5 text-left transition-colors ${u?"cursor-pointer hover:bg-ink/[0.03]":"cursor-default"} focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ink/20`,children:[(0,i.Y)("span",{className:`flex h-7 w-7 shrink-0 items-center justify-center rounded-lg ${m.badgeClass}`,children:m.icon}),(0,i.FD)("span",{className:"flex min-w-0 flex-1 flex-col",children:[(0,i.FD)("span",{className:"flex flex-wrap items-center gap-2",children:[(0,i.Y)("span",{className:"truncate text-[12px] font-semibold tracking-tight text-ink",children:m.label}),l?.agent&&(0,i.FD)("span",{className:"flex items-center gap-1 rounded bg-ink/5 px-1.5 py-0.2 font-mono text-[9px] text-ink/60",children:[(0,i.Y)(I.A,{size:10}),l.agent]}),l?.status&&(0,i.FD)("span",{className:`flex items-center gap-1 rounded px-1.5 py-0.2 font-mono text-[9px] font-semibold uppercase ${m.isError?"bg-error/10 text-error":"bg-success/10 text-success"}`,children:[m.isError?(0,i.Y)(e7.A,{size:10}):(0,i.Y)(th.A,{size:10}),l.status]}),l?.duration&&(0,i.FD)("span",{className:"flex items-center gap-1 font-mono text-[9px] text-ink/40",children:[(0,i.Y)(x.A,{size:9}),l.duration]}),l?.meta?.size&&(0,i.FD)("span",{className:"flex items-center gap-1 font-mono text-[9px] text-ink/40",children:[(0,i.Y)(tc.A,{size:9}),l.meta.size]})]}),!n&&p&&(0,i.Y)("span",{className:"truncate font-mono text-[10.5px] text-ink/45",title:c,children:p})]}),u&&(0,i.Y)(eT.A,{size:14,className:`shrink-0 text-ink/35 transition-transform duration-200 ${n?"rotate-180":""}`})]}),n&&u&&(0,i.Y)("div",{className:"border-t border-ink/8 bg-canvas/40 px-3.5 py-2.5",children:l?(0,i.Y)(lA,{task:l}):s?(0,i.Y)("div",{className:"rounded-lg border border-ink/8 bg-paper p-3 text-[11.5px] leading-relaxed text-ink/85",children:(0,i.Y)(rU.T,{content:s.content})}):o.isCode?(0,i.Y)("pre",{className:"max-h-56 overflow-auto font-mono text-[11px] leading-relaxed whitespace-pre-wrap break-words text-ink/75 scrollbar-overlay-container scrollbar-overlay-static",dangerouslySetInnerHTML:{__html:(0,r2.wY)(o.rest||o.clean,"javascript")}}):(0,i.Y)("div",{className:"rounded-lg border border-ink/8 bg-paper p-3 text-[11.5px] leading-relaxed text-ink/85",children:(0,i.Y)(rU.T,{content:o.clean||o.rest})})})]})}function lC(e){return!!(e.preview?.startsWith("data:image/")||e.preview?.startsWith("blob:"))||(e.type?.startsWith("image/")??!1)}function lS(e){let{src:t,name:n,onClose:r}=e,[l,o]=(0,a.J0)(!1);return(0,a.vJ)(()=>{let e=e=>{"Escape"===e.key&&r()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[r]),(0,s.d5)((0,i.Y)("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-ink/80 backdrop-blur-sm",onClick:r,role:"dialog","aria-modal":"true","aria-label":`Preview ${n}`,children:(0,i.FD)("div",{className:"relative max-w-[90vw] max-h-[90vh] flex flex-col items-center",onClick:e=>e.stopPropagation(),children:[(0,i.Y)("button",{type:"button",onClick:r,className:"absolute -top-10 right-0 flex items-center justify-center w-8 h-8 rounded-full bg-paper/10 text-canvas hover:bg-paper/20 transition-colors",title:"Close (Esc)",children:(0,i.Y)(h.A,{size:18})}),(0,i.Y)("img",{src:t,alt:n,onClick:()=>o(e=>!e),title:l?"Zoom out":"Zoom in (click image)",className:`max-w-[90vw] max-h-[85vh] object-contain rounded-md shadow-2xl bg-canvas/5 cursor-zoom-in transition-transform ${l?"scale-150 cursor-zoom-out":"scale-100"}`}),(0,i.Y)("div",{className:"mt-3 max-w-[90vw] truncate text-[11px] font-mono text-canvas/80",children:n})]})}),document.body)}function lT(e){let{attachments:t,className:n="",onOpenFile:r}=e,[l,s]=(0,a.J0)(null);return(0,i.FD)(i.FK,{children:[t.length>0&&(0,i.Y)("div",{className:`flex flex-wrap gap-1.5 pt-2 border-t border-ink/10 ${n}`,children:t.map((e,t)=>(0,i.FD)("button",{type:"button",onClick:()=>{lC(e)&&e.preview?s(e):r?r(e):window.dispatchEvent(new CustomEvent("omp:open-file",{detail:{path:e.name??"attachment"}}))},title:lC(e)?"Preview image":"Open in editor",className:"flex items-center bg-canvas border border-ink/10 rounded-md p-0.5 pr-1.5 text-xs font-sans hover:border-ink/40 hover:bg-ink/5 hover:shadow-sm transition-all cursor-pointer group",children:[e.preview?(0,i.Y)("img",{src:e.preview,alt:"attachment preview",className:"w-5 h-5 rounded-sm object-cover mr-1.5 border border-ink/5 group-hover:scale-105 transition-transform"}):(0,i.Y)("div",{className:"w-5 h-5 flex items-center justify-center bg-ink/5 rounded-sm mr-1.5 text-ink/60",children:(0,i.Y)(rj.A,{size:11})}),(0,i.Y)("span",{className:"truncate max-w-[100px] font-mono text-[10px] text-ink/80",children:e.name})]},t))}),l&&l.preview&&(0,i.Y)(lS,{src:l.preview,name:l.name??"image",onClose:()=>s(null)})]})}var lM=n("Sjr"),lz=n("sM");function lP(e){if("number"==typeof e?.startedAt&&Number.isFinite(e.startedAt))return e.startedAt;let t=e?.date||e?.timestamp;if(!t)return null;let n=aA(t);if(null!==n)return n;let i=new Date(t).getTime();return Number.isNaN(i)?null:i}function lL(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e.trim())return"";let n=t[e];return n?.trim()?n:e.trim()?e.split(/[-_\s]+/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "):""}function lj(e){let{provider:t,providerNames:n,currentModel:r,dateStr:l,durationMs:s,usage:o,content:c,msgId:d,thinkingLevel:p,onRetry:u,onNewChat:m,isMobile:b=!1}=e,[f,x]=(0,a.J0)(!1),g=()=>{x(!1),u?.(d)},v=()=>{x(!1),m?.(c)};(0,a.vJ)(()=>{if(!f)return;let e=e=>{"Escape"===e.key&&x(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[f]);let k=function(e){if(!Number.isFinite(e)||e<1e3)return;let t=Math.floor(e/1e3),n=Math.floor(t/3600),i=Math.floor(t%3600/60),r=t%60;return n>0?`${n}h ${i}m`:i>0?`${i}m ${r}s`:`${r}s`}(s??0),y=o?.totalTokens??(o?.input??0)+(o?.output??0),w=y>0?`${tr(y)??""} tok`:"",N=t?lL(t,n):"",Y=o?.cost?.total&&o.cost.total>0?`$${o.cost.total<.01?o.cost.total.toFixed(4):o.cost.total.toFixed(3)}`:"",D=[];N&&D.push({key:"provider",content:N}),r&&D.push({key:"model",content:r,className:"font-semibold text-ink min-w-0 truncate shrink"}),p&&D.push({key:"thinking",content:(0,i.FD)("span",{className:"text-ink/60 whitespace-nowrap flex items-center space-x-1",title:`Thinking level: ${p}`,children:[(0,i.Y)(rp.A,{size:11,className:"text-ink/50 flex-shrink-0"}),(0,i.Y)("span",{children:p})]})}),l&&D.push({key:"date",content:l}),k&&D.push({key:"duration",content:(0,i.FD)("span",{className:"text-ink/60 whitespace-nowrap flex items-center space-x-1",title:`Response time: ${k}`,children:[(0,i.Y)(lM.A,{size:11,className:"text-ink/50 flex-shrink-0"}),(0,i.Y)("span",{children:k})]})}),w&&D.push({key:"tokens",content:w,className:"hidden sm:inline",title:o?.cost?.total?`${w} (${Y})`:w});let A=[N,r||"Assistant",l||"Just now",w,Y].filter(Boolean).join(" • ");return b?(0,i.FD)(i.FK,{children:[(0,i.FD)("div",{className:"w-full flex items-center gap-2 text-[11px] text-ink/60 px-1 pt-0.5 font-mono min-w-0 animate-in fade-in duration-200",children:[(0,i.FD)("div",{className:"flex items-center gap-1.5 min-w-0 truncate",title:A,children:[(0,i.Y)("div",{className:"w-4 h-4 rounded flex items-center justify-center bg-ink text-canvas shadow-2xs shrink-0",children:(0,i.Y)(I.A,{size:10})}),N&&(0,i.Y)("span",{className:"shrink-0 truncate",children:N}),N&&r&&(0,i.Y)("span",{className:"text-ink/35 shrink-0",children:"•"}),r&&(0,i.Y)("span",{className:"font-semibold text-ink min-w-0 truncate",children:r}),r&&p&&(0,i.Y)("span",{className:"text-ink/35 shrink-0",children:"•"}),p&&(0,i.FD)("span",{className:"shrink-0 inline-flex items-center gap-1 text-ink/60",title:`Thinking level: ${p}`,children:[(0,i.Y)(rp.A,{size:10,className:"text-ink/50"}),(0,i.Y)("span",{children:p})]})]}),(0,i.Y)("button",{type:"button","aria-label":"More actions","aria-haspopup":"dialog","aria-expanded":f,title:"More actions",onClick:()=>x(!0),className:`ml-auto shrink-0 rounded-md p-2 transition-colors cursor-pointer ${f?"text-ink bg-ink/10":"text-ink/50 hover:bg-ink/5 hover:text-ink"}`,children:(0,i.Y)(n9.A,{size:16})})]}),f&&(0,i.Y)("div",{className:"fixed inset-0 z-[70] flex items-end bg-ink/40 backdrop-blur-[1px] animate-in fade-in duration-150",role:"presentation",onClick:()=>x(!1),children:(0,i.FD)("div",{className:"w-full max-h-[80vh] overflow-y-auto rounded-t-2xl border border-ink/15 bg-paper pb-[max(0.75rem,env(safe-area-inset-bottom,0px))] shadow-2xl animate-in slide-in-from-bottom-4 duration-200",role:"dialog","aria-modal":"true","aria-labelledby":`message-actions-${d}`,onClick:e=>e.stopPropagation(),children:[(0,i.FD)("div",{className:"flex items-center justify-between border-b border-ink/10 px-5 py-4",children:[(0,i.Y)("h2",{id:`message-actions-${d}`,className:"text-base font-semibold text-ink",children:"More actions"}),(0,i.Y)("button",{type:"button","aria-label":"Close more actions",title:"Close",onClick:()=>x(!1),className:"rounded-lg p-2 text-ink/50 transition-colors hover:bg-ink/5 hover:text-ink cursor-pointer",children:(0,i.Y)(h.A,{size:20})})]}),(l||k||w)&&(0,i.FD)("div",{className:"flex flex-nowrap items-center gap-3 overflow-hidden whitespace-nowrap border-b border-ink/10 px-5 py-3 text-[11px] text-ink/70",children:[l&&(0,i.FD)("span",{className:"inline-flex min-w-0 items-center gap-1.5",children:[(0,i.Y)(lz.A,{size:13,className:"shrink-0 text-ink/50"}),(0,i.Y)("span",{className:"truncate",children:l})]}),k&&(0,i.FD)("span",{className:"inline-flex shrink-0 items-center gap-1.5",title:"Response time",children:[(0,i.Y)(lM.A,{size:13,className:"shrink-0 text-ink/50"}),(0,i.Y)("span",{children:k})]}),w&&(0,i.FD)("span",{className:"inline-flex shrink-0 items-center gap-1.5",title:Y?`${w} (${Y})`:w,children:[(0,i.Y)(P.A,{size:13,className:"shrink-0 text-ink/50"}),(0,i.Y)("span",{children:w})]})]}),(0,i.FD)("div",{className:"p-2",children:[(0,i.Y)(rB,{text:c,className:"flex min-h-12 w-full items-center gap-3 rounded-lg px-3 text-left text-sm text-ink transition-colors hover:bg-ink/5 cursor-pointer",iconSize:20,iconClassName:"shrink-0 text-ink/55",copiedIconClassName:"shrink-0 text-success",label:"Copy answer",wrapLabel:!0,onClick:()=>x(!1)}),(0,i.FD)("button",{type:"button",onClick:g,className:"flex min-h-12 w-full items-center gap-3 rounded-lg px-3 text-left text-sm text-ink transition-colors hover:bg-ink/5 cursor-pointer",children:[(0,i.Y)(tK.A,{size:20,className:"shrink-0 text-ink/55"}),(0,i.Y)("span",{children:"Retry response"})]}),(0,i.FD)("button",{type:"button",onClick:v,className:"flex min-h-12 w-full items-center gap-3 rounded-lg px-3 text-left text-sm text-ink transition-colors hover:bg-ink/5 cursor-pointer",children:[(0,i.Y)(rJ.A,{size:20,className:"shrink-0 text-ink/55"}),(0,i.Y)("span",{children:"Start new chat from this answer"})]})]})]})})]}):(0,i.FD)("div",{className:"w-full flex items-center flex-nowrap space-x-2.5 text-[11px] text-ink/60 px-1 pt-0.5 font-mono min-w-0 animate-in fade-in duration-200",children:[(0,i.FD)("div",{className:"flex items-center space-x-1.5 border-r border-ink/15 pr-2.5 min-w-0 shrink overflow-hidden",title:A,children:[(0,i.Y)("div",{className:"w-4 h-4 rounded flex items-center justify-center bg-ink text-canvas shadow-2xs shrink-0",children:(0,i.Y)(I.A,{size:10})}),D.map((e,t)=>{let{key:n,content:r,className:a,title:l}=e;return(0,i.FD)("span",{className:`inline-flex items-center text-ink/60 ${"model"===n?"min-w-0 shrink":"shrink-0"} whitespace-nowrap ${a??""}`,title:l,children:[t>0&&(0,i.Y)("span",{className:"text-ink/40 mr-1.5",children:"•"}),r]},n)})]}),(0,i.FD)("div",{className:"flex items-center space-x-1 shrink-0",children:[(0,i.Y)("button",{type:"button",className:"flex items-center hover:text-ink transition-colors p-1 rounded hover:bg-ink/5 cursor-pointer",title:"Re-run / Retry generation",onClick:g,children:(0,i.Y)(tK.A,{size:12})}),(0,i.Y)(rB,{text:c,className:"flex items-center hover:text-ink transition-colors p-1 rounded hover:bg-ink/5 cursor-pointer",iconSize:12,title:"Copy response"}),(0,i.Y)("button",{type:"button",className:"flex items-center hover:text-ink transition-colors p-1 rounded hover:bg-ink/5 cursor-pointer",title:"New Chat from here",onClick:v,children:(0,i.Y)(rJ.A,{size:12})})]})]})}function lR(e){let t=e.match(/^(\s*)([a-zA-Z\u00C0-\u024F])(.*)$/s);return t?t[1]+t[2].toUpperCase()+t[3]:e}let lI=(0,s.ph)(function(e){let{msg:t,provider:n,providerNames:r,modelName:l,modelNames:s,thinkingLevel:o,isStreaming:c=!1,onRetry:d,onUndo:p,onNewChat:u,footerVisible:m=!0,isMobile:h=!1,className:b="",durationMs:f=null,isPrevAssistant:x=!1}=e,g="user"===t.role,v=(0,a.Kr)(()=>"string"==typeof t.content?t.content.trim():t.content,[t.content]),k=(0,a.Kr)(()=>"string"==typeof t.content?lR(t.content):t.content,[t.content]),y="string"==typeof t.content&&/[A-Za-z0-9]/.test(t.content),w=e=>{let n=e||t.timestamp||t.date;if(!n)return"";if(n.startsWith("Today,"))return`Today, ${n.slice(6).trim()}`;if(/^\d{1,2}:\d{2}\s*(AM|PM)$/i.test(n)){let e=aA(`Today, ${n}`);if(null!==e)return`Today, ${aD(e)}`}let i=new Date(n);if(Number.isNaN(i.getTime()))return"";let r=i.toLocaleDateString("en-US",{month:"short",day:"numeric"});return`${r}, ${aD(i)}`};if(g){let e="agent"===t.attribution;return(0,i.FD)("div",{id:t.id,className:`flex flex-col items-end space-y-1.5 w-full max-w-full ${b}`,children:[(0,i.FD)("div",{className:"bg-paper p-3.5 sm:p-4 rounded-xl border border-ink/15 text-[13px] text-ink shadow-xs max-w-[92%] sm:max-w-[85%] break-words overflow-hidden flex flex-col space-y-2 font-sans select-text mx-3",style:{lineHeight:"var(--markdown-body-line-height)"},children:[e&&(0,i.FD)("div",{className:"flex items-center space-x-1.5 pb-1.5 mb-1 border-b border-ink/10 text-[11px] font-mono text-ink/70",children:[(0,i.Y)(I.A,{size:12,className:"text-ink shrink-0"}),(0,i.Y)("span",{className:"font-semibold text-ink",children:"Subagent Assignment"}),(0,i.Y)("span",{className:"text-[9px] uppercase tracking-wider px-1.5 py-0.5 rounded bg-ink/5 text-ink/60",children:"Delegated"})]}),(0,i.Y)(rU.T,{content:v}),(0,i.Y)(lT,{attachments:t.attachments||[],onOpenFile:e=>{window.dispatchEvent(new CustomEvent("omp:open-file",{detail:{path:e.name??"attachment",content:e.content}}))}})]}),(0,i.FD)("div",{className:"flex items-center space-x-2.5 text-[11px] text-ink/60 px-1 font-mono",children:[(0,i.FD)("div",{className:"flex items-center space-x-1.5 border-r border-ink/15 pr-2.5",children:[e?(0,i.FD)(i.FK,{children:[(0,i.Y)(I.A,{size:11,className:"text-ink/70 shrink-0"}),(0,i.Y)("span",{className:"text-[10px] uppercase font-semibold tracking-wider text-ink/60",children:"Agent"})]}):(0,i.Y)(no.A,{size:11,className:"text-ink/70 shrink-0"}),w()&&(0,i.Y)("span",{children:w()})]}),(0,i.FD)("div",{className:"flex items-center space-x-1",children:[(0,i.Y)("button",{type:"button",className:"flex items-center hover:text-ink transition-colors p-1 rounded hover:bg-ink/5 cursor-pointer",title:"Undo / Edit message",onClick:()=>{p&&p(t.id,t.content)},children:(0,i.Y)(rO.A,{size:12})}),(0,i.Y)(rB,{text:t.content,className:"flex items-center hover:text-ink transition-colors p-1 rounded hover:bg-ink/5 cursor-pointer",iconSize:12,title:"Copy prompt"}),(0,i.Y)("button",{type:"button",className:"flex items-center hover:text-ink transition-colors p-1 rounded hover:bg-ink/5 cursor-pointer",title:"New Chat from here",onClick:e=>{e&&e.preventDefault(),u&&u(t.content)},children:(0,i.Y)(rJ.A,{size:12})})]})]})]})}let N=t.thinking||(t.monologue?{thought:t.monologue}:void 0),Y=t.toolCalls||t.actions,D=t.actions2,A=t.intent?lR(t.intent.replace(/^[.\s]+/,"")):null,F=!!(Y&&Y.length>0),C=Y?.filter(e=>"yield"===e.name||"yield"===e.type).find(e=>"error"!==e.status)?.output,S=A||(C??(Y?.length===1?"Tool Execution (1 step)":`Tool Executions (${Y?.length} steps)`));return(0,i.FD)("div",{id:t.id,className:`flex flex-col items-start space-y-2 w-full max-w-full transition-all ${c?"pb-10 mb-2":""} ${b}`,children:[(0,i.FD)("div",{className:"w-full space-y-2.5 font-sans leading-relaxed",children:[t.notice&&(0,i.Y)(lF,{notice:t.notice}),N&&(0,i.Y)(rW,{thinking:N,defaultExpanded:!1,showSeparator:x}),t.error&&(0,i.FD)("div",{className:"flex items-start space-x-2.5 bg-error/10 border border-error/30 rounded-lg mx-3 px-3.5 py-2.5 text-[12px] text-ink select-text",children:[(0,i.Y)(e7.A,{size:15,className:"text-error flex-shrink-0 mt-0.5"}),(0,i.FD)("div",{className:"min-w-0 flex-1 space-y-0.5",children:[(0,i.FD)("div",{className:"flex items-center space-x-2 flex-wrap",children:[(0,i.Y)("span",{className:"font-semibold text-error text-[12px] tracking-tight",children:t.error.status?`Error ${t.error.status}`:"Request Failed"}),t.error.stopReason&&(0,i.Y)("span",{className:"text-[10px] font-mono text-ink/50 bg-ink/5 px-1.5 py-0.5 rounded",children:t.error.stopReason})]}),t.error.message&&(0,i.FD)("p",{className:"text-ink/80 leading-relaxed text-[12px] font-mono whitespace-pre-wrap break-words",children:[t.error.message.split("\n").map(e=>e.trim()).filter(Boolean)[0],t.error.message.split("\n").map(e=>e.trim()).filter(Boolean).length>1&&(0,i.FD)("span",{className:"relative inline-flex items-center ml-1.5 align-middle group",children:[(0,i.Y)(eC.A,{size:13,className:"text-error/70 hover:text-error cursor-pointer transition-colors"}),(0,i.Y)("span",{className:"pointer-events-none absolute z-50 left-1/2 bottom-full mb-1.5 w-72 -translate-x-1/2 rounded-md bg-ink text-canvas p-2.5 text-[11px] font-mono leading-relaxed whitespace-pre-wrap break-words opacity-0 group-hover:opacity-100 transition-opacity duration-150 shadow-lg",children:t.error.message})]})]})]})]}),y&&(0,i.Y)("div",{className:"text-[13px] text-ink leading-relaxed font-sans bg-transparent px-3 py-1 select-text",children:(0,i.Y)(rU.T,{content:k})}),A&&!F&&(!y||!t.content.toLowerCase().includes(t.intent.toLowerCase().trim()))&&(0,i.Y)("div",{className:`leading-relaxed font-sans px-3 select-text ${y?"text-[12px] text-ink/70 py-0.5":"text-[13px] text-ink py-1"}`,children:A}),F&&(0,i.Y)(lY,{tools:Y,title:S,defaultExpanded:!1}),t.systemNote&&(0,i.FD)("div",{className:"text-[12px] text-ink leading-relaxed border-l-2 border-ink/30 bg-paper/60 px-3 py-2 rounded-r-md font-mono break-words whitespace-pre-wrap select-text",children:[(0,i.Y)("span",{className:"text-[10px] text-ink/50 uppercase tracking-wider block mb-0.5 font-sans font-semibold",children:"Diagnostic Note"}),t.systemNote]}),D&&D.length>0&&(0,i.Y)(lY,{tools:D,title:`Follow-up Tools (${D.length})`,defaultExpanded:!0}),!c&&t.summary&&(0,i.FD)("div",{className:"text-[12px] text-ink bg-paper border border-ink/15 rounded-lg p-3 space-y-1 select-text font-sans",children:[(0,i.FD)("div",{className:"font-semibold text-ink flex items-center space-x-1.5 text-[12px]",children:[(0,i.Y)("span",{className:"w-1.5 h-1.5 rounded-full bg-success"}),(0,i.Y)("span",{children:"Resolution Summary"})]}),(0,i.Y)("p",{className:"text-ink/80 leading-relaxed text-[12px]",children:t.summary})]})]}),!c&&m&&(0,i.Y)(lj,{provider:t.provider||n,providerNames:r,currentModel:(t.model?s?.[t.model]??t.model:"")||l||"",thinkingLevel:t.thinkingLevel??o,dateStr:w(),durationMs:f??t.durationMs,usage:t.usage,content:t.content,msgId:t.id,onRetry:d,onNewChat:u,isMobile:h})]})}),lE=["Synthesizing solution","Evaluating context","Reading workspace","Planning next step","Executing diagnostics","Compiling edge routes"];function l$(e){let{modelName:t,generatingVerb:n,provider:r,providerNames:l}=e,[s,o]=(0,a.J0)(0);(0,a.vJ)(()=>{if(n)return;let e=setInterval(()=>{o(e=>(e+1)%lE.length)},2800);return()=>clearInterval(e)},[n]);let c=n?n.charAt(0).toUpperCase()+n.slice(1):lE[s],d=r?lL(r,l):"";return(0,i.FD)("div",{id:"generating-docked-indicator",className:"w-full flex items-center px-1 py-1 bg-transparent border-0 border-none text-[11px] font-mono select-none animate-in fade-in duration-200",children:[(0,i.Y)("style",{children:`
|
|
46
|
-
@keyframes bounce-dot {
|
|
47
|
-
0%, 100% { opacity: 0.2; transform: translateY(0); }
|
|
48
|
-
50% { opacity: 1; transform: translateY(-15%); }
|
|
49
|
-
}
|
|
50
|
-
.dot-anim-1 { animation: bounce-dot 1.2s infinite both; }
|
|
51
|
-
.dot-anim-2 { animation: bounce-dot 1.2s infinite both 0.2s; }
|
|
52
|
-
.dot-anim-3 { animation: bounce-dot 1.2s infinite both 0.4s; }
|
|
53
|
-
`}),(0,i.FD)("div",{className:"flex items-center space-x-2 min-w-0",children:[(0,i.FD)("div",{className:"relative w-4 h-4 rounded flex items-center justify-center shrink-0",children:[(0,i.Y)("div",{className:"absolute -inset-[1.5px] rounded-[5px] animate-spin",style:{background:"conic-gradient(from 0deg, #ff453a, #ff9f0a, #ffd60a, #30d158, #64d2ff, #0a84ff, #bf5af2, #ff375f, #ff453a)",animationDuration:"1.2s"}}),(0,i.Y)("div",{className:"relative w-full h-full rounded-[3px] bg-ink flex items-center justify-center text-canvas z-10 shadow-2xs",children:(0,i.Y)(I.A,{size:10,className:"text-canvas"})})]}),(0,i.FD)("div",{className:"flex items-center space-x-1.5 min-w-0 truncate",children:[d&&(0,i.Y)("span",{className:"text-ink/55 truncate shrink",children:d}),(0,i.Y)("span",{className:"font-semibold text-ink truncate",children:t}),(0,i.Y)("span",{className:"text-ink/40 shrink-0",children:"•"}),(0,i.FD)("span",{className:"text-ink/75 flex items-center space-x-1 shrink-0 font-medium",children:[(0,i.Y)("span",{className:"transition-all duration-300",children:c}),(0,i.FD)("span",{className:"inline-flex tracking-wider text-ink/80 ml-0.5",children:[(0,i.Y)("span",{className:"dot-anim-1 inline-block",children:"."}),(0,i.Y)("span",{className:"dot-anim-2 inline-block",children:"."}),(0,i.Y)("span",{className:"dot-anim-3 inline-block",children:"."})]})]})]})]})]})}function lO(e){let{className:t="",folders:n=[],selectedFolderId:r,setSelectedFolderId:l,inputValue:s,setInputValue:o,inputAttachments:c,setInputAttachments:d,onSend:p,isGenerating:u,appSettings:m={},localMessages:h=[],provider:b,providerNames:f,modelName:x,modelNames:g,rootPath:v,onThinkingLevelChange:k,onModelChange:y,sessionModel:w,sessionThinkingLevel:N,accessMode:Y,onAccessModeChange:A,composerModelRef:F,generatingVerb:C,variant:S="desktop"}=e,[T,M]=(0,a.J0)(!1),z=(0,a.li)(null);(0,eM.W)(z,()=>M(!1));let P=(0,a.li)(null),L=(0,a.Kr)(()=>n?.find(e=>e.id===r),[n,r]);return(0,a.vJ)(()=>{P.current&&(P.current.scrollTop=P.current.scrollHeight)},[h.length]),(0,i.Y)("div",{className:`flex flex-col h-full bg-canvas ${"mobile"===S?"px-3 py-4":"p-8"} ${t}`,style:"mobile"===S?{paddingBottom:"max(1rem, env(safe-area-inset-bottom, 0px))"}:void 0,children:(0,i.FD)("div",{className:`mx-auto w-full max-w-[970px] flex flex-col min-h-0 space-y-3 ${h.length>0?"flex-1":"my-auto justify-center"}`,children:[0===h.length&&(0,i.FD)("div",{className:"relative shrink-0",ref:z,children:[(0,i.FD)("button",{type:"button",onClick:()=>M(!T),className:"group flex items-center space-x-1.5 px-1.5 py-1 rounded-md text-xs font-medium text-ink/75 hover:text-ink hover:bg-ink/5 focus-visible:bg-ink/5 transition-all outline-none cursor-pointer select-none",children:[(0,i.Y)(es.A,{size:13,className:"text-ink/50 group-hover:text-ink/80 transition-colors flex-shrink-0"}),(0,i.Y)("span",{className:"flex items-center space-x-1 max-w-[260px] truncate tracking-tight",children:(0,i.Y)("span",{children:L?L.name:"Select Workspace Context"})}),(0,i.Y)(eT.A,{size:13,className:`text-ink/40 group-hover:text-ink/70 flex-shrink-0 transition-transform duration-150 ${T?"rotate-180 text-ink/70":""}`})]}),T&&(0,i.FD)("div",{className:"absolute bottom-full left-0 mb-1.5 w-64 bg-paper border border-ink/10 rounded-lg shadow-lg z-50 flex flex-col overflow-hidden text-xs py-1",children:[(0,i.Y)("div",{className:"px-3 py-1.5 text-[10px] uppercase tracking-wider text-ink/40 font-semibold border-b border-ink/5",children:"Target Workspace"}),(0,i.Y)("div",{className:"max-h-56 scrollbar-overlay-container scrollbar-overlay-static py-1",children:0===n.length?(0,i.Y)("div",{className:"px-3 py-2 text-ink/40 italic",children:"No workspaces available"}):n.map(e=>(0,i.FD)("button",{type:"button",onClick:()=>{l(e.id),M(!1)},className:`w-full text-left px-3 py-1.5 flex items-center justify-between transition-colors cursor-pointer ${r===e.id?"bg-ink/10 text-ink font-semibold":"text-ink/80 hover:bg-ink/5 hover:text-ink"}`,children:[(0,i.FD)("div",{className:"flex items-center space-x-2 truncate pr-2",children:[(0,i.Y)(es.A,{size:12,className:r===e.id?"text-ink flex-shrink-0":"text-ink/50 flex-shrink-0"}),(0,i.Y)("span",{className:"truncate font-medium",children:e.name})]}),r===e.id&&(0,i.Y)(D.A,{size:12,className:"text-ink flex-shrink-0"})]},e.id))})]})]}),h.length>0&&(0,i.Y)("div",{ref:P,className:"flex-1 min-h-0 overflow-y-auto scroll-smooth overscroll-contain",children:(0,i.Y)("div",{className:"mx-auto w-full max-w-[970px]",children:h.map((e,t)=>{let n=h[t-1],r=h.length-1;for(;r>=0&&h[r].notice;)r--;let a=u&&t===r&&"ai"===e.role,l="user"!==e.role&&n&&"user"!==n.role,s=h.slice(t+1).find(e=>!e.notice),o="user"!==e.role&&!e.notice&&(!s||"user"===s.role);return(0,i.Y)(lI,{msg:e,provider:b,providerNames:f,modelName:x,modelNames:g,thinkingLevel:N??void 0,isStreaming:a,footerVisible:o,className:l?"mt-1":"mt-8"},e.id)})})}),u&&(0,i.Y)(l$,{modelName:x,generatingVerb:C,provider:b,providerNames:f}),(0,i.Y)(r$,{value:s,onChange:o,rootPath:v,attachments:c,onAttachmentsChange:d,onSend:p,isGenerating:u,disabled:!r,className:"w-full shrink-0",appSettings:m,onThinkingLevelChange:k,onModelChange:y,sessionModel:w,sessionThinkingLevel:N,accessMode:Y,onAccessModeChange:A,composerModelRef:F,variant:S})]})})}let lJ=[{role:"user",width:"58%",lines:1},{role:"ai",width:"100%",lines:3},{role:"user",width:"40%",lines:1},{role:"ai",width:"92%",lines:2},{role:"user",width:"52%",lines:2},{role:"ai",width:"100%",lines:4}];function l_(e){let{row:t,index:n}=e;return(0,i.Y)("div",{className:`flex ${"user"===t.role?"justify-end":"justify-start"} mb-3`,children:(0,i.Y)("div",{className:"rounded-lg bg-ink/5 border border-ink/5 px-3 py-2 space-y-1.5",style:{width:t.width,maxWidth:"85%"},children:Array.from({length:t.lines},(e,r)=>(0,i.Y)("div",{className:"h-2.5 rounded bg-ink/8 animate-pulse",style:{width:r===t.lines-1?"62%":"100%",animationDelay:`${120*n+60*r}ms`}},r))})})}function lU(){let e=(0,a.Kr)(()=>lJ,[]);return(0,i.FD)("div",{"aria-hidden":!0,className:"flex flex-col h-full min-h-0 overflow-hidden",children:[(0,i.Y)("div",{className:"flex-1 min-h-0 overflow-hidden px-3 py-3 pb-8 sm:p-4 sm:pb-10",children:(0,i.Y)("div",{className:"mx-auto w-full max-w-[970px]",children:e.map((e,t)=>(0,i.Y)(l_,{row:e,index:t},t))})}),(0,i.Y)("div",{className:"flex-shrink-0 px-3 pt-1 pb-3 sm:p-4 sm:pt-1",children:(0,i.Y)("div",{className:"mx-auto w-full max-w-[970px]",children:(0,i.FD)("div",{className:"rounded-md border border-ink/20 bg-paper p-3 space-y-2",children:[(0,i.Y)("div",{className:"h-9 rounded bg-ink/8 animate-pulse",style:{animationDelay:"720ms"}}),(0,i.FD)("div",{className:"flex items-center justify-between",children:[(0,i.Y)("div",{className:"h-5 w-28 rounded bg-ink/8 animate-pulse",style:{animationDelay:"840ms"}}),(0,i.Y)("div",{className:"h-7 w-7 rounded bg-ink/8 animate-pulse",style:{animationDelay:"960ms"}})]})]})})})]})}function lK(){return(0,i.Y)("div",{className:"flex justify-center py-2",role:"status",children:(0,i.FD)("div",{className:"flex items-center gap-1.5 text-ink/40 text-[11px] font-mono",children:[(0,i.Y)("span",{className:"inline-block w-1.5 h-1.5 rounded-full bg-ink/30 animate-pulse"}),(0,i.Y)("span",{className:"inline-block w-1.5 h-1.5 rounded-full bg-ink/30 animate-pulse",style:{animationDelay:"150ms"}}),(0,i.Y)("span",{className:"inline-block w-1.5 h-1.5 rounded-full bg-ink/30 animate-pulse",style:{animationDelay:"300ms"}})]})})}function lB(e){let{content:t,isOmpSession:n,undoing:r,onClose:l,onConfirm:s}=e;return(0,a.vJ)(()=>{let e=e=>{"Escape"!==e.key||r||(e.preventDefault(),l())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[l,r]),(0,i.Y)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-ink/40 animate-in fade-in duration-200 p-4",onClick:r?void 0:l,role:"dialog","aria-modal":"true","aria-label":"Confirm undo",children:(0,i.FD)("div",{className:"bg-paper border border-ink/20 rounded-xl shadow-xl w-[min(94vw,420px)] overflow-hidden",onClick:e=>e.stopPropagation(),children:[(0,i.FD)("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-ink/10",children:[(0,i.Y)(rO.A,{size:16,className:"text-ink/70 shrink-0"}),(0,i.Y)("h2",{className:"text-[13px] font-semibold text-ink",children:"Undo message?"})]}),(0,i.FD)("div",{className:"px-4 py-4 space-y-3",children:[(0,i.Y)("div",{className:"rounded-lg border border-ink/10 bg-canvas/50 px-3 py-2 text-[12px] text-ink/80 leading-relaxed max-h-28 overflow-y-auto scrollbar-overlay-container",children:t||"Empty message or attachment-only prompt"}),(0,i.Y)("p",{className:"text-[11.5px] leading-relaxed text-ink/60",children:n?"The timeline and agent context rewind to before this message. Its reply and everything after it are removed; the text returns to the composer for editing.":"This message and everything after it are removed from the timeline. The text returns to the composer for editing."})]}),(0,i.FD)("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t border-ink/10",children:[(0,i.Y)("button",{type:"button",onClick:l,disabled:r,className:"px-3 py-1.5 rounded border border-ink/20 text-ink/70 hover:bg-ink/5 hover:text-ink transition-colors cursor-pointer text-xs disabled:opacity-40 disabled:cursor-not-allowed",children:"Cancel"}),(0,i.FD)("button",{type:"button",autoFocus:!r,onClick:s,disabled:r,className:"flex items-center gap-2 px-3 py-1.5 rounded bg-ink text-canvas hover:bg-ink/90 transition-colors cursor-pointer text-xs font-medium disabled:opacity-60 disabled:cursor-not-allowed",children:[r&&(0,i.Y)(tf.A,{size:13,className:"animate-spin shrink-0"}),r?"Rewinding…":"Undo"]})]})]})})}function lW(e){let{initialContent:t,onClose:n,onSend:r,appSettings:l,accessMode:s,onAccessModeChange:o,composerModelRef:c}=e,[d,p]=(0,a.J0)(t),[u,m]=(0,a.J0)([]);return(0,i.Y)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-ink/40 animate-in fade-in duration-200 p-4",children:(0,i.FD)("div",{className:"bg-canvas border border-ink/15 rounded-xl shadow-xl w-full max-w-2xl max-h-[90vh] flex flex-col overflow-hidden",onClick:e=>e.stopPropagation(),children:[(0,i.FD)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-ink/10 bg-paper",children:[(0,i.Y)("h2",{className:"text-[13px] font-semibold text-ink",children:"New Chat"}),(0,i.Y)("button",{onClick:n,className:"p-1 rounded hover:bg-ink/10 text-ink/60 hover:text-ink transition-colors",children:(0,i.Y)(h.A,{size:14})})]}),(0,i.FD)("div",{className:"p-4 flex-1 scrollbar-overlay-container scrollbar-overlay-static",children:[(0,i.Y)("p",{className:"text-xs text-ink/60 mb-3",children:"Start a new session in this workspace based on the selected message."}),(0,i.Y)(r$,{value:d,onChange:p,attachments:u,onAttachmentsChange:m,onSend:e=>{r(d,e),n()},isGenerating:!1,appSettings:l,accessMode:s,onAccessModeChange:o,composerModelRef:c})]})]})})}var lH=n("Kv"),lq=n("Md");function lG(e){if("string"==typeof e)return e;if(!Array.isArray(e))return"";let t=[];for(let n of e)(0,ig.u)(n)&&"text"===n.type&&"string"==typeof n.text&&t.push(n.text);return t.join("\n")}function lV(e,t){if(!e)return"";for(let n of t){let t=e[n];if("string"==typeof t)return t}return""}let lQ=["command","cmd","CommandLine","commandLine"],lZ=["path","TargetFile","targetFile","FilePath","filePath","AbsolutePath","file"],lX=new Set(["aborted","error"]);function l0(e){if("number"==typeof e&&Number.isFinite(e))return e;if("string"==typeof e){let t=new Date(e).getTime();return Number.isNaN(t)?void 0:t}}function l1(e){return"string"==typeof e?e:e&&"object"==typeof e?lG(e.content):""}function l2(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];if("custom"===e.role){if("session_exit"===e.customType)return null;let t=e.content,n=("string"==typeof t?t:Array.isArray(t)?t.map(e=>e&&"object"==typeof e&&"text"===e.type?e.text??"":"").join(""):"").replace(/<\/?system-notice[^>]*>/g,"").trim();return n?{id:"string"==typeof e.id?e.id:`notice-${Date.now()}`,role:"ai",content:"",notice:n}:null}let n=function(e){let t={toolCalls:[],inlineOutputs:new Map,textParts:[]};if("string"==typeof e)return t.textParts.push(e),t;if(!Array.isArray(e))return t;for(let n of e)if((0,ig.u)(n))if("thinking"===n.type)"string"==typeof n.thinking?t.thinking=n.thinking:"string"==typeof n.text&&(t.thinking=n.text);else if("toolCall"===n.type){let e="string"==typeof n.id?n.id:`tool-${Math.random().toString(36).slice(2,10)}`,i="string"==typeof n.name?n.name:"tool",r=n.arguments??n.input,a=(0,ig.u)(r)?r:void 0,l=lV(a,lQ),s=lV(a,lZ)||(a?(0,ls.f$)(a):void 0),o="string"==typeof a?.i?a.i:void 0,c=l||s;t.toolCalls.push({id:e,name:i,title:c?`${i} — ${c}`:i,intent:o,target:s||void 0,command:l||void 0,input:a&&Object.keys(a).length>0?a:void 0}),o&&!t.intent&&(t.intent=o),t.inlineOutputs.set(e,"")}else if("toolResult"===n.type){let e="string"==typeof n.toolCallId?n.toolCallId:void 0,i="string"==typeof n.text?n.text:"";if(e&&t.inlineOutputs.has(e))t.inlineOutputs.set(e,i);else if(i&&t.toolCalls.length>0){let e=t.toolCalls[t.toolCalls.length-1];t.inlineOutputs.set(e.id,i)}}else"text"===n.type&&"string"==typeof n.text&&t.textParts.push(n.text);return t}(e.content),i="string"==typeof e.id?e.id:`msg-${e.timestamp??Date.now()}-ai`,r="user"===e.role?"user":"ai",a="number"==typeof e.timestamp?aD(e.timestamp):void 0,l="string"==typeof e.attribution?e.attribution:void 0,s=l0(e.timestamp)??l0(e.startedAt),o="number"==typeof e.duration?e.duration:"number"==typeof e.durationMs?e.durationMs:void 0,c=l0(e.completedAt)??(void 0!==s&&void 0!==o?s+o:void 0),d="string"==typeof e.provider?e.provider:void 0;if("developer"===e.role||"system"===e.role||n.textParts.some(e=>/<\/?system-reminder[^>]*>/i.test(e))){let e=n.textParts.join("\n").trim().replace(/<\/?system-reminder[^>]*>/g,"").trim();return e?{id:i,role:"ai",date:a?`Today, ${a}`:void 0,timestamp:a,content:"",notice:e}:null}if("user"===r)return{id:i,role:r,date:a?`Today, ${a}`:void 0,timestamp:a,startedAt:s,content:function(e){let t=e.match(/(?:^|\n{2})\s*Attached file: /);if(!t||void 0===t.index)return e;let n=e.slice(0,t.index),i=e.slice(t.index+t[0].length);return/^[^\n]+\n```[a-z]*\n/.test(i)?n.trim():e}(n.textParts.join("\n")),attribution:l,attachments:(function(e){if(!Array.isArray(e))return[];let t=[],n=0;for(let i of e){if(!(0,ig.u)(i)||"image"!==i.type)continue;let e="string"==typeof i.data?i.data:void 0,r="string"==typeof i.mimeType?i.mimeType:"image/png";if(!e)continue;n+=1;let a=(r.split("/")[1]||"png").replace(/[^a-z0-9]/gi,"")||"png";t.push({id:`att-${n}`,name:`attachment-${n}.${a}`,preview:`data:${r};base64,${e}`,type:r})}return t})(e.content).map(e=>({id:e.id,name:e.name,preview:e.preview,type:e.type}))};let p=n.toolCalls.map(e=>{var n,i;let r,a,l,s;return n=e,i={streaming:t},a=n.input,l=(0,ig.u)(a)?Object.fromEntries(Object.entries(a).filter(e=>{let[t]=e;return"i"!==t})):a,s=i.isError?"error":void 0!==i.output?"success":i.streaming?"running":"success",{id:n.id,type:(r=(n.name||"").toLowerCase()).includes("bash")||r.includes("terminal")||r.includes("shell")||r.includes("run")?"bash":r.includes("write")||r.includes("edit")||r.includes("patch")||r.includes("apply")?"edit_file":r.includes("create")?"create_file":r.includes("read")||r.includes("view")||r.includes("list")?"read_file":r.includes("grep")||r.includes("glob")?"grep":r.includes("search")||r.includes("find")?"search_fs":r.includes("web")||r.includes("fetch")||r.includes("http")?"web_search":r.includes("todo")?"todo":r.includes("task")?"task":r.includes("lsp")?"lsp":r.includes("eval")?"eval":r.includes("github")?"github":r.includes("security")?"security_scan":"custom",name:n.name,title:n.title,intent:n.intent,target:n.target,command:n.command,input:l&&Object.keys(l).length>0?l:void 0,output:i.output,status:s}}),u={id:i,role:r,date:a?`Today, ${a}`:void 0,timestamp:a,attribution:l,model:"string"==typeof e.model?e.model:void 0,provider:d,startedAt:s,completedAt:c,durationMs:o,usage:e.usage&&"object"==typeof e.usage?e.usage:void 0,content:n.textParts.join("\n"),intent:n.intent,thinking:n.thinking?{thought:n.thinking,isGenerating:t}:e.thinking,toolCalls:p.length>0?p:e.toolCalls,summary:"string"==typeof e.summary?e.summary:void 0,error:e.error??function(e){let t;if("string"==typeof(t=e.stopReason)&&lX.has(t)||"number"==typeof e.errorStatus||"string"==typeof e.errorMessage)return{status:"number"==typeof e.errorStatus?e.errorStatus:void 0,id:"number"==typeof e.errorId?e.errorId:void 0,message:"string"==typeof e.errorMessage?e.errorMessage:void 0,stopReason:"string"==typeof e.stopReason?e.stopReason:void 0}}(e)};return u.content||u.thinking||u.toolCalls&&0!==u.toolCalls.length||u.intent||u.error||u.summary||u.notice?u:null}function l5(e,t){let n=[];for(let i of e){if((0,ig.u)(i)){let e="string"==typeof i.type?i.type:"";if("custom"===e||"custom_message"===e){let e="string"==typeof i.customType?i.customType:"";if("session_exit"===e)continue;if("launch-completion"===e||"string"==typeof i.content){let e=("string"==typeof i.content?i.content:"").replace(/<\/?system-notice[^>]*>/g,"").trim();e&&n.push({id:"string"==typeof i.id?i.id:`notice-${Date.now()}`,role:"ai",content:"",notice:e,date:"string"==typeof i.timestamp?new Date(i.timestamp).toISOString():void 0});continue}}if(e&&"message"!==e)continue}let e=function(e){if(!(0,ig.u)(e))return null;let t=(0,ig.u)(e.message)?e.message:null;if(!t)return e;let n={...t};return void 0===n.id&&"string"==typeof e.id&&(n.id=e.id),void 0===n.timestamp&&"number"==typeof e.timestamp&&(n.timestamp=e.timestamp),n}(i);if(!e)continue;if("toolResult"===e.role){let t="string"==typeof e.toolCallId?e.toolCallId:void 0,i=lG(e.content),r=(0,ig.u)(e.details)?e.details:void 0,a=!0===e.isError;for(let l=n.length-1;l>=0;l--){let s=n[l].toolCalls?.find(n=>t?n.id===t:n.name===e.toolName);if(s){i&&(s.output=i),r&&(s.details=r),s.status=a?"error":"success";break}}continue}let r=l2(e,t);r&&n.push(r)}return n}function l3(e,t){if(0===t.length)return e;let n=new Map(e.map((e,t)=>[e.id,t])),i=[...e];for(let e of t){let t=n.get(e.id);void 0===t?(n.set(e.id,i.length),i.push(e)):i[t]=e}return i}function l4(e,t,n){if(!(0,ig.u)(e)||!Array.isArray(e.messages))return null;let i="number"==typeof e.fromByte?e.fromByte:t;return{sessionFile:"string"==typeof e.sessionFile&&e.sessionFile?e.sessionFile:n??"",fromByte:i,nextByte:"number"==typeof e.nextByte?e.nextByte:i,reset:!0===e.reset,messages:e.messages,totalBytes:"number"==typeof e.totalBytes?e.totalBytes:void 0}}async function l6(e,t,n,i){try{let r=await fetch(`/api/agent/${encodeURIComponent(e)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"get_subagent_messages",subagentId:t,...n?{sessionFile:n}:{},fromByte:i})});if(!r.ok)return null;let a=await r.json().catch(()=>null),l=(0,ig.u)(a)&&"data"in a?a.data:a;return l4(l,i,n)}catch{return null}}let l8=new Map;async function l7(e,t,n){let i=`/api/sessions/${encodeURIComponent(e)}/subagents/${encodeURIComponent(t)}?fromByte=${n}`,r=l8.get(i);if(r)return r;let a=()=>{},l=new Promise(e=>{a=()=>{l8.get(i)===l&&l8.delete(i)},(async()=>{try{let t=await fetch(i);if(!t.ok)return e(null);let r=await t.json().catch(()=>null),a=(0,ig.u)(r)&&"page"in r?r.page:r;if(null==a)return e(null);e(l4(a,n,void 0))}catch{e(null)}})()});return l.then(a,a),l8.set(i,l),l}let l9={pending:"started",running:"started",completed:"completed",failed:"failed",aborted:"aborted"};function se(e){return"completed"===e||"failed"===e||"aborted"===e}function st(e,t){if(!e||e.id!==t.id)return t;let n={...e,...t,agent:"subagent"!==t.agent?t.agent:e.agent,index:e.index>=0?e.index:t.index,status:se(e.status)&&!se(t.status)?e.status:t.status},i={...e.progress,...t.progress};return Object.keys(i).length>0?n.progress=i:delete n.progress,n}function sn(e){let[t,n]=(0,a.J0)(void 0),i=(0,a.li)(e);return i.current=e,(0,a.vJ)(()=>{let e=!0,t=async()=>{try{let t=await eH();if(!e)return;let r=i.current(t);void 0!==r&&n(r)}catch{}};t();let r=eG(t);return()=>{e=!1,r()}},[]),t}function si(e){if(e.modelList?.length)return Object.fromEntries(e.modelList.map(e=>[e.id,e.name||e.id]))}let sr={started:"running",completed:"done",failed:"failed",aborted:"aborted"};function sa(e){let{sessionId:t,subagent:n,onBack:r,provider:l,providerNames:s,className:o=""}=e,{messages:c,isLoading:d,status:p,isActive:u}=function(e,t,n){let[i,r]=(0,a.J0)([]),[l,s]=(0,a.J0)(t),[o,c]=(0,a.J0)(!1),d=t?.id??null,p=!!(e&&d),u=(0,a.li)(0),m=(0,a.li)(e);m.current=e;let h=(0,a.li)(t);h.current=t;let b=(0,a.li)(n);b.current=n;let f=(0,a.li)(0),x=(0,a.li)(void 0),g=(0,a.li)(!1),v=(0,a.li)(!1),k=(0,a.li)(!1),y=(0,a.li)(null),w=(0,a.li)(()=>{}),N=(0,a.hb)(async()=>{let e=m.current,t=h.current;if(!e||!t||!g.current)return;if(v.current){k.current=!0;return}v.current=!0;let n=u.current;try{let i=await l6(e,t.id,x.current,f.current);if(n!==u.current||!i)return;x.current=i.sessionFile||x.current;let a=l5(i.messages,!0);i.reset?(r(a),f.current=i.nextByte):(r(e=>l3(e,a)),f.current=Math.max(f.current,i.nextByte))}finally{v.current=!1,k.current&&(k.current=!1,w.current())}},[]);return(0,a.vJ)(()=>{t&&s(e=>st(e,t))},[t]),(0,a.vJ)(()=>{if(!p)return;let e=e=>{if("Escape"!==e.key||e.defaultPrevented)return;let t=e.target instanceof HTMLElement?e.target:null,n=t?.tagName;"INPUT"===n||"TEXTAREA"===n||t?.isContentEditable||b.current()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[p]),(0,a.vJ)(()=>{if(!e||!d){r([]),s(null),c(!1);return}let t=++u.current,n=h.current,i=()=>t===u.current,a=n?.source==="history";r([]),s(n),c(!0),f.current=0,x.current=n?.sessionFile,g.current=!1;let l=()=>{null===y.current&&(y.current=window.setTimeout(()=>{y.current=null,N()},150))};w.current=l;let o=async()=>{let t=0,l=x.current,o=a||!n?.sessionFile,p=[];for(let n=0;n<20;n++){let n=o?await l7(e,d,t):await l6(e,d,l,t);if(!i()||!n&&!o&&0===t&&(o=!0,n=await l7(e,d,0),!i()))return;if(!n)break;l=n.sessionFile||l;let r=l5(n.messages,!1);if(p=n.reset?r:l3(p,r),n.nextByte<=t||(t=n.nextByte,void 0!==n.totalBytes&&t>=n.totalBytes))break}i()&&(x.current=l,f.current=t,g.current=!o,r(e=>l3(e,p)),c(!1),o&&s(e=>e&&!se(e.status)?{...e,status:"completed"}:e))},p=t=>{let n=t.detail;return n&&n.sessionId===e?n:null},m=e=>{let t=p(e);if(!t)return;let n=iA(t.payload);n&&n.id===d&&(s(e=>st(e,n)),l())},b=e=>{let t=p(e);if(!t)return;let n=(0,ig.u)(t.payload)?t.payload:null;if(!n)return;let i="string"==typeof n.id?n.id:null;if(i&&i!==d)return;if(!i){let e="number"==typeof n.index?n.index:null;if(null===e||e!==(h.current?.index??-1))return}let r=iD(n);r&&s(e=>{if(!e||e.id!==d)return e;let t={...e,progress:{...e.progress,...r}};return r.status&&!se(e.status)&&(t.status=l9[r.status]??e.status),t})},v=e=>{let t=p(e);if(!t)return;let n=(0,ig.u)(t.payload)?t.payload:null;n&&n.id===d&&l()};return a||(window.addEventListener("subagent_lifecycle",m),window.addEventListener("subagent_progress",b),window.addEventListener("subagent_event",v)),o(),()=>{u.current+=1,g.current=!1,null!==y.current&&(window.clearTimeout(y.current),y.current=null),a||(window.removeEventListener("subagent_lifecycle",m),window.removeEventListener("subagent_progress",b),window.removeEventListener("subagent_event",v))}},[e,d,N]),{messages:i,isLoading:o,status:l,isActive:p}}(t,n,r),m=sn(si)??{},h=(0,a.li)(null),b=p?.status??n?.status??"started",f="started"===b;if((0,a.vJ)(()=>{let e=h.current;if(!e)return;let t=requestAnimationFrame(()=>{e.scrollTop=e.scrollHeight});return()=>cancelAnimationFrame(t)},[c.length,f]),!n||!u)return null;let x=p?.progress??n.progress,g=x?.resolvedModel??n.agent,v=tr(x?.tokens),k=v?`${v} tok`:"",y=p?.task??p?.assignment??p?.description??n.task??n.assignment??n.description,w=y?y.replace(/\$0(\.00*)?/g,"").trim():void 0;return(0,i.FD)("div",{className:`flex flex-col h-full min-h-0 overflow-hidden bg-canvas ${o}`,children:[(0,i.FD)("div",{className:"flex items-center gap-2.5 border-b border-ink/15 bg-paper px-3 py-2 flex-shrink-0",children:[(0,i.Y)("button",{type:"button",onClick:r,title:"Back to session",className:"flex items-center justify-center w-7 h-7 rounded-md border border-ink/15 text-ink/70 hover:text-ink hover:bg-ink/5 transition-colors shrink-0 cursor-pointer",children:(0,i.Y)(lH.A,{size:14})}),(0,i.Y)(ix,{status:b,live:f,size:12}),(0,i.Y)(I.A,{size:13,className:"text-ink/60 shrink-0"}),(0,i.FD)("div",{className:"min-w-0 flex-1",children:[(0,i.FD)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,i.Y)("span",{className:"font-mono text-[12px] font-semibold text-ink truncate",children:p?.agent??n.agent}),(0,i.Y)("span",{className:"shrink-0 rounded bg-ink/5 px-1.5 py-0.5 font-mono text-[9px] uppercase tracking-wider text-ink/50",children:sr[b]})]}),(0,i.Y)("p",{className:"truncate text-[11px] text-ink/55 font-sans",children:w??"Subagent transcript"})]}),k&&(0,i.Y)("span",{className:"hidden sm:inline shrink-0 font-mono text-[10px] text-ink/45",children:k})]}),(0,i.Y)("div",{ref:h,className:"flex-1 min-h-0 overflow-y-auto overscroll-contain scrollbar-overlay-container timeline-scrollbar-visible p-4 pb-10",children:(0,i.Y)("div",{className:"mx-auto w-full max-w-[970px]",children:d&&0===c.length?(0,i.FD)("div",{className:"flex items-center justify-center gap-2 py-12 text-[11px] font-mono text-ink/50",children:[(0,i.Y)(tf.A,{size:14,className:"animate-spin"}),(0,i.Y)("span",{children:"Loading transcript…"})]}):0===c.length?(0,i.Y)("div",{className:"py-12 text-center text-[11.5px] font-mono text-ink/45",children:"No transcript messages yet."}):c.map((e,t)=>{let n=c.length-1;for(;n>=0&&c[n].notice;)n--;let r=f&&t===n&&"user"!==e.role&&!e.notice,a=c.slice(t+1).find(e=>!e.notice),o="user"!==e.role&&!e.notice&&(!a||"user"===a.role),d=t-1;for(;d>=0&&c[d].notice;)d--;let p=d>=0?c[d]:null,u=!!("user"!==e.role&&p&&"user"!==p.role);return(0,i.Y)(lI,{msg:e,provider:e.provider||l,providerNames:s,modelName:e.model||g,modelNames:m,isStreaming:r,footerVisible:o,durationMs:e.durationMs??null,isPrevAssistant:u,className:e.notice?"mt-3 mb-1":u?"mt-1":"mt-3"},e.id)})})}),(0,i.Y)("div",{className:"flex-shrink-0 p-4 pt-1",children:(0,i.Y)("div",{className:"mx-auto w-full max-w-[970px]",children:(0,i.FD)("div",{className:"flex items-center justify-center gap-2 rounded-lg border border-ink/15 bg-paper px-3 py-2 text-[11px] font-mono text-ink/50 select-none",children:[(0,i.Y)(lq.A,{size:11,className:"text-ink/45"}),(0,i.Y)("span",{children:"Read-only transcript — subagents cannot receive messages"})]})})})]})}var sl=n("zi");let ss=(0,s.ph)(function(e){let{messages:t,isGenerating:n,provider:r,providerNames:l,modelName:s,modelNames:o,thinkingLevel:c,onUndo:d,onRetry:p,onNewChat:u,isMobile:m=!1}=e,{lastAiIdx:h,nextNonNotice:b,prevNonNoticeIdx:f,durations:x}=(0,a.Kr)(()=>{let e=t.length,n=e-1;for(;n>=0&&t[n].notice;)n--;let i=Array(e),r=null;for(let n=e-1;n>=0;n--)i[n]=r,t[n].notice||(r=t[n]);let a=Array(e),l=-1;for(let n=0;n<e;n++)a[n]=l,t[n].notice||(l=n);let s=Array(e);for(let n=0;n<e;n++){let e=t[n],r=i[n],a="user"!==e.role&&!e.notice&&(!r||"user"===r.role);s[n]=a?function(e,t){var n;let i=(n=e[t],"number"==typeof n?.completedAt&&Number.isFinite(n.completedAt)?n.completedAt:lP(n));if(null===i)return null;let r=null;for(let n=t-1;n>=0;n--){if(e[n]?.role==="user"){r=lP(e[n]);break}let t=lP(e[n]);null!==t&&(r=t)}return null===r||i<=r?null:i-r}(t,n):null}return{lastAiIdx:n,nextNonNotice:i,prevNonNoticeIdx:a,durations:s}},[t]);return(0,i.Y)(i.FK,{children:t.map((e,a)=>{let g=t[a-1],v=n&&a===h&&"ai"===e.role,k=b[a],y="user"!==e.role&&!e.notice&&(!k||"user"===k.role),w=!!g?.notice,N="user"!==e.role&&g&&"user"!==g.role&&!w,Y=f[a],D=Y>=0?t[Y]:null,A=!!("user"!==e.role&&D&&"user"!==D.role);return(0,i.Y)(lI,{msg:e,provider:r,providerNames:l,modelName:s,modelNames:o,thinkingLevel:c,isStreaming:v,onUndo:d,onRetry:p,onNewChat:u,footerVisible:y,durationMs:x[a],isPrevAssistant:A,isMobile:m,className:e.notice?"mt-3 mb-1":N?"mt-1":"mt-3"},e.id)})})});function so(e){let{userMessages:t,onScrollTo:n}=e,[r,l]=(0,a.J0)(null);return 0===t.length?null:(0,i.Y)("div",{className:"absolute right-0.5 top-1/2 -translate-y-1/2 z-20 flex flex-col items-center py-4 w-6",onMouseLeave:()=>l(null),children:t.map((e,t)=>{let a=r===t;return(0,i.FD)("div",{className:"relative flex items-center justify-center w-full py-[3px] cursor-pointer",onMouseEnter:()=>l(t),onClick:()=>n(e.id),children:[(0,i.Y)("button",{className:`block h-px rounded-full transition-all duration-200 ease-out ${(e=>{if(null===r)return"w-3";let t=Math.abs(e-r);return 0===t?"w-6":1===t?"w-4":"w-3"})(t)} ${a?"bg-ink h-[2px]":"bg-ink/25"}`,"aria-label":`Jump to your message #${t+1}`}),(0,i.FD)("div",{className:`absolute right-full mr-3 top-1/2 transform -translate-y-1/2 w-64 p-3 bg-ink text-canvas text-xs rounded-md shadow-lg pointer-events-none transition-opacity duration-200 z-30 ${a?"opacity-100":"opacity-0"}`,children:[(0,i.Y)("div",{className:"line-clamp-3 whitespace-pre-wrap leading-relaxed",children:e.content}),(0,i.Y)("div",{className:"absolute top-1/2 -right-1 transform -translate-y-1/2 w-2 h-2 bg-ink rotate-45"})]})]},`minimap-${e.id}`)})})}function sc(e){let{isMobile:t,userMessages:n,onScrollTo:r,scrollRef:a,contentRef:l,handleScroll:s,isScrolling:o,loadingOlder:c,hasMore:d,loadOlderError:p,loadOlder:u,messages:m,isGenerating:h,provider:b,providerNames:f,modelName:x,modelNames:g,thinkingLevel:v,onUndo:k,onRetry:y,onNewChat:w,showScrollBottom:N,jumpToBottom:Y}=e;return(0,i.FD)(i.FK,{children:[!t&&(0,i.Y)(so,{userMessages:n,onScrollTo:r}),(0,i.Y)("div",{ref:a,onScroll:s,className:`flex-1 scrollbar-overlay-container overscroll-contain scroll-smooth overflow-x-hidden ${t?"px-3 py-3 pb-8":"p-4 pb-10"} ${o?"timeline-scrollbar-visible":"timeline-scrollbar-hidden"}`,children:(0,i.FD)("div",{ref:l,className:"mx-auto w-full max-w-[970px]",children:[(c||d||p)&&(0,i.Y)("div",{className:"pb-1",children:c?(0,i.Y)(lK,{}):(0,i.Y)("button",{type:"button",onClick:u,className:`block mx-auto px-3 py-1 rounded-full border text-[11px] font-mono transition-colors ${p?"border-error/40 text-error hover:border-error":"border-ink/15 text-ink/50 hover:text-ink hover:border-ink/30"}`,children:p?"Failed to load — retry":"Load earlier messages"})}),(0,i.Y)(ss,{messages:m,isGenerating:h,provider:b,providerNames:f,modelName:x,modelNames:g,thinkingLevel:v,onUndo:k,onRetry:y,onNewChat:w,isMobile:t})]})}),N&&(0,i.Y)("div",{className:"absolute bottom-4 left-1/2 transform -translate-x-1/2 z-20",children:(0,i.Y)("button",{onClick:()=>Y("smooth"),className:"flex items-center justify-center w-8 h-8 rounded-full border border-ink/20 bg-paper text-ink/60 hover:text-ink hover:bg-ink/5 transition-all shadow-sm",title:"Scroll to bottom",children:(0,i.Y)(sl.A,{size:16})})})]})}let sd={steer:"steer",followup:"follow-up"};function sp(e){let{queue:t,setQueue:n,isSteering:r=!1,onEdit:l,onSendNow:s}=e,o=(0,a.li)(null),c=(0,a.li)(null),d=()=>{if(null===o.current||null===c.current)return;let e=[...t],i=e.splice(o.current,1)[0];e.splice(c.current,0,i),o.current=null,c.current=null,n(e)};if(0===t.length)return null;let p=r?"steer":"followup";return(0,i.Y)("div",{className:"max-h-[150px] scrollbar-overlay-container scrollbar-overlay-static mb-2 space-y-1",children:t.map((e,t)=>(0,i.FD)("div",{draggable:!0,onDragStart:()=>{o.current=t},onDragEnter:()=>{c.current=t},onDragEnd:d,onDragOver:e=>e.preventDefault(),className:"flex items-center gap-2 px-2 py-1.5 bg-paper border border-ink/10 rounded shadow-sm text-xs group hover:border-ink/30 transition-colors",children:[(0,i.Y)("div",{className:"cursor-grab text-ink/40 group-hover:text-ink/80",children:(0,i.Y)(ro.A,{size:14})}),(0,i.Y)("span",{className:`shrink-0 text-[9px] font-mono uppercase tracking-wider px-1 py-px rounded ${"steer"===p?"bg-error/10 text-error":"bg-ink/10 text-ink/70"}`,children:sd[p]}),(0,i.Y)("div",{className:"flex-1 truncate text-ink/80 pr-2",children:e.text||(e.attachments.length>0?`[${e.attachments.length} attachment${e.attachments.length>1?"s":""}]`:"Empty message")}),s&&"followup"===p&&(0,i.Y)("button",{onClick:()=>s(e),className:"text-ink/40 hover:text-ink/80 opacity-0 group-hover:opacity-100 transition-opacity",title:"Send Now (Steering)",children:(0,i.Y)(N.A,{size:12})}),l&&(0,i.Y)("button",{onClick:()=>l(e),className:"text-ink/40 hover:text-ink/80 opacity-0 group-hover:opacity-100 transition-opacity",title:"Edit",children:(0,i.Y)(ip.A,{size:12})}),(0,i.Y)("button",{onClick:()=>n(t=>t.filter(t=>t.id!==e.id)),className:"text-ink/40 hover:text-error opacity-0 group-hover:opacity-100 transition-opacity",title:"Remove",children:(0,i.Y)(h.A,{size:14})})]},e.id))})}function su(e){let{isMobile:t,isGenerating:n,modelName:r,generatingVerb:a,provider:l,providerNames:s,messageQueue:o,setMessageQueue:c,onEditQueueItem:d,onSendNowQueueItem:p,steeringQueue:u,setSteeringQueue:m,inputValue:h,setInputValue:b,rootPath:f,attachments:x,setAttachments:g,onSend:v,onStop:k,appSettings:y,onThinkingLevelChange:w,onModelChange:N,accessMode:Y,onAccessModeChange:D,composerModelRef:A,sessionModel:F,sessionThinkingLevel:C,variant:S}=e;return(0,i.Y)("div",{className:`bg-transparent border-t-0 flex-shrink-0 space-y-2 ${t?"px-3 pt-1":"p-4 pt-1"}`,style:t?{paddingBottom:"max(0.75rem, env(safe-area-inset-bottom, 0px))"}:void 0,children:(0,i.FD)("div",{className:"mx-auto w-full max-w-[970px]",children:[n&&(0,i.Y)(l$,{modelName:r,generatingVerb:a,provider:l,providerNames:s}),(0,i.Y)(sp,{queue:o,setQueue:c,onEdit:d,onSendNow:p}),(0,i.Y)(sp,{queue:u,setQueue:m,isSteering:!0}),(0,i.Y)(r$,{value:h,onChange:b,rootPath:f,attachments:x,onAttachmentsChange:g,onSend:v,isGenerating:n,onStop:k,appSettings:y,onThinkingLevelChange:w,onModelChange:N,accessMode:Y,onAccessModeChange:D,composerModelRef:A,sessionModel:F,sessionThinkingLevel:C,variant:S})]})})}var sm=n("zG");function sh(e){let t,n=(0,sm.oJ)(e.name)??"",i=sm.YT[n.toLowerCase()]??n.toLowerCase(),r=(t={...(0,ig.u)(e.args)?e.args:(0,ig.u)(e.input)?e.input:{}},e.command&&void 0===(0,sm.oJ)(t.command)&&void 0===(0,sm.oJ)(t.cmd)&&(t.command=e.command),e.target&&void 0===(0,sm.oJ)(t.path)&&(t.path=e.target),t),a=(0,sm.oJ)(e.intent)??(0,sm.Up)(r,["i"]),l=function(e,t){let n=(0,sm.Up)(e,["path","target"])??(0,sm.oJ)(t.target)??(0,sm.oJ)(t.command);if(n&&n.startsWith("xd://"))return n.slice(5).split(/[/?#\s]/)[0]||void 0}(r,e);if(l){let e=l.startsWith("mcp__")?l.slice(5):void 0,t=e?`Running ${e}`:sm.Qq[l]??`Running ${l}`,n=(0,sm.qL)(e??l,function(e){let{path:t,target:n,command:i,i:r,...a}=e,l=e.content;if("string"!=typeof l)return a;try{let e=JSON.parse(l);if((0,ig.u)(e))return{...a,...e}}catch{}let s=l.trim().split("\n",1)[0]?.trim();return s?{...a,prose:s}:a}(r));return n?(0,sm.xv)(`${t} ${n}`):a?(0,sm.xv)(a):(0,sm.xv)(t)}let s=sm.K$[i]??(i?`Running ${i}`:"Working"),o=(0,sm.qL)(i,r);return o?(0,sm.xv)(`${s} ${o}`):a?(0,sm.xv)(a):(0,sm.xv)(s)}var sb=n("Kc");function sf(e,t,n){var i;for(e.set(t,{...n,output:(i=n.output).length<=2e5?i:`…[truncated]
|
|
54
|
-
${i.slice(-2e5)}`});e.size>200;){let t=e.keys().next().value;if(void 0===t)break;e.delete(t)}}function sx(e,t){e&&e!==t.activityRef.current&&(t.activityRef.current=e,t.callbacksRef.current?.onActivity?.(e))}function sg(e,t){if(!e.toolCalls?.length)return e;let n=e.toolCalls.map(e=>{let n=t.current?.get(e.id);return n?{...e,output:n.output,details:e.details||n.details||void 0,status:n.isError?"error":"success"}:e});return{...e,toolCalls:n}}function sv(e,t){let n="string"==typeof e.toolCallId?e.toolCallId:void 0;n&&t.toolResultsRef.current?.set(n,{output:lG(e.content),details:e.details&&"object"==typeof e.details?e.details:void 0})}function sk(e,t){if(!e)return;let n=t.lastToolMessageRef.current;n?.toolCalls?.some(t=>t.id===e)&&t.callbacksRef.current?.onMessageUpdate?.(sg(n,t.toolResultsRef))}function sy(e){let t=(0,A.BF)("streamTransport",e);return"sse"===t||"websocket"===t?t:"websocket"}let sw="omp:stream-status",sN={transport:sy(),connected:!1};function sY(){return sN}function sD(e){e.transport===sN.transport&&e.connected===sN.connected||(sN=e,"u">typeof window&&window.dispatchEvent(new CustomEvent(sw,{detail:e})))}let sA={websocket:function(e,t){let n=null,i=null,r=0,a=!1,l=!1,s=()=>{let o,c=new WebSocket((o="https:"===window.location.protocol?"wss:":"ws:",`${o}//${window.location.host}/api/agent/${encodeURIComponent(e)}/ws`));n=c,c.onopen=()=>{l||(r=0,a=!0,t.onOpen())},c.onmessage=e=>{let n;if(!l){try{n=JSON.parse(String(e.data))}catch{return}t.onFrame(n)}},c.onclose=()=>{n=null,l||(t.onClose(),!a||(r+=1)>4||(i=setTimeout(()=>{i=null,l||s()},Math.min(500*2**(r-1),8e3))))}};return s(),{close:()=>{l=!0,null!==i&&(clearTimeout(i),i=null);let e=n;n=null,e&&(e.onopen=null,e.onmessage=null,e.onclose=null,e.onerror=null,e.close())}}},sse:function(e,t){let n=new EventSource(`/api/agent/${encodeURIComponent(e)}/events`),i=!1;return n.onopen=()=>{i||t.onOpen()},n.onmessage=e=>{let n;if(!i){try{n=JSON.parse(e.data)}catch{return}t.onFrame(n)}},n.onerror=()=>{i||n.readyState===EventSource.CLOSED&&t.onClose()},{close:()=>{i=!0,n.onopen=null,n.onmessage=null,n.onerror=null,n.close()}}}},sF="u"<typeof window?a.vJ:a.Nf;function sC(e){if(!e||e.length<=1)return e;let t=[...e],n=!0;for(;n;){n=!1;for(let e=0;e<t.length-1;e++){let i=t[e],r=t[e+1];i.notice&&"user"===r.role&&(t[e]=r,t[e+1]=i,n=!0)}}return t}var sS=n("G1");async function sT(e,t){let{sessionId:n,prompt:i,model:r,workspaceName:a,attachments:l,signal:s}=e,o={id:`msg-${Date.now()}-ai`,role:"ai",date:`Today, ${aD()}`,content:""},c=!1;try{let e=await fetch("/api/chat/stream",{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify({sessionId:n,prompt:i,model:r,workspaceName:a,attachments:l?.map(e=>({name:e.name||e.file?.name,preview:e.preview}))}),signal:s});if(!e.ok||!e.body)throw Error(`SSE stream connection failed: HTTP ${e.status}`);if(await (0,sS.o)(e,(e,n)=>{try{let i=JSON.parse(n);switch(e){case"init":o.id=i.id||o.id,o.date=i.date||o.date,t.onInit?.(i);break;case"thinking_start":o.thinking={thought:"",isGenerating:!0},t.onThinkingStart?.(i);break;case"thinking_chunk":"object"==typeof o.thinking?o.thinking.thought=(o.thinking.thought||"")+i.delta:o.thinking={thought:i.delta,isGenerating:!0},t.onThinkingChunk?.(i);break;case"thinking_end":o.thinking={thought:i.thought,summary:i.summary,duration:i.duration,isGenerating:!1},t.onThinkingEnd?.(i);break;case"tool_start":o.toolCalls=[...o.toolCalls||[],i],t.onToolStart?.(i);break;case"tool_output_chunk":o.toolCalls=(o.toolCalls||[]).map(e=>e.id===i.id?{...e,output:(e.output||"")+i.delta}:e),t.onToolOutputChunk?.(i);break;case"tool_end":o.toolCalls=(o.toolCalls||[]).map(e=>e.id===i.id?{...e,...i}:e),t.onToolEnd?.(i);break;case"content_start":t.onContentStart?.();break;case"content_chunk":o.content=(o.content||"")+i.delta,t.onContentChunk?.(i);break;case"content_end":t.onContentEnd?.();break;case"summary":o.summary=i.summary,t.onSummary?.(i);break;case"done":return i.message&&(o=i.message),c=!0,t.onDone?.(i),!0;case"error":throw Error(i.error||"Stream error")}}catch(e){console.warn("SSE chunk parse error:",e)}},s),s?.aborted)return null;return c||t.onDone?.({message:o}),o}catch(n){if(s?.aborted)return null;return console.warn("Streaming failed, invoking fallback response handler:",n),t.onError?.(n),await sM(e,t)}}async function sM(e,t){let{sessionId:n,prompt:i,model:r,workspaceName:a}=e,l=aD(),s={id:`msg-${Date.now()}-ai`,role:"ai",date:`Today, ${l}`,timestamp:l,thinking:{duration:"1.2s",thought:`1. User prompt: "${i}".
|
|
55
|
-
2. Target workspace: ${a||"Workspace"}.
|
|
56
|
-
3. Fallback resolution complete.`,summary:"Execute workspace diagnostics and fallback resolution."},toolCalls:[{id:`tc-${Date.now()}-fallback`,type:"bash",title:"Diagnostic Command",target:"bun --version",command:"bun --version",output:"Bun v1.2.4 (fallback mode)",status:"success",duration:"35ms"}],content:`I've processed your request: **"${i||"Workspace status"}"**.
|
|
57
|
-
|
|
58
|
-
- **Target Workspace**: \`${a||"Workspace"}\`
|
|
59
|
-
- **Runtime**: Bun v1.2.4 with remisJS edge adapter
|
|
60
|
-
- **Status**: Ready.`,summary:"Execution completed via fallback adapter."};t.onInit?.({id:s.id,role:"ai",date:s.date,model:r}),t.onThinkingEnd?.(s.thinking),t.onContentChunk?.({delta:s.content}),t.onSummary?.({summary:s.summary||""}),t.onDone?.({message:s});try{await fetch(`/api/chat/${n}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:s})})}catch{}return s}let sz={txt:!0,text:!0,md:!0,markdown:!0,mdx:!0};function sP(e){return e.toLowerCase().replace(/\\/g,"/").split("/").pop()?.split(".").pop()??""}function sL(e){return"text/plain"===e.type||"text/markdown"===e.type||!0===sz[sP(e.name)]}let sj=/(^|[\s([{])@"file:([^"]+)"/g,sR=/(^|[\s([{])@file:(\S+)/g,sI=/(^|[\s([{])@("([^"]+)"|'([^']+)'|(\S+))/g,sE=/[.,;:!?)\]}]+$/;function s$(e,t){let n=null,i=0,r=[],a=()=>{n=null;let i=r;if(r=[],i.length){for(let t of i)e(t.updater);t?.()}},l=()=>{i+=1,null!==n&&cancelAnimationFrame(n),n=null};return{queue(e,t){let l=void 0===t?-1:r.findIndex(e=>e.key===t);-1!==l?r[l]={key:t,updater:e}:r.push({key:t,updater:e}),(()=>{if(null!==n)return;let e=++i;n=requestAnimationFrame(()=>{e===i&&a()})})()},flush(){l(),a()},cancel(){l(),r=[]}}}async function sO(e,t){let n=e;try{let t=await tO();t.length>0&&(n=function(e,t){let n=function(e,t){let n=new Set(t.map(e=>e.toLowerCase())),i=[];for(let t of e.matchAll(sI)){let e=t.index+t[1].length,r=t[3]??t[4];if(void 0!==r){if(!n.has(r.toLowerCase()))continue;i.push({name:r,start:e,end:e+1+(t[2]??"").length});continue}let a=(t[5]??"").replace(sE,"");n.has(a.toLowerCase())&&i.push({name:a,start:e,end:e+1+a.length})}return i}(e,t);if(0===n.length)return{text:e,agents:[]};let i=[],r=new Set;for(let e of n){let t=e.name.toLowerCase();r.has(t)||(r.add(t),i.push(e.name))}let a=e;for(let e=n.length-1;e>=0;e--){let t=n[e];a=a.slice(0,t.start)+a.slice(t.end)}return""===(a=a.replace(/[ \t]+/g," ").replace(/\n{2,}/g,"\n").trim())?{text:e,agents:i}:{text:`Use the task tool to delegate this request to the following oh-my-pi subagent(s): ${i.map(e=>`\`${e}\``).join(", ")} (agent id: ${i.join(", ")}).
|
|
61
|
-
|
|
62
|
-
${a}`,agents:i}}(e,t).text)}catch{}var i=n.replace(sj,'$1@"$2"').replace(sR,"$1@$2");if(0===t.length)return i;let r=t.map(e=>{var t;let n,i,r=(t=e.content,n=t.match(/`+/g)?.reduce((e,t)=>Math.max(e,t.length),0)??0,"`".repeat(Math.max(3,n+1)));return`Attached file: ${e.name}
|
|
63
|
-
${r}${"md"===(i=sP(e.name))||"markdown"===i||"mdx"===i?"markdown":"text"}
|
|
64
|
-
${e.content}
|
|
65
|
-
${r}`});return[i.trim(),...r].filter(Boolean).join("\n\n")}let sJ=[250,250,500,500,1e3,1e3,2e3,2e3,2e3,2e3,2e3,2e3];var s_=n("Fb");function sU(e,t){let n=e[t];return"string"==typeof n?n:void 0}let sK=()=>{},sB=()=>{},sW=s$(e=>sK(e),()=>sB());function sH(){sW.cancel()}function sq(e){var t;return t=e.connectedProviders,t?.length?Object.fromEntries(t.filter(e=>e.name?.trim()).map(e=>[e.id,e.name])):{}}function sG(e){let t,n,{className:r="",appSettings:s={},onSessionTitle:o,variant:c="desktop"}=e,{folders:d}=ni(),p="mobile"===c,{sessionId:u,selectedFolderId:m,setSelectedFolderId:h,sessionData:b,localMessages:f,isGenerating:x,hasMore:g,loadingOlder:v,loadOlderError:k,sessionLoading:y,loadOlder:w,generatingVerb:N,messageQueue:Y,setMessageQueue:D,steeringQueue:F,setSteeringQueue:C,inputValue:S,setInputValue:T,inputAttachments:M,setInputAttachments:z,scrollRef:P,contentRef:L,showScrollBottom:j,isScrolling:R,handleScroll:I,jumpToBottom:E,handleSend:$,handleEditQueueItem:O,handleSendNowQueueItem:J,handleUndo:_,handleRetry:U,submitNewChat:K,stopGenerating:B,handleThinkingLevelChange:W,handleModelChange:H,accessMode:q,handleAccessModeChange:G,composerModelRef:V,extensionDialog:Q,closeExtensionDialog:Z,respondToExtensionUi:X}=function(){let e,{folders:t=[],appSettings:n={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[i,r]=(0,l.o)(),s=i.get("sessionId"),o=i.get("folderId"),[c,d]=(0,a.J0)(null);(0,a.vJ)(()=>{d(o?parseInt(o,10):null)},[o]);let p=(0,a.hb)(e=>{d(e),r(t=>(e?t.set("folderId",String(e)):t.delete("folderId"),t),{replace:!0})},[r]),u=(0,a.li)(()=>{}),{scrollRef:m,contentRef:h,showScrollBottom:b,isScrolling:f,handleScroll:x,scrollToBottom:g,jumpToBottom:v}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,a.li)(e.onScrollTop);t.current=e.onScrollTop??t.current;let n=(0,a.li)(null),[i,r]=(0,a.J0)(null),[l,s]=(0,a.J0)(!1),[o,c]=(0,a.J0)(!1),d=(0,a.li)(null),p=(0,a.li)(!0),u=(0,a.li)(0),m=(0,a.hb)(e=>{r(e)},[]),h=(0,a.hb)(()=>{let e=n.current;e&&s(e.scrollHeight-e.scrollTop-e.clientHeight>=100)},[]),b=(0,a.hb)(()=>{let e=n.current;e&&(e.scrollTop<u.current-1&&(p.current=!1),e.scrollHeight-e.scrollTop-e.clientHeight<100&&(p.current=!0),u.current=e.scrollTop,e.scrollTop<=40&&t.current?.()),h(),c(!0),d.current&&clearTimeout(d.current),d.current=setTimeout(()=>c(!1),600)},[h]),f=(0,a.hb)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"smooth",t=n.current;!t||p.current&&t.scrollTo({top:t.scrollHeight,behavior:e})},[]),x=(0,a.hb)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"smooth",t=n.current;t&&(p.current=!0,t.scrollTo({top:t.scrollHeight,behavior:e}))},[]);return(0,a.vJ)(()=>{if(h(),"u"<typeof ResizeObserver)return;let e=n.current,t=new ResizeObserver(h);return e&&t.observe(e),i&&t.observe(i),()=>t.disconnect()},[i,h]),(0,a.vJ)(()=>()=>{d.current&&clearTimeout(d.current)},[]),{scrollRef:n,contentRef:m,showScrollBottom:l,isScrolling:o,followRef:p,handleScroll:b,scrollToBottom:f,jumpToBottom:x}}({onScrollTop:()=>u.current()}),[k,y]=(0,i4.bL)("chat.draft","");(e=(0,a.li)(y)).current=y,(0,a.vJ)(()=>{let t=t=>{let n=t instanceof CustomEvent?t.detail:null;if(!(0,ig.u)(n))return;let i=sU(n,"url");if(!i)return;let r=sU(n,"title");e.current(e=>{let t=e&&!e.endsWith("\n")?"\n\n":e?"\n":"",n=r?`
|
|
66
|
-
Judul: ${r}`:"";return`${e}${t}[Konteks halaman browser]
|
|
67
|
-
URL: ${i}${n}
|
|
68
|
-
(Lanjutkan dari halaman ini.)`})};return window.addEventListener(s_.j,t),()=>window.removeEventListener(s_.j,t)},[]);let[w,N]=(0,i4.bL)("chat.draftAttachments",[]),[Y,D]=(0,a.J0)([]),F=!!s?.startsWith("new-");!function(e){let{sessionId:t,messages:n,scrollRef:i,scrollToBottom:r,enabled:l}=e,s=(0,a.li)(null),o=(0,a.li)(null);sF(()=>{if(s.current!==t){s.current=t,o.current=null;return}l&&t&&0!==n.length&&o.current!==t&&i.current&&(o.current=t,r("instant"))},[t,n,l,i,r])}({sessionId:s,messages:Y,scrollRef:m,scrollToBottom:g,enabled:!F});let[C,S]=(0,a.J0)(!1),T=(0,a.li)(!1),M=(0,a.li)([]);M.current=Y;let[z,P]=(0,a.J0)(""),L=(0,a.li)(null),j=(0,a.li)(s);j.current=s;let R=(0,a.hb)(e=>{T.current=e,S(e)},[]),I=(0,a.li)(!1),E=(0,a.li)(null),$=(0,a.li)(null),O=(0,a.li)([]),J=!!s&&!String(s).startsWith("new-")&&Number.isNaN(Number(s)),_=(0,a.li)(null),{sessionData:U,adoptedSessionIdRef:K,refreshSessionMeta:B,setSessionModel:W,hasMore:H,loadingOlder:q,loadOlderError:G,sessionLoading:V,loadOlder:Q}=function(e){let{sessionId:t,setLocalMessages:n,setGenerating:i,isGeneratingRef:r,aiPlaceholderIdRef:l,localMessagesRef:s,optimisticUserIdRef:o,cancelStreamingCoalescer:c,metaRefreshedRef:d,scrollRef:p}=e,[u,m]=(0,a.J0)(null),[h,b]=(0,a.J0)(!1),[f,x]=(0,a.J0)(0),[g,v]=(0,a.J0)(!1),[k,y]=(0,a.J0)(!1),[w,N]=(0,a.J0)(0),Y=(0,a.li)(!1),[D,A]=(0,a.J0)(!1),F=(0,a.li)(null),C=(0,a.li)(null),S=(0,a.li)(null),T=(0,a.li)(null),M=(0,a.hb)(e=>{e.model&&"object"==typeof e.model&&(T.current=e.model);let t=e.model??(r.current?T.current??void 0:void 0);m({...e,model:t})},[]),z=(0,a.li)(t);z.current=t;let P=(0,a.hb)(e=>{let t=()=>z.current===e||S.current===e;if(!t())return;let n=0,i=()=>{t()&&fetch(`/api/chat/${encodeURIComponent(e)}`).then(e=>e.json()).then(r=>{if(!r?.session||!t())return;if(M(r.session),(r.session.messages?.length??0)>0)return void window.dispatchEvent(new CustomEvent("omp:session-updated",{detail:{sessionId:e}}));let a=sJ[n];n+=1,void 0!==a&&setTimeout(i,a)}).catch(()=>{})};i()},[M]),L=(0,a.hb)(e=>{T.current=e,m(t=>({...t??{},model:e??void 0}))},[]),j=(0,a.hb)(()=>r.current&&!!l.current,[l]);(0,a.vJ)(()=>{let e=!0;if(A(!0),t!==C.current){let e=t&&!t.startsWith("new-")&&C.current?.startsWith("new-"),a=r.current&&S.current===t;e||a||(n([]),i(!1),S.current=null,T.current=null,l.current=null,o.current=null,c()),b(!1),x(0),Y.current=!1,v(!1),y(!1),d.current=null,C.current=t}return t?fetch(`/api/chat/${t}`).then(e=>e.json()).then(i=>{if(e)if(A(!1),i?.session){M(i.session);let e=i.session.messages||[],a=j();if(e.length>0&&!a)if(r.current){let t=e.map(e=>e.id);n(sC([...e,...s.current.filter(e=>!t.includes(e.id))]))}else n(sC(e));else t.startsWith("new-")||a||n([]);"boolean"==typeof i.hasMore&&b(i.hasMore),"number"==typeof i.oldestIndex&&x(i.oldestIndex)}else m(null),j()||n([])}).catch(t=>{console.error("Error loading session from API:",t),e&&A(!1),e&&!j()&&(m(null),n([]))}):(m(null),n([])),()=>{e=!1}},[t,M,j,n,i]);let R=(0,a.hb)(()=>{if(!t||t.startsWith("new-")||!h||Y.current)return;Y.current=!0,v(!0),y(!1);let e=p?.current;e&&(F.current={prevHeight:e.scrollHeight,prevTop:e.scrollTop}),fetch(`/api/chat/${t}?before=${f}`).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e.json()}).then(e=>{if(z.current!==t)return;let i=e.session?.messages??[];if(b(!!e.hasMore),"number"==typeof e.oldestIndex&&x(e.oldestIndex),0===i.length){F.current=null;return}n(e=>[...sC(i),...e]),N(e=>e+1)}).catch(()=>{z.current===t&&y(!0)}).finally(()=>{Y.current=!1,v(!1)})},[t,h,f,p,n]);return(0,a.Nf)(()=>{let e=F.current;if(!e)return;let t=p?.current;if(!t)return;F.current=null;let n=t.scrollHeight-e.prevHeight;n>0&&(t.scrollTop=e.prevTop+n)},[w,p]),{sessionData:u,hasMore:h,loadingOlder:g,loadOlderError:k,sessionLoading:D,loadOlder:R,adoptedSessionIdRef:S,seededModelRef:T,applySessionData:M,refreshSessionMeta:P,setSessionModel:L,timelineOwnedByOptimistic:j}}({sessionId:s,setLocalMessages:D,setGenerating:R,isGeneratingRef:T,aiPlaceholderIdRef:_,localMessagesRef:M,optimisticUserIdRef:$,cancelStreamingCoalescer:sH,metaRefreshedRef:E,scrollRef:m});u.current=Q;let Z=(0,a.li)(null),X=(0,a.li)(null),ee=(0,a.li)(null),[et,en]=(0,a.J0)(()=>{var e,t;return"string"==typeof(t=e=n.omp_access_mode)&&rY.some(e=>e===t)?e:"always-ask"}),ei=(0,a.li)(et);ei.current=et;let er=(0,a.hb)(e=>{en(e),ei.current=e,(0,A.cz)("omp_access_mode",e)},[]),ea=(0,a.hb)(e=>{s&&fetch(`/api/chat/${s}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:e})}).catch(e=>console.error("Error persisting messages via API:",e))},[s]),{messageQueue:el,setMessageQueue:es,steeringQueue:eo,setSteeringQueue:ec,removeDeliveredFromQueue:ed}=function(e){let[t,n]=(0,a.J0)([]),[i,r]=(0,i4.bL)("chat.steeringQueue",[]),l=(0,a.li)(0);(0,a.vJ)(()=>{if(!e)return void n([]);let t=++l.current,i=!1;return fetch(`/api/sessions/${encodeURIComponent(e)}/queue`).then(e=>e.ok?e.json():{queue:[]}).then(e=>{i||l.current!==t||n(Array.isArray(e.queue)?e.queue:[])}).catch(()=>{}),()=>{i=!0}},[e]);let s=(0,a.hb)(t=>{e&&fetch(`/api/sessions/${encodeURIComponent(e)}/queue`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({queue:t})}).catch(console.error)},[e]),o=(0,a.hb)(e=>{n(t=>{let n="function"==typeof e?e(t):e;return s(n),n})},[s]),c=(0,a.hb)(e=>{let t=t=>t.some(t=>t.text===e);r(n=>t(n)?n.filter(t=>t.text!==e):n),o(n=>t(n)?n.filter(t=>t.text!==e):n)},[r,o]);return{messageQueue:t,setMessageQueue:o,steeringQueue:i,setSteeringQueue:r,removeDeliveredFromQueue:c}}(s),{dialog:ep,enqueue:eu,dismiss:em,withdraw:eh}=function(e){let[t,n]=(0,a.J0)([]);(0,a.vJ)(()=>{n([])},[e]);let i=(0,a.hb)(e=>{n(t=>t.some(t=>t.id===e.id)?t:[...t,e])},[]),r=(0,a.hb)(()=>{n(e=>e.slice(1))},[]),l=(0,a.hb)(e=>{n(t=>t.filter(t=>t.id!==e))},[]);return{dialog:t[0]??null,enqueue:i,dismiss:r,withdraw:l}}(s),eb=function(e,t,n){let[i,r]=(0,a.J0)({isGenerating:!1,connected:!1,error:null}),l=(0,a.li)(t);l.current=t;let s=(0,a.li)(e);s.current=e;let o=(0,a.li)(new Map),c=(0,a.li)(null),d=(0,a.li)(!1),p=(0,a.li)(""),u=(0,a.li)(void 0),m=(0,a.li)(new Set),{connect:h,disconnect:b}=function(e){let{setState:t,callbacksRef:n,toolResultsRef:i,lastToolMessageRef:r,interruptPendingRef:l,activityRef:s,currentThinkingLevelRef:o,fileMutatingCallsRef:c,transport:d}=e,p=(0,a.li)(null);(0,a.vJ)(()=>(sD({transport:d,connected:!1}),()=>sD({transport:d,connected:!1})),[d]);let u=(0,a.hb)(()=>{let e=p.current;p.current=null,e?.close(),t(e=>({...e,connected:!1})),sD({transport:d,connected:!1})},[t,d]);return{connect:(0,a.hb)(e=>{u(),p.current=sA[d](e,{onOpen:()=>{t(e=>({...e,connected:!0})),sD({transport:d,connected:!0}),n.current?.onConnected?.()},onFrame:a=>{!function(e,t){let n=t.callbacksRef.current;switch(e.type){case"agent_start":t.setState(e=>({...e,isGenerating:!0,error:null})),t.toolResultsRef.current?.clear(),t.fileMutatingCallsRef.current?.clear(),t.lastToolMessageRef.current=null,t.interruptPendingRef.current=!1,t.currentThinkingLevelRef.current=void 0,sx(sm.n1.thinking,t),n?.onAgentStart?.();break;case"message_start":case"message_update":{let i=e.message;if(!i)break;if("toolResult"===i.role){sv(i,t),sx(sm.n1.thinking,t);break}sx(function(e){if(!(0,ig.u)(e))return;let t=(0,sm.oJ)(e.type);if(t){if(t.startsWith("thinking"))return sm.n1.thinking;if(t.startsWith("text"))return sm.n1.writing;if("toolcall_start"===t||"toolcall_delta"===t){let t=function(e){let t=e.partial;if(!(0,ig.u)(t))return;let n=t.content;if(!Array.isArray(n))return;let i="number"==typeof e.contentIndex?e.contentIndex:n.length-1,r=n[i];if((0,ig.u)(r)&&"toolCall"===r.type)return r}(e);if(!t)return;return sh({name:(0,sm.oJ)(t.name),args:t.arguments})}if("toolcall_end"===t){let t=e.toolCall;if(!(0,ig.u)(t))return;return sh({name:(0,sm.oJ)(t.name),args:t.arguments})}}}(e.assistantMessageEvent),t);let r=l2(i);r&&("user"!==r.role&&t.currentThinkingLevelRef.current&&(r.thinkingLevel=t.currentThinkingLevelRef.current),n?.onMessageUpdate?.(r));break}case"message_end":{let i=e.message;if(!i)break;if("toolResult"===i.role){sv(i,t);break}if("custom"===i.role)break;if("user"===i.role){let e=lG(i.content);e&&n?.onQueuedMessageDelivered?.(e);break}let r=l2(i,!1);if(!r)break;"user"!==r.role&&t.currentThinkingLevelRef.current&&(r.thinkingLevel=t.currentThinkingLevelRef.current);let a=sg(r,t.toolResultsRef);a.toolCalls?.length&&(t.lastToolMessageRef.current=a),n?.onMessageEnd?.(a);break}case"tool_execution_start":{let i="string"==typeof e.toolCallId?e.toolCallId:void 0;sx(sh({name:"string"==typeof e.toolName?e.toolName:void 0,args:e.args,intent:"string"==typeof e.intent?e.intent:void 0}),t),i&&t.toolResultsRef.current?.set(i,{output:""}),i&&(0,sb.Y)({toolName:e.toolName,args:e.args})&&t.fileMutatingCallsRef.current?.add(i);let r=t.lastToolMessageRef.current;r?.toolCalls?.some(e=>e.id===i)&&(t.lastToolMessageRef.current={...r,toolCalls:r.toolCalls.map(e=>({...e,status:"running"}))},n?.onMessageUpdate?.(t.lastToolMessageRef.current));break}case"tool_execution_update":{let n="string"==typeof e.toolCallId?e.toolCallId:void 0,i=l1(e.partialResult);if(!n||!i)break;let r=t.toolResultsRef.current?.get(n)?.output??"",a=t.toolResultsRef.current;a&&sf(a,n,{output:r+i}),sk(n,t);break}case"tool_execution_end":{let n="string"==typeof e.toolCallId?e.toolCallId:void 0;if(!n)break;sx(sm.n1.thinking,t);let i=t.toolResultsRef.current;i&&sf(i,n,{output:l1(e.result),isError:!0===e.isError,details:e.details&&"object"==typeof e.details?e.details:void 0}),sk(n,t),"u">typeof window&&t.fileMutatingCallsRef.current?.delete(n)&&window.dispatchEvent(new CustomEvent(sb.s,{detail:{sessionId:t.sessionId}}));break}case"agent_end":{t.setState(e=>({...e,isGenerating:!1})),t.activityRef.current="";let i=function(e,t,n){let i;if(!1===e.isTerminal)return{};let r=e.messages;if(!Array.isArray(r))return{};for(let e of r){if(!e||"object"!=typeof e||Array.isArray(e)||"assistant"!==e.role||"aborted"!==e.stopReason&&"error"!==e.stopReason)continue;let r=l2(e,!1);if(!r)continue;let a=sg(r,t.toolResultsRef);a.toolCalls?.length&&(t.lastToolMessageRef.current=a),n?.onMessageEnd?.(a),"string"==typeof e.errorMessage&&(i=e.errorMessage)}return{errorMessage:i}}(e,t,n??void 0);if(t.interruptPendingRef.current){t.interruptPendingRef.current=!1;break}n?.onAgentEnd?.({errorMessage:i.errorMessage??("string"==typeof e.errorMessage?e.errorMessage:void 0),message:"string"==typeof e.message?e.message:void 0});break}case"prompt_error":{let i="string"==typeof e.errorMessage?e.errorMessage:"Prompt failed";t.setState(e=>({...e,isGenerating:!1,error:i})),t.interruptPendingRef.current=!1,t.activityRef.current="",n?.onPromptError?.(i);break}case"notice":n?.onNotice?.("string"==typeof e.level?e.level:"info","string"==typeof e.message?e.message:"");break;case"extension_ui_request":n?.onExtensionUiRequest?.(e);break;case"subagent_lifecycle":case"subagent_progress":case"subagent_event":{let n=e.payload;if(null==n||"object"!=typeof n)break;window.dispatchEvent(new CustomEvent(e.type,{detail:{sessionId:t.sessionId,payload:n}}));break}case"model_changed":n?.onModelChanged?.();break;case"thinking_level_changed":var i;t.currentThinkingLevelRef.current="string"==typeof(i=e.thinkingLevel)&&i.trim()?i.trim():"off"}}(a,{sessionId:e,setState:t,callbacksRef:n,toolResultsRef:i,lastToolMessageRef:r,interruptPendingRef:l,activityRef:s,currentThinkingLevelRef:o,fileMutatingCallsRef:c})},onClose:()=>{t(e=>({...e,connected:!1})),sD({transport:d,connected:!1})}})},[u,t,n,i,r,l,s,o,c,d]),disconnect:u}}({setState:r,callbacksRef:l,toolResultsRef:o,lastToolMessageRef:c,interruptPendingRef:d,activityRef:p,currentThinkingLevelRef:u,fileMutatingCallsRef:m,transport:n});(0,a.vJ)(()=>{if(!e)return;o.current.clear(),m.current.clear(),c.current=null,p.current="";let t=!1;return fetch(`/api/agent/${encodeURIComponent(e)}`).then(e=>e.ok?e.json():null).then(n=>{if(t||!n?.running)return;let i=n.state;for(let t of(i&&(i.isStreaming||i.isPromptRunning)&&(h(e),l.current.onResumeStream?.()),n.pendingUiRequests??[]))l.current.onExtensionUiRequest?.(t)}).catch(()=>{}),()=>{t=!0,b()}},[e,b,h]);let f=(0,a.hb)(async(e,t,n)=>{let i=s.current;if(!i)return!1;r(e=>({...e,isGenerating:!0,error:null}));try{(await fetch(`/api/agent/${encodeURIComponent(i)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"get_state",...n?.accessMode?{accessMode:n.accessMode}:{}})})).ok&&h(i);let a=await fetch(`/api/agent/${encodeURIComponent(i)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"prompt",message:e,...t?.length?{images:t}:{},...n?.accessMode?{accessMode:n.accessMode}:{}})}),l=await a.json().catch(()=>({}));if(!a.ok||l.error)return r(e=>({...e,isGenerating:!1,error:l.error??`HTTP ${a.status}`})),!1;return!0}catch(e){return r(t=>({...t,isGenerating:!1,error:e instanceof Error?e.message:String(e)})),!1}},[h]),x=(0,a.hb)(async(e,t,n,i)=>{r(e=>({...e,isGenerating:!0,error:null}));try{let a=await fetch("/api/agent/new",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"ensure_session",cwd:t,...i?.model?i.model:{},...i?.thinkingLevel?{thinkingLevel:i.thinkingLevel}:{},...i?.accessMode?{accessMode:i.accessMode}:{}})}),l=await a.json().catch(()=>({}));if(!a.ok||!l.sessionId)return r(e=>({...e,isGenerating:!1,error:l.error??`HTTP ${a.status}`})),null;let s=l.sessionId;h(s);let o=await fetch(`/api/agent/${encodeURIComponent(s)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"prompt",message:e,...n?.length?{images:n}:{}})}),c=await o.json().catch(()=>({}));if(!o.ok||c.error)return r(e=>({...e,isGenerating:!1,error:c.error??`HTTP ${o.status}`})),null;return{sessionId:s,model:l.model??null}}catch(e){return r(t=>({...t,isGenerating:!1,error:e instanceof Error?e.message:String(e)})),null}},[h]),g=(0,a.hb)(async()=>{let e=s.current;if(e){d.current=!1;try{await fetch(`/api/agent/${encodeURIComponent(e)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"abort"})})}catch{}r(e=>({...e,isGenerating:!1}))}},[]),v=(0,a.hb)(async(e,t)=>{let n=s.current;if(!n)return!1;d.current=!0,r(e=>({...e,isGenerating:!0,error:null}));try{let i=await fetch(`/api/agent/${encodeURIComponent(n)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"abort_and_prompt",message:e,...t?.length?{images:t}:{}})}),a=await i.json().catch(()=>({}));if(!i.ok||a.error)return d.current=!1,r(e=>({...e,isGenerating:!1,error:a.error??`HTTP ${i.status}`})),!1;return!0}catch(e){return d.current=!1,r(t=>({...t,isGenerating:!1,error:e instanceof Error?e.message:String(e)})),!1}},[]),k=(0,a.hb)(async(e,t)=>{let n=s.current;if(!n)return!1;try{let i=await fetch(`/api/agent/${encodeURIComponent(n)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"follow_up",message:e,...t?.length?{images:t}:{}})}),a=await i.json().catch(()=>({}));if(!i.ok||a.error)return r(e=>({...e,error:a.error??`HTTP ${i.status}`})),!1;return!0}catch(e){return r(t=>({...t,error:e instanceof Error?e.message:String(e)})),!1}},[]),y=(0,a.hb)(async(e,t)=>{let n=s.current;if(n)try{await fetch(`/api/agent/${encodeURIComponent(n)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"set_model",provider:e,modelId:t})})}catch{}},[]),w=(0,a.hb)(async e=>{let t=s.current;if(t)try{await fetch(`/api/agent/${encodeURIComponent(t)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"set_thinking_level",level:e})})}catch{}},[]),N=(0,a.hb)(async(e,t)=>{let n=s.current;if(n)try{await fetch(`/api/agent/${encodeURIComponent(n)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"extension_ui_response",id:e.id,...t})})}catch{}},[]);return{...i,sendPrompt:f,sendNewPrompt:x,sendInterruptAndReply:v,sendFollowUp:k,abort:g,setModel:y,setThinkingLevel:w,respondToExtensionUi:N,disconnect:b}}(J?s:null,function(e){let{removeDeliveredFromQueue:t,setGenerating:n,setGeneratingVerb:i,scrollToBottom:r,adoptedSessionIdRef:a,sessionIdRef:l,metaRefreshedRef:s,refreshSessionMeta:o,setLocalMessages:c,aiPlaceholderIdRef:d,optimisticUserIdRef:p,pendingUserDisplaysRef:u,persistMessages:m,abortControllerRef:h,appSettings:b,enqueueExtensionDialog:f,withdrawExtensionDialog:x}=e;return sK=c,sB=()=>r("smooth"),{onQueuedMessageDelivered:e=>{t(e)},onAgentStart:()=>{n(!0),i(sm.n1.thinking),setTimeout(()=>r("smooth"),50);let e=a.current??l.current;e&&(window.dispatchEvent(new CustomEvent("omp:session-updated",{detail:{sessionId:e}})),s.current!==e&&(s.current=e,setTimeout(()=>o(e),100)))},onResumeStream:()=>{n(!0),i(sm.n1.thinking),setTimeout(()=>r("smooth"),50);let e=a.current??l.current;e&&window.dispatchEvent(new CustomEvent("omp:session-updated",{detail:{sessionId:e}}))},onActivity:e=>{i(e)},onMessageUpdate:e=>{"user"===e.role||e.notice||(p.current=null),sW.queue(t=>{let n=d.current;if(e.notice){if(t.some(t=>t.id===e.id))return t;if(n&&t.some(e=>e.id===n)){let i=t.findIndex(e=>e.id===n);return sC([...t.slice(0,i),e,...t.slice(i)])}return sC([...t,e])}if("user"===e.role){if(t.some(t=>t.id===e.id))return t;let i=p.current;if(i){let n=t.findIndex(e=>e.id===i);if(-1!==n){let i={...e,id:e.id,content:t[n].content,date:t[n].date,attachments:e.attachments?.length?e.attachments:t[n].attachments};return[...t.slice(0,n),i,...t.slice(n+1)]}}let r=u.current.find(t=>e.content===t.sent||e.content.startsWith(t.sent)||t.sent.startsWith(e.content)),a=r?{...e,content:r.display}:e;if(n&&t.some(e=>e.id===n)){let e=t.findIndex(e=>e.id===n);return[...t.slice(0,e),a,...t.slice(e)]}return[...t,a]}if(n&&t.some(e=>e.id===n))return t.map(t=>t.id===n?e:t);let i=t.findIndex(t=>t.id===e.id);return -1!==i?[...t.slice(0,i),e,...t.slice(i+1)]:[...t,e]},e.id)},onMessageEnd:e=>{sW.flush(),"user"!==e.role&&(p.current=null),c(t=>{let n,i=d.current;if("user"===e.role){let n,r=p.current;if(t.some(t=>t.id===e.id))n=t.map(t=>t.id===e.id?e:t);else if(r&&t.some(e=>e.id===r))n=t.map(t=>t.id===r?{...e,id:e.id,content:t.content,date:t.date,attachments:e.attachments?.length?e.attachments:t.attachments}:t);else if(i&&t.some(e=>e.id===i)){let r=t.findIndex(e=>e.id===i);n=[...t.slice(0,r),e,...t.slice(r)]}else n=[...t,e];return m(n),n}if(i&&t.some(e=>e.id===i))n=t.map(t=>t.id===i?e:t);else{let i=t.findIndex(t=>t.id===e.id);n=-1!==i?[...t.slice(0,i),e,...t.slice(i+1)]:[...t,e]}return d.current=null,m(n),n})},onAgentEnd:()=>{sW.flush(),sW.cancel(),n(!1),h.current=null,p.current=null,u.current=[],nB(b),setTimeout(()=>r("smooth"),50);let e=a.current??l.current;e&&o(e)},onModelChanged:()=>{let e=a.current??l.current;e&&setTimeout(()=>o(e),150)},onPromptError:e=>{n(!1),h.current=null,console.error("OMP prompt error:",e)},onNotice:(e,t)=>{console.info("OMP notice:",t)},onExtensionUiRequest:e=>{"select"===e.method||"confirm"===e.method||"input"===e.method||"editor"===e.method?f(e):"cancel"===e.method&&x(e.targetId)}}}({removeDeliveredFromQueue:ed,setGenerating:R,setGeneratingVerb:P,scrollToBottom:g,adoptedSessionIdRef:K,sessionIdRef:j,metaRefreshedRef:E,refreshSessionMeta:B,setLocalMessages:D,aiPlaceholderIdRef:_,optimisticUserIdRef:$,pendingUserDisplaysRef:O,persistMessages:ea,abortControllerRef:L,appSettings:n,enqueueExtensionDialog:eu,withdrawExtensionDialog:eh}),sy(n)),{steerOmpAgent:ef,executeSend:ex}=function(e){let{folders:t,selectedFolderId:n,sessionId:i,isOmpSession:r,appSettings:l,ompAgent:s,setLocalMessages:o,persistMessages:c,setGenerating:d,setGeneratingVerb:p,scrollToBottom:u,jumpToBottom:m,aiPlaceholderIdRef:h,adoptedSessionIdRef:b,optimisticUserIdRef:f,pendingUserDisplaysRef:x,setSessionModel:g,pendingComposerModelRef:v,pendingThinkingLevelRef:k,accessModeRef:y,abortControllerRef:w,setInputValue:N,setSearchParams:Y}=e,D=(0,a.hb)(async(e,t)=>{let n=new Map;try{await Promise.all(t.filter(e=>sL(e.file)).map(async e=>{n.set(e.id,await e.file.text())}))}catch{}let i=t.filter(e=>n.has(e.id)).map(e=>({name:e.file.name,mimeType:e.file.type,content:n.get(e.id),size:e.file.size})),r=await sO(e,i);x.current=[...x.current.slice(-7),{sent:r,display:e}];let a=t.filter(e=>e.file.type.startsWith("image/")&&e.dataBase64).map(e=>({data:e.dataBase64,mimeType:e.file.type}));return{promptText:r,images:a.length?a:void 0}},[]);return{steerOmpAgent:(0,a.hb)(async(e,t)=>{let{promptText:n,images:i}=await D(e,t);await s.sendInterruptAndReply(n,i)||N(e)},[s,D,N]),executeSend:(0,a.hb)(async(e,a,x)=>{let N=x?.model??null,D=N?.accessMode??y.current,A=aD(),F=`msg-${Date.now()}-user`,C=`msg-${Date.now()+1}-ai`,S=new Map;try{await Promise.all(a.filter(e=>sL(e.file)).map(async e=>{S.set(e.id,await e.file.text())}))}catch{}let T=Date.now(),M={id:F,role:"user",date:`Today, ${A}`,startedAt:T,content:e,attachments:a.map(e=>({name:e.file.name,preview:e.dataBase64?`data:${e.file.type};base64,${e.dataBase64}`:e.preview,type:e.file.type,size:e.file.size,content:S.get(e.id)}))},z={id:C,role:"ai",date:`Today, ${A}`,startedAt:T,content:""};if(o(e=>{let t=sC([...e,M,z]);return c(t.filter(e=>e.id!==C)),t}),d(!0),p(sm.n1.thinking),setTimeout(()=>m("smooth"),50),r){h.current=C,f.current=F,N&&(await s.setModel(N.provider,N.modelId),"auto"!==N.thinkingLevel&&await s.setThinkingLevel(N.thinkingLevel));let t=a.filter(e=>e.file.type.startsWith("image/")&&e.dataBase64).map(e=>({data:e.dataBase64,mimeType:e.file.type})),n=a.filter(e=>S.has(e.id)).map(e=>({name:e.file.name,mimeType:e.file.type,content:S.get(e.id),size:e.file.size})),i=await sO(e,n);await s.sendPrompt(i,t.length?t:void 0,{accessMode:D})||(o(e=>e.filter(e=>e.id!==F&&e.id!==C)),h.current=null,f.current=null,d(!1));return}if(!r){let i=t.find(e=>String(e.id)===String(n)),r=i?.project_path||i?.name;if(r){let t=a.filter(e=>e.file.type.startsWith("image/")&&e.dataBase64).map(e=>({data:e.dataBase64,mimeType:e.file.type})),n=a.filter(e=>S.has(e.id)).map(e=>({name:e.file.name,mimeType:e.file.type,content:S.get(e.id),size:e.file.size})),i=await sO(e,n);f.current=F;let l=v.current,o=k.current,c=await s.sendNewPrompt(i,r,t.length?t:void 0,{model:l,thinkingLevel:o,accessMode:y.current});if(c){b.current=c.sessionId,h.current=C,c.model&&g(c.model),v.current=null,k.current=null,fetch(`/api/chat/${encodeURIComponent(c.sessionId)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:[M]})}).catch(e=>console.error("Error persisting spawned user turn:",e)),Y(e=>{let t=new URLSearchParams(e);return t.set("sessionId",c.sessionId),t},{replace:!0});return}}}f.current=null,w.current&&w.current.abort();let P=new AbortController;w.current=P;let L=t.find(e=>String(e.id)===String(n)),j=L?.name||"Workspace";await sT({sessionId:i||`session-${Date.now()}`,prompt:e,workspaceName:j,attachments:a,signal:P.signal},function(e){let{aiPlaceholderId:t,setLocalMessages:n,persistMessages:i,setGenerating:r,setGeneratingVerb:a,abortControllerRef:l,appSettings:s,scrollToBottom:o}=e,c=!1,d=s$(e=>n(e),()=>{c&&(c=!1,o("smooth"))}),p=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t&&(c=!0),d.queue(e)};return{onInit:e=>{p(n=>n.map(n=>n.id===t?{...n,id:e.id,date:e.date}:n))},onThinkingStart:()=>{a(sm.n1.thinking),p(e=>e.map(e=>e.id===t||"ai"===e.role?{...e,thinking:{thought:"",isGenerating:!0}}:e)),setTimeout(()=>o("smooth"),50)},onThinkingChunk:e=>{p(n=>n.map(i=>{if(i.id===t||"ai"===i.role&&n[n.length-1]?.id===i.id){let t="object"==typeof i.thinking&&i.thinking.thought||"";return{...i,thinking:{thought:t+e.delta,isGenerating:!0}}}return i}),!0)},onThinkingEnd:e=>{p(n=>n.map(i=>i.id===t||"ai"===i.role&&n[n.length-1]?.id===i.id?{...i,thinking:{thought:e.thought,summary:e.summary,duration:e.duration,isGenerating:!1}}:i))},onToolStart:e=>{a(sh({name:e.name??e.type,input:e.input,command:e.command,target:e.target,intent:e.intent})),p(n=>n.map(i=>i.id===t||"ai"===i.role&&n[n.length-1]?.id===i.id?{...i,toolCalls:[...i.toolCalls||[],e]}:i)),setTimeout(()=>o("smooth"),50)},onToolOutputChunk:e=>{p(n=>n.map(i=>i.id===t||"ai"===i.role&&n[n.length-1]?.id===i.id?{...i,toolCalls:(i.toolCalls||[]).map(t=>t.id===e.id?{...t,output:(t.output||"")+e.delta}:t)}:i),!0)},onToolEnd:e=>{a(sm.n1.thinking),p(n=>n.map(i=>i.id===t||"ai"===i.role&&n[n.length-1]?.id===i.id?{...i,toolCalls:(i.toolCalls||[]).map(t=>t.id===e.id?{...t,...e}:t)}:i))},onContentChunk:e=>{a(sm.n1.writing),p(n=>n.map(i=>i.id===t||"ai"===i.role&&n[n.length-1]?.id===i.id?{...i,content:(i.content||"")+e.delta}:i),!0)},onSummary:e=>{p(n=>n.map(i=>i.id===t||"ai"===i.role&&n[n.length-1]?.id===i.id?{...i,summary:e.summary}:i))},onDone:e=>{d.flush(),n(n=>{let r=n.map(i=>i.id===t||"ai"===i.role&&n[n.length-1]?.id===i.id?e.message:i);return i(r),r}),r(!1),l.current=null,nB(s),setTimeout(()=>o("smooth"),50)},onError:()=>{r(!1),l.current=null}}}({aiPlaceholderId:C,setLocalMessages:o,persistMessages:c,setGenerating:d,setGeneratingVerb:p,abortControllerRef:w,appSettings:l,scrollToBottom:u}))},[l,t,r,s,n,i,u,m,c,g,v,k,y])}}({folders:t,selectedFolderId:c,sessionId:s,isOmpSession:J,appSettings:n,ompAgent:eb,setLocalMessages:D,persistMessages:ea,setGenerating:R,setGeneratingVerb:P,scrollToBottom:g,jumpToBottom:v,aiPlaceholderIdRef:_,adoptedSessionIdRef:K,optimisticUserIdRef:$,pendingUserDisplaysRef:O,setSessionModel:W,pendingComposerModelRef:Z,pendingThinkingLevelRef:X,composerModelRef:ee,accessModeRef:ei,abortControllerRef:L,setInputValue:y,setSearchParams:r});(0,a.vJ)(()=>{if(!I.current&&!C&&el.length>0){let e=el[0];es(e=>e.slice(1)),ex(e.text,e.attachments,{model:e.model})}},[C,el,ex,es]);let{handleSend:eg,handleEditQueueItem:ev,handleSendNowQueueItem:ek,handleUndo:ey,handleRetry:ew,submitNewChat:eN,stopGenerating:eY,handleThinkingLevelChange:eD,handleModelChange:eA,closeExtensionDialog:eF}=function(e){let{inputValue:t,setInputValue:n,setInputAttachments:i,isGenerating:r,isOmpSession:l,sessionId:s,appSettings:o,messageQueue:c,setMessageQueue:d,executeSend:p,steerOmpAgent:u,ompAgent:m,abortControllerRef:h,setGenerating:b,stopHoldRef:f,persistMessages:x,setLocalMessages:g,pendingComposerModelRef:v,pendingThinkingLevelRef:k,composerModelRef:y,accessModeRef:w,setSearchParams:N,dismissExtensionDialog:Y}=e,D=(0,a.hb)(async(e,i)=>{let a=t.trim();if(a||0!==e.length){if(f.current=!1,r){if(i?.steering){n(""),l?await u(a,e):(h.current&&(h.current.abort(),h.current=null),b(!1),p(a,e));return}if("steering"===(o.omp_chamber_settings?.followUpBehavior??o.followUpBehavior??"queue")&&l){n(""),await u(a,e);return}let t=y.current,r={id:`queue-${Date.now()}`,text:a,attachments:e,model:t?{...t,accessMode:w.current}:null};n(""),d(e=>[...e,r]);return}n(""),p(a,e)}},[t,r,p,d,l,o,u,n,h,b,f,y,w]),A=(0,a.hb)(e=>{d(t=>t.filter(t=>t.id!==e.id)),n(e.text),i(e.attachments)},[d,n,i]),F=(0,a.hb)(async e=>{f.current=!1,d(t=>t.filter(t=>t.id!==e.id)),r?l?u(e.text,e.attachments):(h.current&&(h.current.abort(),h.current=null),b(!1),setTimeout(()=>p(e.text,e.attachments,{model:e.model}),0)):p(e.text,e.attachments,{model:e.model})},[r,p,d,l,u,h,b,f]),C=(0,a.hb)(async(e,t)=>{if(r&&(l?m.abort():h.current&&(h.current.abort(),h.current=null),b(!1)),t&&n(t),l&&s){if(!(await fetch(`/api/chat/${encodeURIComponent(s)}/rewind`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entryId:e})})).ok)return!1;let t=await fetch(`/api/chat/${encodeURIComponent(s)}`).then(e=>e.json()).catch(()=>null),n=t?.session?.messages??[];return n.length>0&&g(sC(n)),!0}return g(t=>{let n=t.findIndex(t=>t.id===e),i=-1!==n?t.slice(0,n):t;return x(i),i}),!0},[r,l,s,x,h,b,n,g]),S=(0,a.hb)(e=>{r&&(l?m.abort():h.current&&(h.current.abort(),h.current=null),b(!1)),g(t=>{let n=t.findIndex(t=>t.id===e);if(n>0&&"user"===t[n-1].role){let e=t[n-1];setTimeout(()=>{let t=Array.isArray(e.attachments)?e.attachments:[];p(e.content,t)},0);let i=t.slice(0,n-1);return x(i),i}return t})},[r,p,x,l,m,h,b,g]),T=(0,a.hb)((e,t)=>{let n=`new-${Date.now()}`;N(e=>{let t=new URLSearchParams(e);return t.set("sessionId",n),t},{replace:!0}),g([]),setTimeout(()=>{p(e,t)},0)},[N,p,g]),M=(0,a.hb)(()=>(f.current=!0,l?m.abort():h.current&&(h.current.abort(),h.current=null),b(!1),c.length),[l,m,h,b,c.length,f]),z=(0,a.hb)(e=>{if("auto"!==e){if(!l){k.current=e;return}m.setThinkingLevel(e)}},[l,m,k]);return{handleSend:D,handleEditQueueItem:A,handleSendNowQueueItem:F,handleUndo:C,handleRetry:S,submitNewChat:T,stopGenerating:M,handleThinkingLevelChange:z,handleModelChange:(0,a.hb)((e,t)=>{if(!l){v.current={provider:e,modelId:t};return}m.setModel(e,t)},[l,m,v]),closeExtensionDialog:(0,a.hb)(()=>{Y()},[Y])}}({inputValue:k,setInputValue:y,setInputAttachments:N,isGenerating:C,isOmpSession:J,sessionId:s,appSettings:n,messageQueue:el,setMessageQueue:es,executeSend:ex,steerOmpAgent:ef,ompAgent:eb,abortControllerRef:L,setGenerating:R,stopHoldRef:I,persistMessages:ea,setLocalMessages:D,pendingComposerModelRef:Z,pendingThinkingLevelRef:X,composerModelRef:ee,accessModeRef:ei,setSearchParams:r,dismissExtensionDialog:em});return{sessionId:s,folderId:o,isOmpSession:J,selectedFolderId:c,setSelectedFolderId:p,sessionData:U,localMessages:Y,isGenerating:C,hasMore:H,loadingOlder:q,loadOlderError:G,sessionLoading:V,loadOlder:Q,generatingVerb:z,messageQueue:el,setMessageQueue:es,steeringQueue:eo,setSteeringQueue:ec,inputValue:k,setInputValue:y,inputAttachments:w,setInputAttachments:N,scrollRef:m,contentRef:h,showScrollBottom:b,isScrolling:f,handleScroll:x,scrollToBottom:g,jumpToBottom:v,handleSend:eg,handleEditQueueItem:ev,handleSendNowQueueItem:ek,handleUndo:ey,handleRetry:ew,submitNewChat:eN,stopGenerating:eY,handleThinkingLevelChange:eD,handleModelChange:eA,accessMode:et,handleAccessModeChange:er,composerModelRef:ee,extensionDialog:ep,closeExtensionDialog:eF,respondToExtensionUi:eb.respondToExtensionUi}}({folders:d,appSettings:s}),{toasts:ee,pushToast:et,dismissToast:en}=(0,e0.Y)(),[ei,er]=(0,a.J0)(null),{pendingUndo:ea,undoing:el,requestUndo:es,closeUndoConfirm:eo,confirmUndo:ec}=function(e){let[t,n]=(0,a.J0)(null),[i,r]=(0,a.J0)(!1),l=(0,a.hb)((e,t)=>{n({id:e,content:t??""})},[]),s=(0,a.hb)(()=>n(null),[]),o=(0,a.hb)(async()=>{!t||i||(r(!0),await e(t.id,t.content)&&n(null),r(!1))},[e,t,i]);return{pendingUndo:t,undoing:i,requestUndo:l,closeUndoConfirm:s,confirmUndo:o}}(_),[ed,ep]=(0,l.o)(),eu=(0,a.hb)(()=>{let e=B();0!==e&&et(`Stopped. ${e} message${e>1?"s":""} still queued — nothing was sent.`,"success",{action:{label:"Send now",onClick:()=>{let e=Y[0];e&&J(e)}},duration:8e3})},[B,et,Y,J]),{activeSubagent:em,back:eh}=function(e,t,n){let[i,r]=(0,a.J0)(null);return(0,a.vJ)(()=>{let e=e=>{let t=e.detail,i=t?.subagent,a=t?.sessionId;i&&a&&(r(i),n(e=>(e.get("sessionId")===a&&e.get("subagent")===i.id||(e.set("sessionId",a),e.set("subagent",i.id)),e),{replace:!1}))};return window.addEventListener("omp:view-subagent",e),()=>window.removeEventListener("omp:view-subagent",e)},[n]),(0,a.vJ)(()=>{if(!t)return void r(null);if(i?.id===t||!e)return;let n=!1;return fetch(`/api/sessions/${encodeURIComponent(e)}/subagents`).then(e=>e.ok?e.json():null).then(e=>{if(n||!e?.subagents)return;let i=e.subagents.find(e=>(0,ig.u)(e)&&e.id===t);i&&r(iy(i))}).catch(()=>{}),()=>{n=!0}},[e,t]),{activeSubagent:i,back:(0,a.hb)(()=>{r(null),n(e=>(e.has("subagent")&&e.delete("subagent"),e),{replace:!0})},[n])}}(u,ed.get("subagent"),ep);!function(e,t,n){let[i,r]=(0,a.J0)(null);(0,a.vJ)(()=>{r(null)},[e]),(0,a.vJ)(()=>{let t=t=>{let n=t.detail;n?.sessionId&&n.title&&String(n.sessionId)===String(e)&&r(n.title)};return window.addEventListener("omp:session-renamed",t),()=>window.removeEventListener("omp:session-renamed",t)},[e]),(0,a.vJ)(()=>{let r=e?.startsWith(iQ)?i0(e):null;n?.(r??i??t??null)},[e,t,i,n])}(u,b?.title,o);let eb=(0,a.hb)(e=>{let t=document.getElementById(e);t&&t.scrollIntoView({behavior:"smooth",block:"center"})},[]),ef=(0,a.hb)(e=>er(e),[]),ex=sn(si)??{},eg=sn(sq)??{},ev=(0,a.Kr)(()=>f.filter(e=>"user"===e.role),[f]),ek="object"==typeof b?.model?b.model.provider:void 0,ey="object"==typeof b?.model?ex[b.model.modelId]??b.model.modelId:b?.model,ew=(0,a.Kr)(()=>sC(f),[f]),eN=!!u?.startsWith("new-"),eY=(t=i3(d,u).folder,n=null!=m?d.find(e=>String(e.id)===String(m))??null:null,(t??n)?.project_path??null),eD=!eN&&y&&0===ew.length;return!u||eN?(0,i.Y)(lO,{className:r,folders:d,selectedFolderId:m,setSelectedFolderId:h,rootPath:eY,inputValue:S,setInputValue:T,inputAttachments:M,setInputAttachments:z,onSend:$,isGenerating:x,appSettings:s,localMessages:f,provider:ek,providerNames:eg,modelName:ey,modelNames:ex,onThinkingLevelChange:W,onModelChange:H,accessMode:q,onAccessModeChange:G,composerModelRef:V,sessionModel:"object"==typeof b?.model?b.model:null,sessionThinkingLevel:b?.thinkingLevel,generatingVerb:N,variant:c}):(0,i.FD)("div",{className:`flex flex-col h-full min-h-0 overflow-hidden bg-canvas relative ${r}`,children:[eD?(0,i.Y)(lU,{}):(0,i.FD)(i.FK,{children:[(0,i.Y)("div",{className:"relative flex-1 min-h-0 flex flex-col",children:em?(0,i.Y)(sa,{sessionId:u,subagent:em,onBack:eh,provider:ek,providerNames:eg}):(0,i.Y)(sc,{isMobile:p,userMessages:ev,onScrollTo:eb,scrollRef:P,contentRef:L,handleScroll:I,isScrolling:R,loadingOlder:v,hasMore:g,loadOlderError:k,loadOlder:w,messages:ew,isGenerating:x,provider:ek,providerNames:eg,modelName:ey,modelNames:ex,thinkingLevel:b?.thinkingLevel,onUndo:es,onRetry:U,onNewChat:ef,showScrollBottom:j,jumpToBottom:E})}),!em&&(0,i.Y)(su,{isMobile:p,isGenerating:x,modelName:ey,generatingVerb:N,provider:ek,providerNames:eg,messageQueue:Y,setMessageQueue:D,onEditQueueItem:O,onSendNowQueueItem:J,steeringQueue:F,setSteeringQueue:C,inputValue:S,setInputValue:T,rootPath:eY,attachments:M,setAttachments:z,onSend:$,onStop:eu,appSettings:s,onThinkingLevelChange:W,onModelChange:H,accessMode:q,onAccessModeChange:G,composerModelRef:V,sessionModel:"object"==typeof b?.model?b.model:null,sessionThinkingLevel:b?.thinkingLevel,variant:c})]}),ea&&(0,i.Y)(lB,{isOmpSession:!!u&&!u.startsWith("new-")&&Number.isNaN(Number(u)),content:ea.content,undoing:el,onClose:eo,onConfirm:ec}),null!==ei&&(0,i.Y)(lW,{initialContent:ei,onClose:()=>er(null),onSend:K,appSettings:s,accessMode:q,onAccessModeChange:G,composerModelRef:V}),Q&&(0,i.Y)(rr,{request:Q,onRespond:(e,t)=>{X(e,t),Z()}}),(0,i.Y)(eU.y,{toasts:ee,onDismiss:en})]})}let sV=(0,s.RZ)(()=>n.e("ar").then(n.bind(n,"Ek")).then(e=>({default:e.FileExplorer}))),sQ=(0,s.RZ)(()=>n.e("1k").then(n.bind(n,"X8")).then(e=>({default:e.SearchPanel}))),sZ=(0,s.RZ)(()=>n.e("m").then(n.bind(n,"AB")).then(e=>({default:e.GitPanel}))),sX=(0,s.RZ)(()=>n.e("fw").then(n.bind(n,"RF")).then(e=>({default:e.TerminalPanel}))),s0=(0,s.RZ)(()=>n.e(51).then(n.bind(n,"zO")).then(e=>({default:e.ContextPanel}))),s1=(0,s.RZ)(()=>Promise.all([n.e("3j"),n.e("s")]).then(n.bind(n,"a6")).then(e=>({default:e.BrowserPanel}))),s2=(0,s.RZ)(()=>Promise.all([n.e("3j"),n.e("rd")]).then(n.bind(n,"NU")).then(e=>({default:e.UserBrowserPanel}))),s5=(0,s.RZ)(()=>n.e("bi").then(n.bind(n,"Rc")).then(e=>({default:e.UsagePanel}))),s3=new WeakMap;var s4=n("Asb"),s6=n("so");function s8(e){let{activePanel:t,onChangePanel:n,isPanelOpen:r,hasActiveContext:a,activeProjectPath:l,refreshKey:s}=e,{changes:o}=(0,s6.e)(l??void 0,".",s,a,15e3),c=o.length>0,d=e=>`relative w-full h-10 flex items-center justify-center transition-colors border-l-2 ${r&&t===e?"text-ink border-ink bg-ink/5":"text-ink/40 border-transparent hover:text-ink hover:bg-ink/5"}`;return(0,i.FD)("nav",{className:"w-12 flex-shrink-0 border-l border-ink/10 bg-paper flex flex-col items-center py-3 space-y-2 z-10",children:[(0,i.FD)("div",{className:"flex flex-col items-center space-y-1 w-full",children:[(0,i.Y)("button",{className:d("context"),onClick:()=>n("context"),title:"Context & Telemetry",children:(0,i.Y)(tc.A,{size:16})}),(0,i.Y)("button",{className:d("files"),onClick:()=>n("files"),title:"Files",children:(0,i.Y)(s4.A,{size:16})}),(0,i.Y)("button",{className:d("search"),onClick:()=>n("search"),title:"Search",children:(0,i.Y)(_.A,{size:16})}),(0,i.FD)("button",{className:d("git"),onClick:()=>n("git"),title:"Source Control",children:[(0,i.Y)(nu.A,{size:16}),c&&(0,i.Y)("span",{className:"absolute top-1.5 right-1.5 w-1.5 h-1.5 rounded-full bg-info",title:"Ada perubahan git"})]}),(0,i.Y)("button",{className:d("terminal"),onClick:()=>n("terminal"),title:"Terminal (Bun)",children:(0,i.Y)(w.A,{size:16})}),(0,i.Y)("button",{className:d("user-browser"),onClick:()=>n("user-browser"),title:"Browser (Anda)",children:(0,i.Y)(em.A,{size:16})}),(0,i.Y)("button",{className:d("browser"),onClick:()=>n("browser"),title:"Browser Agent",children:(0,i.Y)(I.A,{size:16})}),(0,i.Y)("button",{className:d("usage"),onClick:()=>n("usage"),title:"Usage",children:(0,i.Y)(z.A,{size:16})})]}),(0,i.Y)("div",{className:"flex-1"})]})}function s7(){return(0,i.Y)(m,{className:"relative w-1 outline-none group flex justify-center cursor-col-resize z-10",children:(0,i.Y)("div",{className:"h-full w-[1px] bg-ink/10 group-hover:bg-ink/40 group-active:bg-ink/60 group-hover:w-0.5 transition-all"})})}let s9=["files","search","git","terminal","context","user-browser","browser","usage"],oe={files:268,search:268,git:268,terminal:536,context:536,"user-browser":804,browser:804,usage:536},ot={files:200,search:200,git:260,terminal:200,context:420,"user-browser":320,browser:320,usage:420},on={left:268,chat:540,editor:536,diff:536};function oi(e){return"number"==typeof e&&Number.isFinite(e)&&e>0?Math.round(e):void 0}let or=(0,s.RZ)(()=>n.e("q").then(n.bind(n,"o3")).then(e=>({default:e.Editor})));function oa(e){let{children:t}=e;return(0,i.Y)(s.tY,{fallback:(0,i.Y)("div",{className:"w-full h-full flex items-center justify-center text-ink/40 text-xs",children:"Loading…"}),children:t})}function ol(e){let{appSettings:t,showEditor:n,editorPanelRef:r,showRightPanel:l,activeRightPanel:s,rightPanelRef:o,panelWidths:c,editorWidthMode:d,hasActiveContext:m,activeProjectPath:h,openedFiles:b,activeFileId:f,refreshKey:x,onSetActiveFileId:g,onCloseFile:v,onOpenFile:k,onRefreshWorkspace:y,onChangeRightPanel:w,onToggleRightPanel:N,onSessionTitle:Y,onPanelWidths:D}=e;(0,a.li)(c).current=c;let A=(0,a.Kr)(()=>({}),[]),F=(0,a.Kr)(()=>["files","search","git","terminal","context","user-browser","browser","usage"].map(e=>({view:e,Comp:function(e,t){let n=s3.get(e);if(n||(n={},s3.set(e,n)),!n[t]){let e="files"===t?sV:"search"===t?sQ:"git"===t?sZ:"terminal"===t?sX:"context"===t?s0:"user-browser"===t?s2:"browser"===t?s1:s5,r=t=>{let{className:n,...r}=t;return(0,i.Y)("div",{className:`w-full h-full ${"string"==typeof n?n:""}`,children:(0,i.Y)(e,{...r,className:"w-full h-full"})})};r.displayName=`CachedView(${t})`,n[t]=r}return n[t]}(A,e)})),[A]);return(0,i.FD)("div",{className:"flex flex-1 overflow-hidden",children:[(0,i.FD)(p,{orientation:"horizontal",id:"ompchamber-layout",onLayoutChanged:()=>{let e,t,n;D((e={},t=r.current?.getSize()?.inPixels,n=o.current?.getSize()?.inPixels,null!=t&&t>0&&(e[d]=Math.round(t)),null!=n&&n>0&&(e.right={[s]:Math.round(n)}),e))},children:[(0,i.Y)(u,{id:"center-panel",filler:!0,minSize:"540px",children:(0,i.Y)(sG,{className:"w-full h-full",appSettings:t,onSessionTitle:Y})}),n&&(0,i.FD)(i.FK,{children:[(0,i.Y)(s7,{}),(0,i.Y)(u,{panelRef:r,id:"editor-panel",defaultSize:c[d]??on[d],minSize:300,children:(0,i.Y)(oa,{children:(0,i.Y)(or,{className:"w-full h-full",openedFiles:b,activeFileId:f,onSelectFile:g,onCloseFile:v,refreshKey:x,onFileSaved:y})})})]}),l&&(0,i.FD)(i.FK,{children:[(0,i.Y)(s7,{}),(0,i.Y)(u,{panelRef:o,id:"right-panel",defaultSize:c.right?.[s]??oe[s],minSize:ot[s],maxSize:1200,collapsible:!0,children:(0,i.Y)(oa,{children:F.map(e=>{let{view:t,Comp:n}=e,r=s===t;return(0,i.Y)("div",{className:r?"w-full h-full":"hidden",children:(0,i.Y)(n,{className:"w-full h-full",enabled:"terminal"===t?m:m&&r,active:r,refreshKey:x,rootPath:h??void 0,onRefresh:y,onOpenFile:k,onClose:N})},t)})})})]})]}),(0,i.Y)(s8,{activePanel:s,onChangePanel:w,isPanelOpen:l,hasActiveContext:m,activeProjectPath:h,refreshKey:x})]})}function os(){let[e,t]=(0,a.J0)(sY);return(0,a.vJ)(()=>{let e=e=>{let n=e.detail;n&&t({transport:n.transport,connected:n.connected})};return window.addEventListener(sw,e),t(sY()),()=>window.removeEventListener(sw,e)},[]),e}function oo(e,t){null!=t&&e.current?.resize(t)}function oc(e){let{sessionId:t,onSwitchToMobile:n,appSettings:r={}}=e,{folders:s}=ni(),[o,c]=(0,i4.bL)("layout.showRightPanel",r.showRightPanel??!0),[d,m]=(0,i4.bL)("layout.activeRightPanel",r.activeRightPanel??"files"),[h,b]=(0,a.J0)(r.showLeftPanel??!0),{widths:f,widthsRef:x,commitWidths:g}=function(e,t){let[n,i]=(0,a.J0)(()=>(function(e,t){if(!e||"object"!=typeof e)return{};let n={};for(let t of["left","chat","editor","diff"]){let i=oi(e[t]);void 0!==i&&(n[t]=i)}let i={};if(e.right&&"object"==typeof e.right)for(let[t,n]of Object.entries(e.right)){if(!("string"==typeof t&&s9.includes(t)))continue;let e=oi(n);void 0!==e&&(i[t]=e)}else{let n=oi(e.right);void 0!==n&&(i[t]=n)}return Object.keys(i).length>0&&(n.right=i),n})(e.desktopLayoutSizes,t)),r=(0,a.li)(n),l=(0,a.li)(void 0),s=(0,a.hb)(()=>{clearTimeout(l.current),l.current=void 0,(0,A.cz)("desktopLayoutSizes",r.current)},[]),o=(0,a.hb)(e=>{var t;let n,a=(t=r.current,n={...t,...e},e.right&&(n.right={...t.right,...e.right}),n);r.current=a,i(a),clearTimeout(l.current),l.current=window.setTimeout(s,500)},[s]);return(0,a.vJ)(()=>()=>{void 0!==l.current&&s()},[s]),{widths:n,widthsRef:r,commitWidths:o}}(r,d),v=(0,a.li)(null),k=(0,a.li)(null),y=(0,a.li)(null),[w,N]=(0,a.J0)(r.userToggledEditor??null),[Y]=(0,l.o)(),D=Y.get("folderId"),F=(0,a.Kr)(()=>{let e=i3(s,t||"").folder;return e||(D?s.find(e=>String(e.id)===String(D))??null:null)},[s,t,D]),S=F?.project_path??null,T=!!F,{openedFiles:M,activeFileId:z,setActiveFileId:P,handleOpenFile:L,handleCloseFile:j}=function(e,t,n){let[i,r]=(0,i4.bL)("layout.openedFiles",[]),[l,s]=(0,i4.bL)("layout.activeFileId",null),o=(0,a.li)(void 0),{ready:c}=(0,i6.O)(),d=(0,a.li)(void 0);(0,a.vJ)(()=>{o.current===e||(o.current=e,c&&d.current!==e&&(d.current=e,r([]),s(null)))},[e,t,c,r,s]);let p=(0,a.hb)(t=>{let i={...t,root:t.root??e??void 0};r(e=>{let t=e.find(e=>e.id===i.id||!e.isDiff&&e.path&&i.path&&e.path===i.path);return t?(s(t.id),e):[...e,i]}),s(i.id),n?.()},[e,n,r,s]),u=(0,a.hb)(t=>{let i=t.file.replace(/^\/+/,""),a=i.split("/").pop()||i,l=!!t.staged,o=`diff-${l?"staged":"working"}-${i}`,c={id:o,name:`${a} (Diff)`,path:i,isDiff:!0,diffStatus:t.status||"M",diffStaged:l,repo:t.repo||".",root:t.root??e??void 0};r(e=>{let t=e.find(e=>e.id===o||e.isDiff&&e.path===i&&e.diffStaged===l);return t?(s(t.id),e):[...e,c]}),s(o),n?.()},[e,n,r,s]),m=(0,a.hb)(e=>{r(t=>{let n=t.filter(t=>t.id!==e);return l===e&&s(n.length>0?n[n.length-1].id:null),n})},[l,r,s]);return(0,C.sY)("omp:open-file",e=>{if(!e.detail||!e.detail.path)return;let t=e.detail.path.replace(/^\/+/,""),n=e.detail.name||t.split("/").pop()||"file",i=0;for(let e=0;e<t.length;e++)i=(i<<5)-i+t.charCodeAt(e)|0;p({id:e.detail.id||Math.abs(i)||Date.now(),name:n,path:t,content:e.detail.content})}),(0,C.sY)("omp:open-diff",e=>{e.detail&&e.detail.file&&u(e.detail)}),{openedFiles:i,activeFileId:l,setActiveFileId:s,handleOpenFile:p,handleOpenDiff:u,handleCloseFile:m}}(S,t||"",(0,a.hb)(()=>{N(!0),E("userToggledEditor",!0)},[])),R=M.length>0&&(w??!0),I=(0,a.Kr)(()=>M.find(e=>String(e.id)===String(z))?.isDiff?"diff":"editor",[M,z]),E=(e,t)=>{(0,A.cz)(e,t)};(0,a.vJ)(()=>{let e=requestAnimationFrame(()=>{let e=x.current;e&&oo(y,e.left)});return()=>cancelAnimationFrame(e)},[h,x]),(0,a.vJ)(()=>{let e=requestAnimationFrame(()=>{oo(k,x.current?.right?.[d])});return()=>cancelAnimationFrame(e)},[o,d,x]),(0,a.vJ)(()=>{let e=requestAnimationFrame(()=>{oo(v,x.current?.[I])});return()=>cancelAnimationFrame(e)},[R,I,x]);let[$,O]=(0,a.J0)(!1),[J,_]=(0,a.J0)("appearance"),[U,K]=(0,a.J0)(!1),[B,W]=(0,a.J0)(0),[H,q]=(0,a.J0)(null),G=os();(0,C.MN)("keydown",e=>{(e.metaKey||e.ctrlKey)&&","===e.key&&(e.preventDefault(),_("appearance"),K(!1),O(e=>!e))}),(0,C.sY)("omp:open-settings",e=>{e.detail?.category?_(e.detail.category):_("appearance"),K(!!e.detail?.autoOpenAdd),O(!0)});let V=e=>{b(e),E("showLeftPanel",e)},Q=()=>{let e=!o;c(e),E("showRightPanel",e)};return(0,i.FD)("div",{className:"flex flex-col h-screen w-screen overflow-hidden bg-canvas text-ink font-sans selection:bg-ink selection:text-canvas",children:[(0,i.FD)("div",{className:"flex flex-1 overflow-hidden",children:[!h&&(0,i.FD)("div",{className:"w-12 h-full bg-paper border-r border-ink/10 flex flex-col items-center py-3 flex-shrink-0 cursor-pointer hover:bg-ink/5 transition-colors titlebar-no-drag",style:{paddingTop:"max(0.75rem, env(titlebar-area-height, 0px))"},onClick:()=>V(!0),title:"Expand Sidebar",children:[(0,i.Y)(i5.A,{size:16,className:"text-ink/60"}),(0,i.Y)("div",{className:"w-[1px] flex-1 bg-ink/10 my-4"})]}),(0,i.FD)(p,{orientation:"horizontal",id:"ompchamber-main",onLayoutChanged:()=>{let e=y.current?.getSize()?.inPixels;null!=e&&e>0&&g({left:Math.round(e)})},children:[h&&(0,i.FD)(i.FK,{children:[(0,i.Y)(u,{panelRef:y,id:"left-panel",defaultSize:f.left??on.left,minSize:200,maxSize:600,collapsible:!0,children:(0,i.Y)(i2,{className:"w-full h-full",onClose:()=>V(!1),appSettings:r})}),(0,i.Y)(s7,{})]}),(0,i.Y)(u,{id:"main-right-stack",filler:!0,minSize:0,children:(0,i.FD)("div",{className:"flex flex-col h-full",children:[(0,i.Y)(rn,{sessionTitle:H,showLeftPanel:h,showEditor:R,showRightPanel:o,streamStatus:G,onSwitchToMobile:n,onToggleEditor:()=>{let e=!R;N(e),E("userToggledEditor",e)},onToggleRightPanel:Q}),(0,i.Y)(ol,{appSettings:r,showEditor:R,editorPanelRef:v,showRightPanel:o,activeRightPanel:d,rightPanelRef:k,panelWidths:f,editorWidthMode:I,hasActiveContext:T,activeProjectPath:S,openedFiles:M,activeFileId:z,refreshKey:B,onSetActiveFileId:P,onCloseFile:j,onOpenFile:L,onRefreshWorkspace:()=>W(e=>e+1),onChangeRightPanel:e=>{let t=o,n=d;d===e&&o?t=!1:(n=e,t=!0),c(t),m(n),(0,A.cz)("showRightPanel",t),(0,A.cz)("activeRightPanel",n)},onToggleRightPanel:Q,onSessionTitle:q,onPanelWidths:g})]})})]})]}),(0,i.Y)(nq,{isOpen:$,onClose:()=>{O(!1),K(!1)},initialCategory:J,autoOpenAddProvider:U,appSettings:r})]})}var od=n("xk"),op=n("SS");function ou(e){let{activeSessionTitle:t,activeSessionId:n,onOpenSessionSidebar:r,onOpenRightSidebar:l,onNewSession:s,onSelectSession:o}=e,{folders:c}=ni(),d=os(),[p,u]=(0,a.J0)(!1),[m,h]=(0,a.J0)(!1),[b,f]=(0,a.J0)(null),x=(0,a.li)(null);(0,eM.W)(x,()=>u(!1));let v=(0,a.li)(null);(0,eM.W)(v,()=>h(!1)),(0,a.vJ)(()=>{if(!n)return void f(null);let e=!1;return fetch(`/api/telemetry/context?sessionId=${encodeURIComponent(String(n))}`).then(e=>e.ok?e.json():null).then(t=>{e||f(t?.telemetry??null)}).catch(()=>{e||f(null)}),()=>{e=!0}},[n]);let k=(0,a.Kr)(()=>{let e=Date.now(),t=[];for(let n of c)for(let i of n.sessions??[]){if(1===i.is_archived)continue;let r=(0,op.R7)(String(i.id)),a=i.updated_at?Date.parse(i.updated_at):0,l=void 0!==r&&e-r<=6e5?r:a;void 0!==r&&e-r>6e5||t.push({id:i.id,title:i.title,folderName:n.name,modified:l})}return t.sort((e,t)=>t.modified-e.modified).slice(0,10)},[c]),y=t?t.charAt(0).toUpperCase()+t.slice(1):"New session";return(0,i.FD)("header",{className:"flex-shrink-0 bg-canvas border-b border-ink/10 flex items-center justify-between px-3 z-20 titlebar-drag-region select-none",style:{height:"calc(3.5rem + env(safe-area-inset-top, 0px))",paddingLeft:"max(0.75rem, env(safe-area-inset-left, 0px), env(titlebar-area-x, 0px))",paddingRight:"max(0.75rem, env(safe-area-inset-right, 0px), calc(100vw - env(titlebar-area-width, 100vw)))",paddingTop:"env(safe-area-inset-top, 0px)"},children:[(0,i.FD)("div",{className:"flex items-center space-x-2 min-w-0 titlebar-no-drag",children:[(0,i.Y)("button",{type:"button",onClick:r,className:"p-1.5 rounded-lg hover:bg-ink/5 active:bg-ink/10 text-ink transition-colors flex-shrink-0",title:"Open Sessions","aria-label":"Open Sessions",children:(0,i.Y)(od.A,{size:20,strokeWidth:2})}),(0,i.FD)("span",{className:"relative font-bold text-sm tracking-tight flex items-center flex-shrink-0",children:[(0,i.Y)("span",{className:"text-transparent bg-clip-text bg-gradient-to-r from-orange-600 to-amber-500 font-extrabold text-[15px] tracking-tighter",children:"OMP"}),(0,i.Y)("span",{className:"ml-[1px] text-ink",children:"Chamber"}),(0,i.Y)("span",{className:"absolute -top-0.5 -right-1.5 flex",children:(0,i.Y)(rt,{status:d})})]}),(0,i.Y)("span",{className:"text-ink/25 font-light text-xs flex-shrink-0 select-none",children:"/"}),(0,i.FD)("div",{className:"relative min-w-0",ref:x,children:[(0,i.FD)("button",{type:"button",onClick:()=>u(!p),className:"flex items-center space-x-1 text-xs font-semibold text-ink hover:text-ink/80 transition-colors py-1 max-w-[150px] min-w-0",title:y,children:[(0,i.Y)("span",{className:"truncate",children:y}),(0,i.Y)(eT.A,{size:13,className:"text-ink/50 flex-shrink-0"})]}),p&&(0,i.FD)("div",{className:"absolute top-full left-0 mt-1.5 w-72 max-w-[calc(100vw-1.5rem)] bg-paper border border-ink/15 rounded-xl shadow-lg z-50 p-2 text-xs",children:[(0,i.FD)("button",{type:"button",onClick:()=>{s(),u(!1)},className:"w-full text-left px-3 py-2 rounded-lg bg-ink text-canvas flex items-center space-x-2 font-medium mb-1.5 active:scale-98",children:[(0,i.Y)(g.A,{size:14}),(0,i.Y)("span",{children:"Start New Session"})]}),(0,i.Y)("div",{className:"px-2 py-1 text-[10px] uppercase font-bold text-ink/40",children:"Recent Sessions"}),(0,i.Y)("div",{className:"max-h-64 scrollbar-overlay-container scrollbar-overlay-static space-y-0.5",children:0===k.length?(0,i.Y)("div",{className:"px-2.5 py-2 text-ink/40 italic",children:"No sessions yet"}):k.map(e=>(0,i.FD)("button",{type:"button",onClick:()=>{o(e.id),u(!1)},className:`w-full text-left px-2.5 py-1.5 rounded-lg flex items-center justify-between space-x-2 transition-colors ${String(n)===String(e.id)?"bg-ink/10 font-semibold text-ink":"hover:bg-ink/5 text-ink/80"}`,children:[(0,i.FD)("span",{className:"min-w-0 flex flex-col",children:[(0,i.Y)("span",{className:"truncate",children:e.title?e.title.charAt(0).toUpperCase()+e.title.slice(1):"Untitled"}),(0,i.Y)("span",{className:"truncate text-[10px] text-ink/40 font-mono",children:e.folderName})]}),String(n)===String(e.id)&&(0,i.Y)(D.A,{size:12,className:"flex-shrink-0"})]},e.id))})]})]})]}),(0,i.FD)("div",{className:"flex items-center space-x-1 text-ink",children:[(0,i.FD)("div",{className:"relative flex items-center",ref:v,children:[(0,i.Y)("button",{type:"button",onClick:()=>h(!m),className:"w-8 h-8 rounded-lg hover:bg-ink/5 active:bg-ink/10 flex items-center justify-center text-ink transition-colors cursor-pointer",title:"Context usage","aria-label":"Context usage",children:(0,i.Y)("span",{className:"w-4 h-4 rounded-full border-[1.5px] border-ink/60 hover:border-ink transition-colors"})}),m&&(0,i.FD)("div",{className:"absolute top-full right-0 mt-2 w-56 bg-paper border border-ink/20 rounded-xl shadow-xl z-50 p-3 text-xs font-mono",children:[(0,i.FD)("div",{className:"font-semibold text-ink font-sans pb-1.5 border-b border-ink/10 flex items-center justify-between",children:[(0,i.Y)("span",{children:"Context"}),b&&b.messagesCount>0&&(0,i.Y)("span",{className:"w-1.5 h-1.5 rounded-full bg-success"})]}),b&&0!==b.messagesCount?(0,i.FD)("div",{className:"pt-2 space-y-1.5 text-[11px] text-ink/80",children:[(0,i.FD)("div",{className:"flex justify-between gap-2",children:[(0,i.Y)("span",{className:"text-ink/50",children:"Model:"}),(0,i.Y)("span",{className:"truncate",children:b.modelName||"—"})]}),(0,i.FD)("div",{className:"flex justify-between",children:[(0,i.Y)("span",{className:"text-ink/50",children:"Context:"}),(0,i.FD)("span",{children:[tr(b.contextUsed)??"0"," / ",tr(b.contextLimit)??"0"," (",b.contextPercent,"%)"]})]}),(0,i.FD)("div",{className:"flex justify-between",children:[(0,i.Y)("span",{className:"text-ink/50",children:"Messages:"}),(0,i.Y)("span",{children:b.messagesCount})]}),(0,i.FD)("div",{className:"flex justify-between",children:[(0,i.Y)("span",{className:"text-ink/50",children:"Cost:"}),(0,i.Y)("span",{children:b.costFormatted})]}),"number"==typeof b.cacheHitAverage&&(0,i.FD)("div",{className:"flex justify-between",children:[(0,i.Y)("span",{className:"text-ink/50",children:"Cache hit:"}),(0,i.FD)("span",{children:[b.cacheHitAverage.toFixed(1),"%"]})]})]}):(0,i.Y)("div",{className:"pt-2 text-[11px] text-ink/50 italic font-sans",children:"Session not started"})]})]}),(0,i.Y)("button",{type:"button",onClick:l,className:"w-8 h-8 rounded-lg hover:bg-ink/5 active:bg-ink/10 flex items-center justify-center text-ink transition-colors cursor-pointer",title:"Right Panel","aria-label":"Open Right Panel",children:(0,i.Y)(i9.A,{size:18,strokeWidth:1.8})})]})]})}function om(e){let{activeSessionId:t,onSelectSession:n,onNewSession:r,onOpenSessionSidebar:l,onOpenRightSidebar:s,appSettings:o={}}=e,{folders:c}=ni(),[d,p]=(0,a.J0)(null),u=(0,a.Kr)(()=>{if(!t)return"New session";for(let e of c){let n=e.sessions?.find(e=>String(e.id)===String(t));if(n)return n.title}return null},[t,c]);return(0,i.FD)("div",{className:"flex flex-col h-full w-full bg-canvas text-ink relative",children:[(0,i.Y)(ou,{activeSessionTitle:d||u||"New session",activeSessionId:t,onOpenSessionSidebar:l,onOpenRightSidebar:s,onNewSession:r,onSelectSession:n}),(0,i.Y)("div",{className:"flex-1 min-h-0",children:(0,i.Y)(sG,{appSettings:o,onSessionTitle:p,variant:"mobile"})})]})}function oh(e){let{onClose:t}=e;return(0,i.FD)("div",{className:"border-b border-ink/10 flex items-center justify-between px-3.5 flex-shrink-0 bg-canvas titlebar-drag-region select-none",style:{height:"calc(3.5rem + env(safe-area-inset-top, 0px))",paddingLeft:"max(0.875rem, env(safe-area-inset-left, 0px), env(titlebar-area-x, 0px))",paddingRight:"max(0.875rem, env(safe-area-inset-right, 0px))",paddingTop:"env(safe-area-inset-top, 0px)"},children:[(0,i.FD)("div",{className:"flex items-center space-x-2.5 titlebar-no-drag",children:[(0,i.FD)("span",{className:"font-bold text-sm tracking-tight flex items-center",children:[(0,i.Y)("span",{className:"text-transparent bg-clip-text bg-gradient-to-r from-orange-600 to-amber-500 font-extrabold text-[16px] tracking-tighter",children:"OMP"}),(0,i.Y)("span",{className:"ml-[1px] text-ink font-bold text-sm",children:"Chamber"})]}),(0,i.Y)("span",{className:"text-ink/25 text-xs select-none",children:"/"}),(0,i.Y)("span",{className:"text-[11px] font-semibold text-ink/60 uppercase tracking-wider font-mono",children:"Sessions"})]}),(0,i.Y)("button",{type:"button",onClick:t,className:"w-9 h-9 rounded-xl hover:bg-ink/5 active:bg-ink/10 text-ink flex items-center justify-center transition-colors cursor-pointer titlebar-no-drag",title:"Close sidebar","aria-label":"Close sidebar",children:(0,i.Y)(h.A,{size:19,strokeWidth:2})})]})}var ob=n("mO");function of(e){let{searchQuery:t,sortOption:n,optionsOpen:r,showArchived:a,optionsRef:l,onNewSession:s,onNewWorkspace:o,onScheduler:c,onToggleOptions:d,onSortChange:p,onResetSort:u,onToggleArchived:m,onHideArchived:b,onSearchChange:f,onClearSearch:x}=e;return(0,i.FD)("div",{className:"p-3 border-b border-ink/10 flex flex-col space-y-2.5 flex-shrink-0 bg-canvas",children:[(0,i.FD)("div",{className:"flex items-center space-x-2",children:[(0,i.FD)("button",{type:"button",onClick:s,className:"flex-1 h-9.5 flex items-center justify-center space-x-2 px-3.5 rounded-xl bg-ink text-canvas hover:bg-ink/90 active:scale-[0.98] text-xs font-semibold transition-all shadow-xs",children:[(0,i.Y)(g.A,{size:15,strokeWidth:2.4}),(0,i.Y)("span",{children:"New Session"})]}),(0,i.Y)("button",{type:"button",onClick:o,className:"w-9.5 h-9.5 rounded-xl border border-ink/15 bg-paper hover:bg-ink/5 active:scale-95 text-ink/80 hover:text-ink flex items-center justify-center transition-all flex-shrink-0 cursor-pointer shadow-xs",title:"New Workspace","aria-label":"New Workspace",children:(0,i.Y)(n6.A,{size:16,strokeWidth:1.8})}),(0,i.Y)("button",{type:"button",onClick:c,className:"w-9.5 h-9.5 rounded-xl border border-ink/15 bg-paper hover:bg-ink/5 active:scale-95 text-ink/80 hover:text-ink flex items-center justify-center transition-all flex-shrink-0 cursor-pointer shadow-xs",title:"Schedule Task","aria-label":"Schedule Task",children:(0,i.Y)(n8.A,{size:16,strokeWidth:1.8})}),(0,i.FD)("div",{className:"relative flex-shrink-0",ref:l,children:[(0,i.Y)("button",{type:"button",onClick:d,className:`w-9.5 h-9.5 rounded-xl border active:scale-95 flex items-center justify-center transition-all cursor-pointer shadow-xs ${r||"A-Z"!==n||a?"bg-ink/10 text-ink border-ink/30":"border-ink/15 bg-paper hover:bg-ink/5 text-ink/80 hover:text-ink"}`,title:"Sort & Filter","aria-label":"Sort & Filter",children:(0,i.Y)(ob.A,{size:15,strokeWidth:1.8})}),r&&(0,i.FD)("div",{className:"absolute right-0 top-full mt-2 w-52 bg-paper border border-ink/15 rounded-xl shadow-xl z-50 p-2 text-xs",children:[(0,i.Y)(ir,{variant:"mobile",sortOption:n,onSortChange:p}),(0,i.Y)("div",{className:"border-t border-ink/10 my-1.5"}),(0,i.Y)("div",{className:"px-2 py-1 text-[10px] uppercase font-bold text-ink/40 font-mono",children:"Filter"}),(0,i.FD)("button",{type:"button",onClick:m,className:`w-full text-left px-2.5 py-1.5 rounded-lg flex items-center justify-between transition-colors ${a?"bg-amber-500/15 text-amber-950 font-semibold":"hover:bg-ink/5 text-ink/80"}`,children:[(0,i.FD)("span",{className:"flex items-center space-x-1.5",children:[(0,i.Y)(n7.A,{size:13}),(0,i.Y)("span",{children:"Show Archived"})]}),a&&(0,i.Y)(D.A,{size:13})]})]})]})]}),(0,i.FD)("div",{className:"relative flex items-center",children:[(0,i.Y)(_.A,{size:14,className:"absolute left-3 text-ink/40"}),(0,i.Y)("input",{type:"text",value:t,onChange:e=>f(e.currentTarget.value),placeholder:"Search workspaces & sessions...",className:"w-full bg-paper border border-ink/15 rounded-xl pl-8 pr-8 py-2 text-xs text-ink placeholder-ink/40 focus:outline-none focus:border-ink/40 transition-colors font-mono"}),t&&(0,i.Y)("button",{type:"button",onClick:x,className:"absolute right-2.5 text-ink/40 hover:text-ink p-1","aria-label":"Clear search",children:(0,i.Y)(h.A,{size:13})})]}),(a||"A-Z"!==n)&&(0,i.FD)("div",{className:"flex items-center space-x-1.5 flex-wrap gap-y-1 pt-0.5",children:["A-Z"!==n&&(0,i.FD)("span",{className:"inline-flex items-center space-x-1 bg-ink/5 border border-ink/10 text-ink/80 rounded-lg px-2 py-0.5 text-[10px] font-mono",children:[(0,i.FD)("span",{children:["Sort: ",n.replace("_"," ")]}),(0,i.Y)("button",{type:"button",onClick:u,className:"hover:text-ink ml-0.5",title:"Reset sort",children:(0,i.Y)(h.A,{size:10})})]}),a&&(0,i.FD)("span",{className:"inline-flex items-center space-x-1 bg-amber-500/15 border border-amber-500/25 text-amber-900 rounded-lg px-2 py-0.5 text-[10px] font-mono",children:[(0,i.Y)(n7.A,{size:10}),(0,i.Y)("span",{children:"Archived"}),(0,i.Y)("button",{type:"button",onClick:b,className:"hover:text-amber-950 ml-0.5",title:"Hide archived",children:(0,i.Y)(h.A,{size:10})})]})]})]})}function ox(e){let{session:t,isActive:n,status:r,timeAgo:a,showTreeGlyph:l=!1,onSelect:s,onArchive:o,onRename:c}=e,{isEditing:d,draft:p,setDraft:u,inputRef:m,startRename:h,handleKeyDown:b,handleBlur:f}=im(t.title,c);return d?(0,i.Y)("div",{className:"w-full rounded-lg flex items-center bg-ink/10",children:(0,i.Y)("input",{ref:m,autoFocus:!0,value:p,onChange:e=>u(e.currentTarget.value),onKeyDown:b,onBlur:f,className:"flex-1 min-w-0 mx-2 my-1.5 bg-paper border border-ink/25 rounded px-2 py-1 text-xs text-ink outline-none focus:border-ink/50"})}):(0,i.FD)("div",{className:`w-full rounded-lg flex items-center transition-colors ${n?"bg-ink/10 font-medium text-ink":"hover:bg-ink/5 text-ink/85"}`,children:[(0,i.FD)("button",{type:"button",onClick:s,className:"flex-1 text-left px-3 py-2 flex items-center justify-between min-w-0",children:[(0,i.FD)("div",{className:"flex items-center space-x-1.5 min-w-0 pr-2",children:[(0,i.FD)("span",{className:"w-4 flex-shrink-0 flex items-center justify-center",children:["stream"===r&&(0,i.Y)(tf.A,{size:13,className:"text-ink/50 animate-spin"}),("finish"===r||"abort"===r||"error"===r)&&(0,i.Y)(D.A,{size:13,className:"text-ink/50"})]}),l&&(0,i.Y)("span",{className:"text-ink/40 text-xs flex-shrink-0 font-mono",children:">"}),(0,i.Y)("span",{className:"text-xs truncate leading-snug",children:t.title.charAt(0).toUpperCase()+t.title.slice(1)})]}),(0,i.Y)("span",{className:"text-[11px] text-ink/45 font-mono flex-shrink-0 ml-2",children:a??""})]}),c&&(0,i.Y)("button",{type:"button",onClick:h,title:"Rename session",className:"flex-shrink-0 p-2 text-ink/35 hover:text-ink rounded-lg cursor-pointer",children:(0,i.Y)(ip.A,{size:14})}),(0,i.Y)("button",{type:"button",onClick:o,title:1===t.is_archived?"Unarchive session":"Archive session",className:"flex-shrink-0 p-2 mr-1 text-ink/35 hover:text-ink rounded-lg cursor-pointer",children:1===t.is_archived?(0,i.Y)(iu.A,{size:14}):(0,i.Y)(n7.A,{size:14})})]})}function og(e){let{folder:t,activeSessionId:n,onSelectSession:r,isExpanded:l,onToggleExpand:s,showArchived:o=!1,sessionStatus:c={}}=e,{visibleCount:d,showMore:p}=ic(),{refresh:u}=ni(),[m,h]=(0,a.J0)(!1),b=(0,a.li)(null),{confirmDelete:f,requestDelete:x,cancelDelete:g,handlePin:v,handleDelete:k,handleArchive:y,handleRename:w}=id(t,u);(0,eM.W)(b,()=>{h(!1),g()});let N=(t.sessions||[]).filter(e=>o?1===e.is_archived:1!==e.is_archived),Y=N.slice(0,d),D=ij(t.icon);return(0,i.FD)("div",{className:"mb-4",children:[(0,i.FD)("div",{onClick:s,className:"flex items-center justify-between px-3 py-2 cursor-pointer hover:bg-ink/5 rounded-lg select-none transition-colors",children:[(0,i.FD)("div",{className:"flex items-center space-x-2 min-w-0",children:[t.customIconUrl?(0,i.Y)("img",{src:t.customIconUrl,alt:"",className:"w-[15px] h-[15px] rounded-xs object-contain flex-shrink-0",referrerPolicy:"no-referrer"}):"chat"===t.iconType?(0,i.Y)(T.A,{size:15,className:"text-ink/80 flex-shrink-0"}):(0,i.Y)(D,{size:15,className:"text-ink/80 flex-shrink-0",style:{color:t.accentColor||void 0}}),(0,i.Y)("span",{className:"text-sm font-semibold text-ink truncate",children:t.name})]}),(0,i.FD)("div",{className:"flex items-center space-x-2 text-xs text-ink/60",children:[(0,i.Y)("span",{className:"font-mono text-[11px] text-ink/70",children:N.length}),t.project_path&&(0,i.Y)(nu.A,{size:13,className:"text-ink/50 ml-1"}),(0,i.FD)("div",{className:"relative flex items-center",ref:b,onClick:e=>e.stopPropagation(),children:[(0,i.Y)("button",{type:"button",onClick:e=>{e.stopPropagation(),h(e=>!e)},className:"p-1.5 rounded-lg hover:bg-ink/10 active:bg-ink/15 text-ink/60 hover:text-ink",title:"Workspace options","aria-label":`Options for ${t.name}`,children:(0,i.Y)(n9.A,{size:15})}),m&&(0,i.Y)("div",{className:"absolute right-0 top-full mt-1 w-48 bg-paper border border-ink/15 rounded-lg shadow-lg z-50 py-1 text-xs",children:(0,i.Y)(iz,{variant:"mobile",isPinned:t.isPinned,confirmDelete:f,onPin:()=>{v(),h(!1)},onDelete:()=>{k(),h(!1)},onRequestDelete:x,onCancelDelete:g})})]}),l?(0,i.Y)(eT.A,{size:14}):(0,i.Y)(nl.A,{size:14})]})]}),l&&(0,i.FD)("div",{className:"mt-0.5 space-y-0.5 pl-2",children:[Y.map(e=>(0,i.Y)(ox,{session:e,isActive:String(n)===String(e.id),status:c[String(e.id)],timeAgo:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now();if(null==e||""===e)return null;let n="number"==typeof e?e:Date.parse(e);if(Number.isNaN(n))return null;let i=Math.round((t-n)/1e3);if(i<45)return"now";let r=Math.round(i/60);if(r<60)return`${r}m`;let a=Math.round(r/60);if(a<24)return`${a}h`;let l=Math.round(a/24);if(l<7)return`${l}d`;let s=Math.round(l/7);if(s<5)return`${s}w`;let o=new Date(n),c=o.getFullYear()===new Date(t).getFullYear(),d=o.getDate(),p=o.toLocaleString("en-US",{month:"short"});return c?`${d} ${p}`:`${d} ${p} ${o.getFullYear()}`}(e.updated_at??e.created_at),onSelect:()=>r(e.id),onArchive:()=>y(e),onRename:String(e.id).startsWith("new-")?void 0:t=>void w(e,t)},e.id)),N.length>d&&(0,i.FD)("button",{type:"button",onClick:p,className:"w-full text-left px-3 py-2 text-xs text-ink/60 hover:text-ink flex items-center space-x-1.5",children:[(0,i.Y)(eT.A,{size:12,className:"w-4 flex-shrink-0"}),(0,i.FD)("span",{children:["Show more sessions (",N.length-d,")"]})]})]})]})}function ov(e){let{folders:t,activeSessionId:n,expandedFolders:r,showArchived:a,sessionStatus:l,isScrolling:s,onScroll:o,onSelectSession:c,onToggleFolder:d}=e;return(0,i.Y)("div",{onScroll:o,className:`flex-1 scrollbar-overlay-container p-3 ${(0,iI.p)(s)}`,children:0===t.length?(0,i.Y)("div",{className:"text-center py-12 text-xs text-ink/50 italic",children:"No matching sessions found"}):t.map(e=>(0,i.Y)(og,{folder:e,activeSessionId:n,onSelectSession:c,isExpanded:r[e.id]??!0,onToggleExpand:()=>d(e.id),showArchived:a,sessionStatus:l},e.id))})}var ok=n("mXQ");function oy(e){let{onSettings:t,onAbout:n,updateAvailable:r,onUpdateClick:a,onDesktopToggle:l}=e;return(0,i.FD)("div",{className:"px-3 pt-3 border-t border-ink/10 flex items-center justify-between flex-shrink-0 bg-canvas text-xs text-ink/60",style:{paddingBottom:"max(0.75rem, env(safe-area-inset-bottom, 0px))"},children:[(0,i.FD)("div",{className:"flex items-center space-x-3",children:[(0,i.FD)("button",{type:"button",onClick:t,className:"flex items-center space-x-1 hover:text-ink transition-colors",children:[(0,i.Y)(il.A,{size:14}),(0,i.Y)("span",{children:"Settings"})]}),(0,i.FD)("button",{type:"button",onClick:n,className:"flex items-center space-x-1 hover:text-ink transition-colors",children:[(0,i.Y)(eC.A,{size:14}),(0,i.Y)("span",{children:"About"})]}),l&&(0,i.FD)("button",{type:"button",onClick:l,className:"flex items-center space-x-1 hover:text-ink transition-colors",title:"Switch to desktop view",children:[(0,i.Y)(ok.A,{size:14}),(0,i.Y)("span",{children:"Desktop"})]})]}),(0,i.FD)("div",{className:"flex items-center gap-2",children:[(0,i.FD)("span",{className:"font-mono text-[10px] text-ink/40",children:["v",nQ]}),r&&(0,i.Y)("button",{type:"button",onClick:a,className:"px-2 py-0.5 rounded-full border border-ink/20 text-[10px] font-semibold text-ink hover:border-ink/40",children:"update"})]})]})}let ow=[3,2];function oN(){return(0,i.Y)("div",{className:"flex-1 p-3 space-y-4","aria-hidden":"true",children:ow.map((e,t)=>(0,i.FD)("div",{className:"space-y-2",children:[(0,i.FD)("div",{className:"flex items-center gap-2 px-1 py-2",children:[(0,i.Y)("span",{className:"w-4 h-4 rounded-sm animate-pulse bg-ink/10"}),(0,i.Y)("span",{className:"h-3 w-24 rounded animate-pulse bg-ink/10"})]}),Array.from({length:e},(e,t)=>(0,i.FD)("div",{className:"flex items-center gap-2 rounded px-2 py-2",children:[(0,i.Y)("span",{className:"w-4 h-4 rounded-full animate-pulse bg-ink/10"}),(0,i.Y)("span",{className:"h-3 rounded animate-pulse bg-ink/10",style:{width:`${58-t%3*12}%`}})]},t))]},t))})}function oY(e){let{activeSessionId:t,onSelectSession:n,onNewSession:r,onCreateFolder:l,onClose:s,onDesktopToggle:o,appSettings:c={}}=e,{folders:d,initializing:p,searchQuery:u,setSearchQuery:m,showArchived:h,setShowArchived:b,optionsOpen:f,setOptionsOpen:x,sortOption:g,handleSortChange:v,processedFolders:k,sessionStatus:y,handleSelectSession:w}=i1(c,{onSelectSession:n,onAfterSelect:s}),[N,Y]=(0,a.J0)({1:!0,2:!0,3:!0}),[D,A]=(0,a.J0)(!1),[F,C]=(0,a.J0)(!1),[S,T]=(0,a.J0)(!1),M=iK(),{toasts:z,pushToast:P,dismissToast:L}=(0,e0.Y)(),j=(0,a.li)(null);(0,eM.W)(j,()=>x(!1));let{isScrolling:R,handleScroll:I}=(0,iI.K)();return(0,a.vJ)(()=>{Y(Object.fromEntries(d.map(e=>[e.id,e.isExpanded])))},[d]),(0,i.FD)("div",{className:"flex flex-col h-full w-full bg-canvas text-ink relative select-none",children:[(0,i.Y)(oh,{onClose:s}),(0,i.Y)(of,{searchQuery:u,sortOption:g,optionsOpen:f,showArchived:h,optionsRef:j,onNewSession:()=>{r(),s()},onNewWorkspace:()=>A(!0),onScheduler:()=>C(!0),onToggleOptions:()=>x(!f),onSortChange:v,onResetSort:()=>v("A-Z"),onToggleArchived:()=>{b(!h),x(!1)},onHideArchived:()=>b(!1),onSearchChange:m,onClearSearch:()=>m("")}),p?(0,i.Y)(oN,{}):(0,i.Y)(ov,{folders:k,activeSessionId:t,expandedFolders:N,showArchived:h,sessionStatus:y,isScrolling:R,onScroll:I,onSelectSession:w,onToggleFolder:e=>{Y(t=>({...t,[e]:!t[e]}));let t=d.find(t=>t.id===e),n=!(N[e]??t?.isExpanded??!0);fetch(`/api/folders/${e}/toggle`,{method:"POST",body:new URLSearchParams({isExpanded:String(n)})}).then(t=>{if(!t.ok)throw Error(`HTTP ${t.status}`);window.dispatchEvent(new CustomEvent("omp:workspace-updated",{detail:{folderId:e}}))}).catch(e=>{console.error("Failed to save mobile workspace state:",e)})}}),(0,i.Y)(oy,{onSettings:()=>window.dispatchEvent(new CustomEvent("omp:open-settings",{detail:{}})),onAbout:()=>T(!0),onDesktopToggle:o,updateAvailable:M.hasUpdate,onUpdateClick:()=>{T(!0),M.check()}}),(0,i.Y)(n5,{isOpen:D,onClose:()=>A(!1),onCreate:l}),(0,i.Y)(n3,{isOpen:F,onClose:()=>C(!1)}),(0,i.Y)(n2,{isOpen:S,onClose:()=>T(!1),updates:M,onToast:P}),(0,i.Y)(eU.y,{toasts:z,onDismiss:L})]})}function oD(e){let{enabled:t=!0,rootPath:n,refreshKey:r=0,onRefresh:l,onOpenFile:o,onClose:c}=e,[d,p]=(0,a.J0)("files"),{changes:u}=(0,s6.e)(n,".",r,t,15e3),m=u.length>0;return(0,i.FD)("div",{className:"flex flex-col h-full w-full bg-paper text-ink relative select-none",children:[(0,i.FD)("div",{className:"border-b border-ink/10 flex items-center justify-between px-3 flex-shrink-0 bg-canvas",style:{height:"calc(3.5rem + env(safe-area-inset-top, 0px))",paddingTop:"env(safe-area-inset-top, 0px)",paddingLeft:"max(0.75rem, env(safe-area-inset-left, 0px))",paddingRight:"max(0.75rem, env(safe-area-inset-right, 0px))"},children:[(0,i.FD)("div",{className:"flex items-center space-x-1.5 overflow-x-auto no-scrollbar py-1",children:[(0,i.FD)("button",{type:"button",onClick:()=>p("files"),className:`flex items-center transition-all cursor-pointer ${"files"===d?"space-x-1.5 px-3 py-1.5 rounded-lg text-xs font-semibold bg-ink text-canvas shadow-sm":"p-2 rounded-lg text-ink/70 hover:bg-ink/5"}`,title:"Files Explorer",children:[(0,i.Y)(s4.A,{size:14,className:"flex-shrink-0"}),"files"===d&&(0,i.Y)("span",{children:"Files"})]}),(0,i.FD)("button",{type:"button",onClick:()=>p("search"),className:`flex items-center transition-all cursor-pointer ${"search"===d?"space-x-1.5 px-3 py-1.5 rounded-lg text-xs font-semibold bg-ink text-canvas shadow-sm":"p-2 rounded-lg text-ink/70 hover:bg-ink/5"}`,title:"Search Workspace",children:[(0,i.Y)(_.A,{size:14,className:"flex-shrink-0"}),"search"===d&&(0,i.Y)("span",{children:"Search"})]}),(0,i.FD)("button",{type:"button",onClick:()=>p("git"),className:`relative flex items-center transition-all cursor-pointer ${"git"===d?"space-x-1.5 px-3 py-1.5 rounded-lg text-xs font-semibold bg-ink text-canvas shadow-sm":"p-2 rounded-lg text-ink/70 hover:bg-ink/5"}`,title:"GIT",children:[(0,i.Y)(nu.A,{size:14,className:"flex-shrink-0"}),"git"===d&&(0,i.Y)("span",{className:"tracking-wide",children:"GIT"}),m&&(0,i.Y)("span",{className:"absolute top-1 right-1 w-1.5 h-1.5 rounded-full bg-info",title:"Uncommitted changes"})]}),(0,i.FD)("button",{type:"button",onClick:()=>p("context"),className:`flex items-center transition-all cursor-pointer ${"context"===d?"space-x-1.5 px-3 py-1.5 rounded-lg text-xs font-semibold bg-ink text-canvas shadow-sm":"p-2 rounded-lg text-ink/70 hover:bg-ink/5"}`,title:"Context & Telemetry",children:[(0,i.Y)(tc.A,{size:14,className:"flex-shrink-0"}),"context"===d&&(0,i.Y)("span",{children:"Context"})]}),(0,i.FD)("button",{type:"button",onClick:()=>p("terminal"),className:`flex items-center transition-all cursor-pointer ${"terminal"===d?"space-x-1.5 px-3 py-1.5 rounded-lg text-xs font-semibold bg-ink text-canvas shadow-sm":"p-2 rounded-lg text-ink/70 hover:bg-ink/5"}`,title:"Bun Terminal",children:[(0,i.Y)(w.A,{size:14,className:"flex-shrink-0"}),"terminal"===d&&(0,i.Y)("span",{children:"Terminal"})]}),(0,i.FD)("button",{type:"button",onClick:()=>p("user-browser"),className:`flex items-center transition-all cursor-pointer ${"user-browser"===d?"space-x-1.5 px-3 py-1.5 rounded-lg text-xs font-semibold bg-ink text-canvas shadow-sm":"p-2 rounded-lg text-ink/70 hover:bg-ink/5"}`,title:"Browser (Anda)",children:[(0,i.Y)(em.A,{size:14,className:"flex-shrink-0"}),"user-browser"===d&&(0,i.Y)("span",{children:"Browser"})]}),(0,i.FD)("button",{type:"button",onClick:()=>p("browser"),className:`flex items-center transition-all cursor-pointer ${"browser"===d?"space-x-1.5 px-3 py-1.5 rounded-lg text-xs font-semibold bg-ink text-canvas shadow-sm":"p-2 rounded-lg text-ink/70 hover:bg-ink/5"}`,title:"Browser Agent",children:[(0,i.Y)(I.A,{size:14,className:"flex-shrink-0"}),"browser"===d&&(0,i.Y)("span",{children:"Agent"})]}),(0,i.FD)("button",{type:"button",onClick:()=>p("usage"),className:`flex items-center transition-all cursor-pointer ${"usage"===d?"space-x-1.5 px-3 py-1.5 rounded-lg text-xs font-semibold bg-ink text-canvas shadow-sm":"p-2 rounded-lg text-ink/70 hover:bg-ink/5"}`,title:"Usage",children:[(0,i.Y)(z.A,{size:14,className:"flex-shrink-0"}),"usage"===d&&(0,i.Y)("span",{children:"Usage"})]})]}),(0,i.Y)("button",{type:"button",onClick:c,className:"p-1.5 rounded-lg hover:bg-ink/5 active:bg-ink/10 text-ink transition-colors flex-shrink-0 ml-2",title:"Close right sidebar","aria-label":"Close right sidebar",children:(0,i.Y)(h.A,{size:20,strokeWidth:1.8})})]}),(0,i.Y)("div",{className:"flex-1 min-h-0 overflow-hidden relative",style:{paddingBottom:"env(safe-area-inset-bottom, 0px)"},children:t?(0,i.Y)(i.FK,{children:(0,i.FD)(s.tY,{fallback:(0,i.Y)("div",{className:"h-full flex items-center justify-center text-ink/40",children:(0,i.Y)("span",{className:"text-xs font-mono",children:"Loading…"})}),children:["files"===d&&(0,i.Y)(sV,{className:"h-full w-full",enabled:t,rootPath:n,refreshKey:r,onRefresh:l,onOpenFile:o}),"search"===d&&(0,i.Y)(sQ,{className:"h-full w-full",enabled:t,rootPath:n}),"git"===d&&(0,i.Y)(sZ,{className:"h-full w-full",enabled:t,rootPath:n,refreshKey:r}),"context"===d&&(0,i.Y)(s0,{className:"h-full w-full",enabled:t,refreshKey:r,onClose:c}),"terminal"===d&&(0,i.Y)(sX,{className:"h-full w-full",enabled:t,rootPath:n,showHeader:!1}),"user-browser"===d&&(0,i.Y)(s2,{className:"h-full w-full"}),"browser"===d&&(0,i.Y)(s1,{className:"h-full w-full",active:!0}),"usage"===d&&(0,i.Y)(s5,{className:"h-full w-full"})]})}):(0,i.Y)("div",{className:"h-full flex items-center justify-center text-ink/40",children:(0,i.Y)("span",{className:"text-xs font-mono",children:"No session selected"})})})]})}var oA=n("HO"),oF=n("hj"),oC=n("na"),oS=n("cx");function oT(e){let{fileName:t,isMarkdown:n,isPreview:r,wordWrap:a,copied:l,onClose:s,onTogglePreview:o,onToggleWrap:c,onZoomOut:d,onZoomIn:p,onCopy:u,onDownload:m}=e;return(0,i.FD)("header",{className:"bg-canvas border-b border-ink/10 flex items-center justify-between px-3 flex-shrink-0",style:{height:"calc(3rem + env(safe-area-inset-top, 0px))",paddingTop:"env(safe-area-inset-top, 0px)",paddingLeft:"max(0.75rem, env(safe-area-inset-left, 0px))",paddingRight:"max(0.75rem, env(safe-area-inset-right, 0px))"},children:[(0,i.FD)("div",{className:"flex items-center space-x-2 min-w-0 pr-2",children:[(0,i.Y)("button",{type:"button",onClick:s,className:"p-1.5 rounded-lg hover:bg-ink/10 text-ink transition-colors active:scale-90 flex-shrink-0 cursor-pointer",title:"Close editor","aria-label":"Close editor",children:(0,i.Y)(lH.A,{size:18,strokeWidth:2})}),(0,i.FD)("div",{className:"flex items-center space-x-1.5 truncate",children:[(0,i.Y)(oS.o,{name:t,size:15,className:"flex-shrink-0"}),(0,i.Y)("span",{className:"font-semibold text-xs text-ink truncate",children:t})]})]}),(0,i.FD)("div",{className:"flex items-center space-x-1 text-ink/70 flex-shrink-0",children:[n&&(0,i.Y)("button",{type:"button",onClick:o,className:`p-1.5 rounded hover:bg-ink/10 transition-colors cursor-pointer ${r?"bg-ink text-canvas":""}`,title:r?"View code":"Preview markdown",children:r?(0,i.Y)(ti.A,{size:15}):(0,i.Y)(tn.A,{size:15})}),(0,i.Y)("button",{type:"button",onClick:c,className:`p-1.5 rounded hover:bg-ink/10 transition-colors cursor-pointer ${a?"text-ink":""}`,title:"Toggle word wrap",children:(0,i.Y)(X.A,{size:15})}),(0,i.Y)("button",{type:"button",onClick:d,className:"p-1.5 rounded hover:bg-ink/10 transition-colors cursor-pointer",title:"Decrease font size",children:(0,i.Y)(oF.A,{size:15})}),(0,i.Y)("button",{type:"button",onClick:p,className:"p-1.5 rounded hover:bg-ink/10 transition-colors cursor-pointer",title:"Increase font size",children:(0,i.Y)(oC.A,{size:15})}),(0,i.Y)("button",{type:"button",onClick:u,className:"p-1.5 rounded hover:bg-ink/10 transition-colors cursor-pointer",title:"Copy content",children:l?(0,i.Y)(D.A,{size:15,className:"text-success"}):(0,i.Y)(tS.A,{size:15})}),(0,i.Y)("button",{type:"button",onClick:m,className:"p-1.5 rounded hover:bg-ink/10 transition-colors cursor-pointer",title:"Download file",children:(0,i.Y)(nh.A,{size:15})})]})]})}var oM=n("XY");function oz(e){let{file:t,onClose:n,onFileSaved:r}=e,[l,s]=(0,a.J0)(t.name.endsWith(".md")),[o,c]=(0,a.J0)(12),[d,p]=(0,a.J0)(!0),{isScrolling:u,handleScroll:m}=(0,iI.K)(),h=t.name.endsWith(".md"),b=(0,oM.n)(t,{reportLoadError:!0,flushOnUnmount:!0,reportSaveError:!0,downloadMimeType:"text/plain;charset=utf-8",onFileSaved:r}),f=b.content,x=b.language,g=f.split("\n").length;return(0,i.FD)("div",{className:"fixed inset-x-0 top-0 h-dvh z-[60] bg-paper flex flex-col font-mono text-xs select-none",children:[(0,i.Y)(oT,{fileName:t.name,isMarkdown:h,isPreview:l,wordWrap:d,copied:b.copied,onClose:n,onTogglePreview:()=>s(!l),onToggleWrap:()=>p(!d),onZoomOut:()=>c(e=>Math.max(10,e-1)),onZoomIn:()=>c(e=>Math.min(18,e+1)),onCopy:b.copy,onDownload:b.download}),(0,i.Y)("div",{onScroll:m,className:`flex-1 min-h-0 overflow-auto relative bg-paper text-ink select-text ${(0,iI.p)(u)}`,children:b.isLoading?(0,i.FD)("div",{className:"flex items-center justify-center h-full text-ink/40 text-xs gap-2",children:[(0,i.Y)(tf.A,{size:14,className:"animate-spin"}),(0,i.Y)("span",{children:"Loading file content..."})]}):b.loadError?(0,i.FD)("div",{className:"flex flex-col items-center justify-center h-full gap-2 px-6 text-center",children:[(0,i.Y)(au.A,{size:20,className:"text-error"}),(0,i.FD)("span",{className:"text-xs text-error font-sans",children:["Could not read ",t.name]}),(0,i.Y)("span",{className:"text-[11px] text-ink/50 font-mono break-all",children:b.loadError})]}):h&&l?(0,i.Y)("div",{className:"p-4 bg-paper text-ink min-h-full font-sans prose prose-sm max-w-none",children:(0,i.Y)(rU.T,{content:f})}):(0,i.Y)(oA.P,{value:f,onValueChange:b.onChange,language:x,wordWrap:d,rootClassName:"flex min-h-full bg-paper",gutterClassName:"w-10 py-3 pr-2 select-none text-right text-[10px] text-ink/30 bg-canvas border-r border-ink/10 font-mono leading-[20px] flex-shrink-0",editorWrapperClassName:"flex-1 p-3 overflow-x-auto min-w-0 bg-paper text-ink code-surface",editorClassName:"focus:outline-none",editorStyle:{fontFamily:"monospace",fontSize:`${o}px`,lineHeight:"20px",backgroundColor:"transparent",minHeight:"100%",color:"var(--theme-ink)"}})}),(0,i.FD)("footer",{className:"bg-canvas border-t border-ink/10 px-3 flex items-center justify-between text-[10px] text-ink/60 flex-shrink-0 font-mono",style:{height:"calc(1.75rem + env(safe-area-inset-bottom, 0px))",paddingBottom:"env(safe-area-inset-bottom, 0px)",paddingLeft:"max(0.75rem, env(safe-area-inset-left, 0px))",paddingRight:"max(0.75rem, env(safe-area-inset-right, 0px))"},children:[(0,i.FD)("div",{className:"flex items-center space-x-3",children:[(0,i.FD)("span",{children:[g," lines"]}),(0,i.FD)("span",{children:[f.length," chars"]}),(0,i.Y)("span",{className:"uppercase",children:x})]}),(0,i.FD)("div",{className:"flex items-center space-x-2",children:["saving"===b.saveStatus&&(0,i.FD)(i.FK,{children:[(0,i.Y)(tf.A,{size:10,className:"animate-spin"}),(0,i.Y)("span",{children:"Saving…"})]}),"saved"===b.saveStatus&&(0,i.FD)(i.FK,{children:[(0,i.Y)("span",{className:"w-1.5 h-1.5 rounded-full bg-success"}),(0,i.Y)("span",{children:"Saved"})]}),"error"===b.saveStatus&&(0,i.FD)(i.FK,{children:[(0,i.Y)("span",{className:"w-1.5 h-1.5 rounded-full bg-error"}),(0,i.Y)("span",{className:"text-error",children:"Save failed"})]}),"idle"===b.saveStatus&&t.path&&(0,i.Y)("span",{className:"truncate max-w-[140px]",children:t.path})]})]})]})}var oP=n("heW"),oL=n("LQ");function oj(e){let{diff:t,onClose:n,onFileSaved:r}=e,a=t.path.split("/").pop()||t.path,l=!!t.staged,s=t.status||"M",o=(0,oL.R)(s,l);return(0,i.FD)("div",{className:"fixed inset-x-0 top-0 h-dvh z-[60] bg-paper flex flex-col",children:[(0,i.FD)("header",{className:"bg-canvas border-b border-ink/10 flex items-center justify-between px-3 flex-shrink-0",style:{height:"calc(3rem + env(safe-area-inset-top, 0px))",paddingTop:"env(safe-area-inset-top, 0px)",paddingLeft:"max(0.75rem, env(safe-area-inset-left, 0px))",paddingRight:"max(0.75rem, env(safe-area-inset-right, 0px))"},children:[(0,i.FD)("div",{className:"flex items-center space-x-2 min-w-0 pr-2",children:[(0,i.Y)("button",{type:"button",onClick:n,className:"p-1.5 -ml-1 rounded-lg hover:bg-ink/5 active:bg-ink/10 text-ink transition-colors flex-shrink-0",title:"Back","aria-label":"Close diff",children:(0,i.Y)(lH.A,{size:18,strokeWidth:1.9})}),(0,i.Y)(oS.o,{name:a,size:14,className:"flex-shrink-0"}),(0,i.Y)("span",{className:"font-mono text-xs text-ink font-medium truncate",title:t.path,children:a})]}),(0,i.FD)("span",{className:`px-1.5 py-0.5 text-[10px] font-mono font-semibold rounded border flex-shrink-0 ${o.badgeBgClass}`,children:[o.charStatus," ",o.label]})]}),(0,i.Y)("div",{className:"flex-1 min-h-0",children:(0,i.Y)(oP.M,{className:"h-full",filePath:t.path,status:s,isStaged:l,root:t.root,repo:t.repo||".",onFileSaved:r})})]})}function oR(e){let{onDesktopToggle:t,appSettings:n={}}=e,{folders:r}=ni(),[s,o]=(0,l.o)(),c=s.get("sessionId"),d=c?Number.isNaN(Number(c))?c:Number(c):null,p=s.get("folderId"),u=p?Number.isNaN(Number(p))?p:Number(p):null,[m,h]=(0,a.J0)("main"),[b,f]=(0,a.J0)(null),[x,g]=(0,a.J0)(null),[v,k]=(0,a.J0)(0),[y,w]=(0,a.J0)(!1),[N,Y]=(0,a.J0)("appearance"),[D,A]=(0,a.J0)(!1),F=(0,a.hb)(()=>k(e=>e+1),[]),{folder:S}=i3(r,d),T=S??(u?r.find(e=>String(e.id)===String(u))??null:null),M=T?.project_path??null,z=!!T;(0,C.sY)("omp:open-file",e=>{if(!e.detail||!e.detail.path)return;let t=e.detail.path.replace(/^\/+/,"");f({name:e.detail.name||t.split("/").pop()||"file",path:t,content:e.detail.content,root:e.detail.root})}),(0,C.sY)("omp:open-diff",e=>{let t=e.detail;t?.file&&g({path:t.file.replace(/^\/+/,""),status:t.status,staged:t.staged,repo:t.repo,root:t.root??M??void 0})}),(0,C.sY)("omp:open-settings",e=>{let t=e.detail;Y(t?.category??"appearance"),A(!!t?.autoOpenAdd),w(!0)});let P=e=>{o(t=>(t.set("sessionId",e.toString()),t.has("subagent")&&t.delete("subagent"),t),{replace:!0}),h("main")},L=()=>{let e=i_(r,c,u??void 0);e&&iJ(e),o(e=>{let t=e.get("sessionId"),n=new URLSearchParams(e);if(n.set("sessionId",`new-${Date.now()}`),t){let e=r.find(e=>e.sessions?.some(e=>String(e.id)===String(t)));e&&n.set("folderId",e.id.toString())}return n},{replace:!0}),h("main")},j=async e=>{let t=await fetch("/api/folders",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),n=await t.json().catch(()=>({}));if(!t.ok||!n.success)throw Error(n.error||`HTTP ${t.status}`);window.location.reload()},R=(0,a.hb)(e=>{let t=(e?.path||"").replace(/^\/+/,"");f({name:e?.name||t.split("/").pop()||"file",path:t,content:e?.content,root:e?.root??M??void 0})},[M]);return(0,i.FD)("div",{className:"flex flex-col h-dvh w-screen overflow-hidden bg-canvas text-ink font-sans selection:bg-ink selection:text-canvas relative",children:[(0,i.Y)("div",{className:`flex-1 min-h-0 w-full ${"main"===m?"block":"hidden"}`,children:(0,i.Y)(om,{activeSessionId:d,onSelectSession:P,onNewSession:L,onOpenSessionSidebar:()=>h("session"),onOpenRightSidebar:()=>h("right"),appSettings:n})}),(0,i.Y)("div",{className:`flex-1 min-h-0 w-full ${"session"===m?"block":"hidden"}`,children:(0,i.Y)(oY,{activeSessionId:d,onSelectSession:P,onNewSession:L,onCreateFolder:j,onClose:()=>h("main"),onDesktopToggle:t,appSettings:n})}),"right"===m&&(0,i.Y)("div",{className:"flex-1 min-h-0 w-full",children:(0,i.Y)(oD,{enabled:z,rootPath:M??void 0,refreshKey:v,onRefresh:F,onOpenFile:R,onClose:()=>h("main")})}),b&&(0,i.Y)(oz,{file:b,onClose:()=>f(null),onFileSaved:F}),x&&(0,i.Y)(oj,{diff:x,onClose:()=>g(null),onFileSaved:F}),(0,i.Y)(nq,{isOpen:y,onClose:()=>{w(!1),A(!1)},initialCategory:N,autoOpenAddProvider:D,appSettings:n})]})}function oI(e){let{sessionId:t,children:n}=e,r=t||"1",[l,s]=(0,a.J0)(!1),o=(0,a.li)(null);(0,a.vJ)(()=>{let e=o.current;if(o.current=r,e!==r){if((0,op.Y1)(r),e&&e.startsWith("new-")&&!r.startsWith("new-")){(0,op.vy)(e,r),s(!0);return}if(r.startsWith("new-")){(0,op.l5)(r),s(!0);return}s(!1),(0,op.D4)(e).then(()=>(0,op.L6)(r)).then(()=>{o.current===r&&s(!0)})}},[r]);let c=(0,a.Kr)(()=>({sessionId:r,ready:l}),[r,l]);return(0,i.Y)(i6.b.Provider,{value:c,children:n})}var oE=n("zF");n("mQ"),n("ll"),n("iw"),n("Ju"),n("gt");let o$=document.getElementById("app"),oO=window.__OMP_BOOTSTRAP__;(0,A.x9)(oO?.appSettings),(0,oE.iv)(),o$&&(0,r.Qv)((0,i.Y)(function(e){let{initialIsMobile:t=!1,appSettings:n={}}=e,[r]=(0,l.o)(),s=r.get("sessionId")||"1",[o,c]=(0,a.J0)(t),d=(0,a.li)(!1);return((0,a.vJ)(()=>{let e=()=>{let e=window.innerWidth<768,t=window.matchMedia("(pointer: coarse)").matches,n=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Mobile|mobile|CriOS/i.test(navigator.userAgent),i=t&&window.innerHeight<550&&window.innerWidth<1024;return e||n||i};d.current||c(e());let t=()=>{d.current||c(e())};return window.addEventListener("resize",t),window.addEventListener("orientationchange",t),()=>{window.removeEventListener("resize",t),window.removeEventListener("orientationchange",t)}},[]),o)?(0,i.Y)(oI,{sessionId:s,children:(0,i.Y)(nn,{children:(0,i.Y)(oR,{onDesktopToggle:()=>{d.current=!0,c(!1)},appSettings:n})})}):(0,i.Y)(oI,{sessionId:s,children:(0,i.Y)(nn,{children:(0,i.Y)(oc,{sessionId:s,onSwitchToMobile:()=>{d.current=!0,c(!0)},appSettings:n})})})},{initialIsMobile:oO?.initialIsMobile,appSettings:oO?.appSettings}),o$)},Fb(e,t,n){let i="omp:browser-include-page";function r(e){"u">typeof window&&window.dispatchEvent(new CustomEvent(i,{detail:e}))}n.d(t,{q:()=>r},{j:i})},Kc(e,t,n){var i=n("oS"),r=n("zG");let a={edit:!0,write:!0,ast_edit:!0,bash:!0};function l(e){let t="string"==typeof e.toolName?e.toolName.toLowerCase():"",n=r.YT[t]??t;if(!a[n])return!1;let l=(0,i.u)(e.args)?e.args:{},s=(0,r.oJ)(l.path)??(0,r.oJ)(l.target);return!("write"===n&&"string"==typeof s&&s.startsWith("xd://"))}n.d(t,{Y:()=>l},{s:"omp:files-mutated"})},G1(e,t,n){function i(e,t){let n=function(e){let t=e.trim();if(!t)return null;let n="message",i=[];for(let e of t.split("\n"))!e.startsWith(":")&&(e.startsWith("event:")?n=e.replace(/^event:\s*/,"").trim():e.startsWith("data:")&&i.push(e.replace(/^data:\s*/,"")));return 0===i.length?null:{event:n,data:i.join("\n")}}(e);return!!n&&!0===t(n.event,n.data)}async function r(e,t,n){let r=e.body?.getReader();if(!r)return;let a=new TextDecoder("utf-8"),l="";try{for(;;){if(n?.aborted){try{await r.cancel()}catch{}return}let{done:e,value:s}=await r.read();if(e)break;let o=(l+=a.decode(s,{stream:!0})).split("\n\n");for(let e of(l=o.pop()??"",o))if(i(e,t))return}l&&i(l,t)}finally{try{r.releaseLock()}catch{}}}n.d(t,{o:()=>r})},zG(e,t,n){var i=n("oS"),r=n("e");function a(e){if("string"!=typeof e)return;let t=e.trim();return t.length>0?t:void 0}function l(e,t){for(let n of t){let t=e[n],i=a(t);if(i)return i;if(Array.isArray(t)){let e=t.find(e=>void 0!==a(e));if(void 0!==e)return a(e)}}}function s(e){return e.length<=72?e:`${e.slice(0,71)}…`}function o(e){if(e)return/^["'`]/.test(e)?e:`"${e}"`}function c(e,t){switch(e){case"read":case"write":case"edit":return l(t,["path","file","AbsolutePath","TargetFile"])??(0,r.f$)(t);case"ast_edit":return l(t,["paths","path"]);case"ast_grep":{let e=o(l(t,["pat"]));return e?`for ${e}`:void 0}case"bash":return l(t,["command","cmd","CommandLine"]);case"grep":{let e=l(t,["pattern"]),n=l(t,["path","paths"]);if(!e)return n;return n?`for ${o(e)} in ${n}`:`for ${o(e)}`}case"glob":return l(t,["path","pattern"]);case"web_search":{let e=o(l(t,["query"]));return e?`for ${e}`:void 0}case"task":let n,s,c,d;return n=a(t.name),s=(Array.isArray(t.tasks)?t.tasks:[]).find(i.u),c=n??(s?a(s.name):void 0),d=a(t.agent)??(s?a(s.agent):void 0),c&&d?`to ${c} (${d})`:c?`to ${c}`:d?`to ${d}`:void 0;case"hub":return[l(t,["op"]),l(t,["name"])].filter(Boolean).join(" ")||void 0;case"todo":{let e=l(t,["op"]);return e?`\xb7 ${e}`:void 0}case"eval":{let e=l(t,["language"]);return e?`in ${e}`:void 0}case"lsp":return[l(t,["action"]),l(t,["symbol","file"])].filter(Boolean).join(" ")||void 0;case"debug":return l(t,["action","program"]);case"github":return[l(t,["op"]),l(t,["repo","pr","query"])].filter(Boolean).join(" ")||void 0;case"ask":let p=(Array.isArray(t.questions)?t.questions:[]).find(i.u);if(p)return a(p.header)??a(p.question);return;case"checkpoint":return l(t,["goal"]);case"manage_skill":return l(t,["name"]);case"recall":return o(l(t,["query"]));case"reflect":{let e=o(l(t,["query"]));return e?`on ${e}`:void 0}case"security_scan":return l(t,["target_kind","include_paths"]);case"retain":let u;return(u=(Array.isArray(t.items)?t.items:[]).find(i.u))?o(a(u.content)):void 0;default:return l(t,["path","command","query","pattern","name","target","prose"])}}n.d(t,{Up:()=>l,oJ:()=>a,qL:()=>c,xv:()=>s},{K$:{read:"Reading",write:"Writing",edit:"Editing",ast_edit:"Rewriting AST",ast_grep:"Searching AST",bash:"Running",grep:"Searching",glob:"Finding",task:"Delegating",todo:"Updating plan",hub:"Hub",eval:"Running code",lsp:"Running LSP",debug:"Debugging",github:"GitHub",web_search:"Searching the web",ask:"Asking you",checkpoint:"Checkpointing",rewind:"Rewinding",context_notes:"Updating context notes",new_context:"Starting a fresh context",security_scan:"Scanning for vulnerabilities",manage_skill:"Updating skill",learn:"Recording a lesson",retain:"Retaining memory",recall:"Recalling memory",reflect:"Reflecting",think:"Thinking",yield:"Wrapping up",goal:"Tracking goal"},Qq:{lsp:"Running LSP",ast_edit:"Rewriting AST",ast_grep:"Searching AST",resolve:"Applying edit proposal",reject:"Discarding edit proposal",report_issue:"Reporting tool issue",debug:"Debugging",browser:"Driving the browser"},YT:{read_file:"read",view_file:"read",read_file_content:"read",edit_file:"edit",replace_file_content:"edit",multi_edit_file:"edit",write_to_file:"write",create_file:"write",search_fs:"grep",terminal:"bash",run_command:"bash"},n1:{thinking:"Thinking",writing:"Writing response"}})},zF(e,t,n){n.d(t,{iv:()=>g,tn:()=>m,F:()=>y,nv:()=>v,Eu:()=>k});var i=n("CU"),r=n("he"),a=n("h3"),l=n("g1");let s={typescript:()=>n.e("zn").then(n.bind(n,"tt")),tsx:()=>n.e("ta").then(n.bind(n,"Xl")),javascript:()=>n.e("jsc").then(n.bind(n,"lK")),jsx:()=>n.e("px").then(n.bind(n,"rz")),json:()=>n.e("zj").then(n.bind(n,"BB")),markdown:()=>n.e("2v").then(n.bind(n,"sN")),css:()=>n.e("n").then(n.bind(n,"d2")),bash:()=>Promise.all([n.e(2),n.e(69)]).then(n.bind(n,"ks")),diff:()=>n.e("0w").then(n.bind(n,"SP")),yaml:()=>n.e("ho").then(n.bind(n,"n1")),html:()=>Promise.all([n.e("jsc"),n.e("n"),n.e("aa")]).then(n.bind(n,"w1")),python:()=>n.e("jd").then(n.bind(n,"hE")),go:()=>n.e("cf").then(n.bind(n,"K1")),rust:()=>n.e("hk").then(n.bind(n,"nb")),sql:()=>n.e("r").then(n.bind(n,"le")),toml:()=>n.e("x0").then(n.bind(n,"DJ")),java:()=>n.e("f8").then(n.bind(n,"lj")),c:()=>n.e("4e").then(n.bind(n,"Gd")),cpp:()=>Promise.all([n.e("4e"),n.e("y6")]).then(n.bind(n,"gB")),csharp:()=>n.e("4k").then(n.bind(n,"Ku")),ruby:()=>Promise.all([n.e("jsc"),n.e("n"),n.e("zn"),n.e("aa"),n.e("4e"),n.e("f8"),n.e("r"),n.e("ta"),n.e("y6"),n.e("px"),n.e(2),n.e("yv"),n.e("ct")]).then(n.bind(n,"eV")),php:()=>Promise.all([n.e("jsc"),n.e("n"),n.e("aa"),n.e("f8"),n.e("r"),n.e(4)]).then(n.bind(n,"eZ")),kotlin:()=>n.e("7l").then(n.bind(n,"hR")),swift:()=>n.e(0).then(n.bind(n,"ep")),scala:()=>n.e("js").then(n.bind(n,"h3S")),lua:()=>Promise.all([n.e("4e"),n.e("hd")]).then(n.bind(n,"rF")),perl:()=>Promise.all([n.e("jsc"),n.e("n"),n.e("aa"),n.e("f8"),n.e("r"),n.e("i")]).then(n.bind(n,"cr")),dockerfile:()=>n.e("b").then(n.bind(n,"BZ")),ini:()=>n.e("3p").then(n.bind(n,"BD")),properties:()=>n.e("1b").then(n.bind(n,"LU")),zig:()=>n.e("3u").then(n.bind(n,"p9")),elixir:()=>Promise.all([n.e("jsc"),n.e("n"),n.e("aa"),n.e("jll")]).then(n.bind(n,"xu")),dart:()=>n.e("4q").then(n.bind(n,"Cu")),ocaml:()=>n.e("8j").then(n.bind(n,"uA")),haskell:()=>n.e("a").then(n.bind(n,"IX")),nix:()=>n.e("p").then(n.bind(n,"jG")),hcl:()=>n.e("yq").then(n.bind(n,"ka")),graphql:()=>Promise.all([n.e("jsc"),n.e("zn"),n.e("ta"),n.e("px"),n.e("yv")]).then(n.bind(n,"okl")),solidity:()=>n.e("w").then(n.bind(n,"me")),r:()=>n.e(37).then(n.bind(n,"pO")),julia:()=>Promise.all([n.e("jsc"),n.e("4e"),n.e("r"),n.e("y6"),n.e("jd"),n.e("t9")]).then(n.bind(n,"zu")),erlang:()=>Promise.all([n.e("2v"),n.e("y")]).then(n.bind(n,"EY")),clojure:()=>n.e("3d").then(n.bind(n,"lF")),scheme:()=>n.e("az").then(n.bind(n,"wE")),racket:()=>n.e(8).then(n.bind(n,"aB")),protobuf:()=>n.e("1p").then(n.bind(n,"bT")),makefile:()=>n.e("d").then(n.bind(n,"nt")),powershell:()=>n.e("j").then(n.bind(n,"dQ")),json5:()=>n.e("bq").then(n.bind(n,"VH")),less:()=>n.e("c").then(n.bind(n,"it")),scss:()=>Promise.all([n.e("n"),n.e("x")]).then(n.bind(n,"DD")),sass:()=>n.e("zo").then(n.bind(n,"Bc")),stylus:()=>n.e("ky").then(n.bind(n,"uc")),"objective-c":()=>n.e(7).then(n.bind(n,"BG")),groovy:()=>n.e("7e").then(n.bind(n,"tf")),vue:()=>Promise.all([n.e("jsc"),n.e("n"),n.e("zn"),n.e("aa"),n.e("zx")]).then(n.bind(n,"Z")),svelte:()=>Promise.all([n.e("jsc"),n.e("n"),n.e("zn"),n.e("dp")]).then(n.bind(n,"jIY")),astro:()=>Promise.all([n.e("jsc"),n.e("n"),n.e("zn"),n.e("ta"),n.e("o")]).then(n.bind(n,"CuL")),xml:()=>Promise.all([n.e("f8"),n.e("da")]).then(n.bind(n,"rDW"))},o=["typescript","tsx","javascript","jsx","json","bash","python","markdown","yaml","diff"];var c=n("Eq");let d=null,p=!1,u=new Set;function m(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}async function h(e){await Promise.allSettled(Object.keys(s).map(async t=>{let n=s[t];if(n)try{await e.loadLanguage(n)}catch{}}))}async function b(e){await Promise.all(o.map(async t=>{try{e.codeToHtml("x",{lang:t,theme:c.Gt})}catch{}}))}async function f(){if("u"<typeof window)return null;try{let e=await (0,i.tz)({themes:[a.A,l.A],langs:[],engine:(0,r.l)({forgiving:!0})});d=e,await h(e),await Promise.race([b(e),new Promise(e=>setTimeout(e,1500))]),p=!0;let t=[...u];for(let e of(u.clear(),t))try{e()}catch{}return e}catch(e){return console.error("[shiki] highlighter boot failed",e),null}}let x=null;function g(){return x||(x=f()),x}function v(){return p}function k(e){return p?(e(),()=>{}):(u.add(e),()=>{u.delete(e)})}function y(){return p?d:null}},Eq(e,t,n){let i="one-light";n.d(t,{},{CE:{light:i,dark:"one-dark-pro"},Gt:i})},qg(e,t,n){var i=n("zF"),r=n("Eq");function a(e){if(!e)return"javascript";let t=e.split("?")[0].split("#")[0].replace(/:\d+(?:-\d+)?$/,"");switch(t.split(".").pop()?.toLowerCase()){case"ts":return"typescript";case"tsx":return"tsx";case"js":case"mjs":case"cjs":default:return"javascript";case"jsx":return"jsx";case"json":return"json";case"md":case"markdown":return"markdown";case"css":return"css";case"sh":case"bash":case"zsh":case"env":return"bash";case"diff":case"patch":return"diff";case"yaml":case"yml":return"yaml";case"html":return"html";case"svg":case"xml":return"xml";case"py":return"python";case"go":return"go";case"rs":return"rust";case"sql":return"sql";case"toml":return"toml";case"java":return"java";case"c":case"h":return"c";case"cpp":case"cc":case"hpp":return"cpp";case"cs":return"csharp";case"rb":return"ruby";case"php":return"php";case"kt":case"kts":return"kotlin";case"swift":return"swift";case"scala":return"scala";case"lua":return"lua";case"pl":return"perl";case"dockerfile":return"dockerfile";case"ini":case"cfg":case"conf":return"ini";case"properties":return"properties";case"zig":return"zig";case"ex":case"exs":return"elixir";case"dart":return"dart";case"ml":case"mli":return"ocaml";case"hs":return"haskell";case"nix":return"nix";case"tf":case"tfvars":case"hcl":return"hcl";case"graphql":case"gql":return"graphql";case"sol":return"solidity";case"r":return"r";case"jl":return"julia";case"erl":return"erlang";case"clj":case"cljs":case"cljc":case"edn":return"clojure";case"scm":case"ss":return"scheme";case"rkt":return"racket";case"proto":return"protobuf";case"makefile":case"mk":return"makefile";case"ps1":case"psm1":return"powershell";case"json5":return"json5";case"less":return"less";case"scss":return"scss";case"sass":return"sass";case"styl":return"stylus";case"vue":return"vue";case"svelte":return"svelte";case"astro":return"astro";case"mm":case"m":return"objective-c";case"groovy":case"gvy":case"gradle":return"groovy"}}function l(e){if(!e||e.length<5)return!1;let t=e.trim();if(t.startsWith("{")&&t.endsWith("}")||t.startsWith("[")&&t.endsWith("]"))try{return JSON.parse(t),!0}catch{}return[/^(?:import|export)\s+.+from\s+['"][^'"]+['"]/m,/^(?:const|let|var|function|class|interface|type|enum)\s+[A-Za-z0-9_$]+/m,/(?:=>|\bconsole\.(?:log|error|warn)|return\s+|async\s+function)/,/^\s*\d+:\s*(?:import|const|let|function|\/\/|\/\*|<|[A-Za-z])/m,/^\s*\[[A-Za-z0-9_./-]+\.[a-zA-Z0-9]+\]\s*\n\d+:/m].some(e=>e.test(t))}function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"javascript";if(!e)return"";let n=(0,i.F)();if(!n)return(0,i.tn)(e);let a=n.getLoadedLanguages().includes(t)?t:"javascript";try{return`<span class="shiki">${n.codeToHtml(e,{lang:a,themes:r.CE,defaultColor:!1,structure:"inline"})}</span>`}catch{return(0,i.tn)(e)}}function o(e){return s(e,"json")}function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"javascript",n=e.split("\n");if(!e)return n;let a=(0,i.F)();if(!a)return n.map(i.tn);let l=a.getLoadedLanguages().includes(t)?t:"javascript";try{let{tokens:t}=a.codeToTokens(e,{lang:l,themes:r.CE,defaultColor:!1});if(t.length!==n.length)return n.map(i.tn);return t.map(e=>e.map(e=>{let t=(0,i.tn)(e.content);if(!e.htmlStyle)return t;let n=Object.entries(e.htmlStyle).map(e=>{let[t,n]=e;return`${t}:${n}`}).join(";");return n?`<span style="${n}">${t}</span>`:t}).join(""))}catch{return n.map(i.tn)}}n.d(t,{Bl:()=>function e(t){if(null==t)return{isValid:!1};if("object"==typeof t)try{let e=JSON.stringify(t,null,2),n=e.split("\n").length;return{isValid:!0,data:t,pretty:e,linesCount:n}}catch{return{isValid:!1}}if("string"!=typeof t)return{isValid:!1};let n=t.trim();if(!n)return{isValid:!1};let i=n.match(/^```(?:json)?\s*([\s\S]*?)\s*```$/i);i&&(n=i[1].trim());let r=n.match(/^(?:user\s+(?:selected|responded|answered|response)|response|result|output):\s*([\s\S]+)$/i);if(r){let e=r[1].trim();(e.startsWith("{")&&e.endsWith("}")||e.startsWith("[")&&e.endsWith("]"))&&(n=e)}if(n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'"))try{let t=JSON.parse(n);if("object"==typeof t&&null!==t){let e=JSON.stringify(t,null,2);return{isValid:!0,data:t,pretty:e,linesCount:e.split("\n").length}}if("string"==typeof t){let n=e(t);if(n.isValid)return n}}catch{}if(n.startsWith("{")||n.startsWith("["))try{let e=JSON.parse(n);if(null!==e&&"object"==typeof e){let t=JSON.stringify(e,null,2),n=t.split("\n").length;return{isValid:!0,data:e,pretty:t,linesCount:n}}}catch{}let a=n.indexOf("{"),l=n.lastIndexOf("}");if(-1!==a&&l>a){let e=n.slice(a,l+1);try{let t=JSON.parse(e);if(null!==t&&"object"==typeof t){let e=JSON.stringify(t,null,2);return{isValid:!0,data:t,pretty:e,linesCount:e.split("\n").length}}}catch{}}let s=n.indexOf("["),o=n.lastIndexOf("]");if(-1!==s&&o>s){let e=n.slice(s,o+1);try{let t=JSON.parse(e);if(Array.isArray(t)){let e=JSON.stringify(t,null,2);return{isValid:!0,data:t,pretty:e,linesCount:e.split("\n").length}}}catch{}}return{isValid:!1}},O9:()=>c,PH:()=>o,rw:()=>l,sQ:()=>a,wY:()=>s})},LQ(e,t,n){function i(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n="M",i="Modified",r="text-info",a="bg-info/10 text-info border-info/25",l=(e||"").trim().toUpperCase();if(t){let e=l[0]||"M";"A"===e?(n="A",i="Added (Staged)",r="text-success",a="bg-success/10 text-success border-success/25"):"D"===e?(n="D",i="Deleted (Staged)",r="text-error",a="bg-error/10 text-error border-error/25"):"R"===e?(n="R",i="Renamed (Staged)",r="text-meta",a="bg-meta/10 text-meta border-meta/25"):"U"===e||"?"===e?(n="U",i="Untracked",r="text-success",a="bg-success/10 text-success border-success/25"):(n="M",i="Modified (Staged)",r="text-info",a="bg-info/10 text-info border-info/25")}else if("??"===l||"?"===l||"U"===l||"UNTRACKED"===l)n="U",i="Untracked",r="text-success",a="bg-success/10 text-success border-success/25";else{let e=l[1]||l[0]||"M";"A"===e?(n="A",i="Added",r="text-success",a="bg-success/10 text-success border-success/25"):"D"===e?(n="D",i="Deleted",r="text-error",a="bg-error/10 text-error border-error/25"):"R"===e?(n="R",i="Renamed",r="text-meta",a="bg-meta/10 text-meta border-meta/25"):"U"===e||"?"===e?(n="U",i="Untracked",r="text-success",a="bg-success/10 text-success border-success/25"):(n="M",i="Modified",r="text-info",a="bg-info/10 text-info border-info/25")}return{charStatus:n,label:i,colorClass:r,badgeBgClass:a,isStaged:t}}function r(e){let t=new Map,n=new Map;if(!Array.isArray(e))return{fileMap:t,folderMap:n};for(let i of e){if(!i||!i.file)continue;let e=i.file.replace(/^\/+/,"");t.set(e,i);let r=e.split("/");r.pop();let a="";for(let e of r){a=a?`${a}/${e}`:e;let t=n.get(a)||{count:0,hasModified:!1,hasUntracked:!1,hasStaged:!1,hasDeleted:!1,colorClass:"text-info"};t.count+=1,(i.staged||i.status&&" "!==i.status[0]&&"?"!==i.status[0])&&(t.hasStaged=!0),"??"===i.status?t.hasUntracked=!0:i.status?.includes("D")?t.hasDeleted=!0:t.hasModified=!0,t.hasModified||t.hasStaged?t.colorClass="text-info":t.hasUntracked?t.colorClass="text-success":t.hasDeleted&&(t.colorClass="text-error"),n.set(a,t)}}return{fileMap:t,folderMap:n}}n.d(t,{R:()=>i,_:()=>r})},ok(e,t,n){var i=n("L");let r=["math","annotation","annotation-xml","semantics","mrow","mi","mn","mo","mspace","ms","mtext","mroot","mfrac","msqrt","mstyle","merror","mpadded","mphantom","mtable","mtr","mtd","mlabeledtr","munder","mover","munderover","msup","msub","msubsup","mtext","mtd","menclose"],a=["svg","path","polyline","rect","circle","line"],l=["viewBox","d","points","x","y","x1","y1","x2","y2","width","height","rx","ry","cx","cy","r","fill","stroke","stroke-width","stroke-linecap","stroke-linejoin","xmlns","aria-hidden","aria-label"],s=["svg","g","line","path","rect","circle","ellipse","polygon","polyline","text","tspan","title","desc","marker","defs","style","use","symbol","foreignObject","html","head","body","div","span","p","br","img"],o=["id","class","style","transform","viewBox","width","height","xmlns","x","y","x1","y1","x2","y2","cx","cy","r","rx","ry","d","points","fill","stroke","stroke-width","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-opacity","fill-opacity","opacity","font-family","font-size","font-weight","font-style","text-anchor","dominant-baseline","alignment-baseline","text-decoration","direction","marker-end","marker-start","marker-mid","markerWidth","markerHeight","refX","refY","orient","markerUnits","preserveAspectRatio","version","dx","dy","dy1","dy2","rowspan","colspan","start","aria-roledescription","aria-describedby","role","aria-hidden","aria-label","data-mermaid-theme","overflow","visibility","rel","src","alt"],c=["href","xlink:href"];function d(e){if(!e||"u"<typeof window||!window.document)return e;let t=/<svg[^>]*>/.test(e),n=/class="[^"]*katex/.test(e)||t?{USE_PROFILES:{html:!0,mathMl:!0},ADD_TAGS:[...r,...t?a:[]],ADD_ATTR:["aria-hidden","aria-label","encoding","nonce",...t?l:[]]}:{USE_PROFILES:{html:!0}};try{return i.A.sanitize(e,n)}catch{return e}}function p(e){if(!e||"u"<typeof window||!window.document)return e;let t=/href/.test(e);try{return i.A.sanitize(e,{USE_PROFILES:{html:!0,svg:!0,svgFilters:!0},ADD_TAGS:s,ADD_ATTR:[...o,...t?c:[]],HTML_INTEGRATION_POINTS:{"annotation-xml":!0,foreignobject:!0}})}catch{return e}}n.d(t,{V:()=>p,p:()=>d})},e(e,t,n){let i=["input","_input","patch"],r=/#([0-9a-fA-F]{4})$/,a=/^(PUT|CUT)\b/;function l(e){let t=e[0];return e.length>=2&&('"'===t||"'"===t)&&t===e[e.length-1]?e.slice(1,-1):e}function s(e){if(e)for(let t of i){let n=e[t];if("string"!=typeof n)continue;let i=function(e){let t,n=[];for(let i of e.replace(/^\uFEFF/,"").split("\n")){let e=i.endsWith("\r")?i.slice(0,-1):i,s=function(e){let t=e.trimEnd();if(!t.startsWith("["))return;let n=(t.endsWith("]")?t.slice(1,-1):t.slice(1)).trim(),i=r.exec(n),a=l((i?n.slice(0,i.index):n).trim());return a?{path:a,tag:i?.[1]}:void 0}(e);if(s){t={path:s.path,tag:s.tag,removed:!1,ops:[]},n.push(t);continue}if(!t)continue;let o=e.trim();if("REM"===o){t.removed=!0;continue}if(o.startsWith("MV ")){t.moveTo=l(o.slice(3).trim())||void 0;continue}if(a.test(o)){t.ops.push({verb:o.slice(0,3),spec:o.slice(3).trim().replace(/:$/,""),body:[]});continue}let c=t.ops[t.ops.length-1];c&&e.startsWith("+")&&c.body.push(e)}return n}(n);if(i.length>0)return{text:n,sections:i}}}function o(e){return s(e)?.sections[0].path}n.d(t,{I:()=>s,f$:()=>o})},So(e,t,n){let i="omp_chamber_settings",r=null,a={};function l(e){a={...e?.[i]??{}};let t={...e??{}};delete t[i],r={...t,...a}}function s(e){return r||l(e),r??{}}function o(e,t){let n=Array.isArray(e)?e:[e],i=s(t);for(let e of n)if(void 0!==i[e])return i[e]}function c(e,t){return s(t),{...e,...a}}function d(e,t){r={...s(),[e]:t},u({[e]:t})}function p(e){a={...a,...e},r={...s(),...e},u({[i]:a})}function u(e){fetch("/api/settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).catch(()=>{})}n.d(t,{BF:()=>o,cm:()=>c,cz:()=>d,l1:()=>p,x9:()=>l})},oS(e,t,n){function i(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}n.d(t,{u:()=>i})},SS(e,t,n){let i=new Map,r=new Map,a=new Set,l=new Map,s=new Map;function o(e){let t=i.get(e);void 0!==t&&(i.delete(e),i.set(e,t)),r.set(e,Date.now())}function c(e){let t=Date.now(),n=e=>{i.delete(e),a.delete(e),l.delete(e),r.delete(e);let t=s.get(e);t&&(clearTimeout(t),s.delete(e))};for(let[i,a]of r)!(t-a<=6e5)&&i!==e&&(l.get(i)||n(i));for(;i.size>10;){let t=!1;for(let r of i.keys())if(r!==e&&!l.get(r)){n(r),t=!0;break}if(!t)break}}function d(e,t){if(e)return o(e),i.get(e)?.[t]}function p(e,t,n){if(!e)return;let r=i.get(e)??{};r[t]=n,i.set(e,r),o(e),l.set(e,!0),u(e),c(e)}function u(e){let t=s.get(e);t&&clearTimeout(t),s.set(e,setTimeout(()=>{s.delete(e),m(e)},600))}async function m(e){if("u"<typeof window||!e||!l.get(e))return;l.set(e,!1);let t=i.get(e)??{};try{await fetch(`/api/sessions/${encodeURIComponent(e)}/state`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({state:t})})}catch(t){console.warn("session-state persist failed:",t),l.set(e,!0)}}function h(e){if(!e||"u"<typeof window)return Promise.resolve();let t=s.get(e);return t&&(clearTimeout(t),s.delete(e)),m(e)}async function b(e){if(e){if("u"<typeof window)return void a.add(e);try{let t=await fetch(`/api/sessions/${encodeURIComponent(e)}/state`);if(t.ok){let n=await t.json(),r=n.state&&"object"==typeof n.state?n.state:{},a=i.get(e)??{},s=!0===l.get(e)?{...r,...a}:r;i.set(e,s),o(e)}}catch(e){console.warn("session-state load failed:",e)}a.add(e),c(e)}}function f(e,t){e&&(i.set(e,{...i.get(e)??{},...t}),o(e),a.add(e),c(e))}function x(e){e&&a.add(e)}function g(e){e&&r.set(e,Date.now())}function v(e){return r.get(e)}function k(e,t){let n=i.get(e);n&&i.set(t,{...n,...i.get(t)??{}}),o(t),a.add(t),l.set(t,!0),u(t),i.delete(e),a.delete(e),l.delete(e),r.delete(e),c(t)}n.d(t,{D4:()=>h,E9:()=>f,L6:()=>b,R7:()=>v,WV:()=>d,Y1:()=>g,l5:()=>x,qI:()=>p,vy:()=>k})}},l={};function s(e){var t=l[e];if(void 0!==t)return t.exports;var n=l[e]={exports:{}};return a[e].call(n.exports,n,n.exports,s),n.exports}s.m=a,s.d=(e,t,n)=>{var i=(t,n)=>{for(var i in t)s.o(t,i)&&!s.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,[n]:t[i]})};i(t,"get"),i(n,"value")},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce((t,n)=>(s.f[n](e,t),t),[])),s.u=e=>"static/js/async/"+e+"."+({0:"8e59f2eb5b","0k":"5852e6b4fa","0w":"9ed36d5860",1:"f387c12b63",12:"d091f91c99",13:"8f810a8a6c",19:"6fe909d55a","1b":"23f1141a38","1k":"544adbf77d","1p":"0d5cddda96",2:"b589f1733b","2v":"96165101de",3:"0cacc08423",37:"b28b2f61cd","3d":"5085fb913f","3j":"a2fcea99be","3p":"bcf32a0983","3r":"3a69e98ee0","3u":"1228460e2a","3y":"22075aa079",4:"9442eeb472","4e":"678285ca55","4k":"33a0c7eeb4","4q":"aad20dab25",5:"ebaf8b89cc",51:"1938cec320","5b":"d88304bc13","5j":"d6407c4248","5o":"88316d4460",6:"7929428505",66:"5dfa29f957",69:"a18a10882f","6o":"5b1a06a382",7:"e4a9288dd0",73:"50280ce58d","7e":"a1cc9bfd88","7l":"7a6a377ecc",8:"5067439d8c","8j":"ea110663fb",a:"bce4542392",aa:"65d3852576",ar:"9dc8b1992a",az:"d656062b0f",b:"b4f6f06515",bi:"cbfe8eaa8e",bq:"586bc738d1",c:"cd45b0ac45",c0:"0af1e640d3",ca:"8a52cfd447",cf:"d34fff5d67",ct:"38d9da8a5a",cx:"ca5feec570",d:"a5fc8fe1b3",da:"f62c70f6c8",dp:"1725d6432c",e:"93214d622b",f:"ab50467719",f8:"bbf0dbae70",fw:"fb1a08b92d",h:"4e790471e4",h1:"e8d5aa8e80",h3:"216e9798ab",hd:"0da931b622",hk:"ba7fb04d41",hn:"7568bdb58b",ho:"475a5e1ae4",hp:"e9fe2e395a",hs:"6d480d0ded",i:"7c148e8440",id:"573df20f29",j:"ab925882d8",jd:"63886a1f09",jg:"69a4beade8",jl:"874d352278",jll:"11313b455a",js:"67182759ef",jsc:"23b70d6f40",jse:"334588ff5d",jz:"72eb929106",k:"e878dd350f",ka:"c1990ecaa3",ku:"29c8a59d0c",ky:"8dab1dade0",l:"102a97fce6",l6:"45f3b62e15",l9:"949710adaf",m:"3fc017a055",me:"8ace414f80",mt:"0352e976d8",n:"a9f1c51701",na:"a36cd532d6",nk:"6de011832e",o:"36353dfb88",oc:"9c060c9779",og:"ae7acf03ac",p:"48ecfcd14e",px:"783b6f91f2",q:"0b6fb9bf8d",q5:"e683f7c26e",qs:"2a9ddb3c72",r:"51010ad87c",rd:"b77011ab7f",rf:"cfbde7f744",s:"c7d521a8ae",sy:"7345abcd67",t:"0dcb01dfde",t9:"d44f57d518",ta:"973534bbec",ty:"3d93cf5f5f",u:"0871ac5b22",up:"ea990da0ff",uw:"8890abbabc",v:"5c7a4b087b",vn:"e98e2f3b61",vp:"9b13bf8610",vu:"311f1d202c",w:"08ac210f60",wt:"ad92393a90",x:"563f72ca6b",x0:"475516418f",x1:"da8687159b",xl:"a3c562a58c",xn:"afecebbbd9",y:"1a9ed7a5d8",y6:"43c57defe4",yb:"8c1342401d",ybq:"4491f2f2dc",yg:"9bd4e09ecb",yq:"917ddd7ba2",ys:"00687cf82d",yv:"593a3f7d54",z:"56f61a4374",zi:"5fdb07b86a",zj:"654f37e8ff",zn:"966d6f1cc6",zo:"26213b40c0",zx:"e9f4105e00"})[e]+".js",s.miniCssF=e=>""+e+".css",s.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}})(),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},s.l=function(t,n,i,r){if(e[t])return void e[t].push(n);if(void 0!==i)for(var a,l,o=document.getElementsByTagName("script"),c=0;c<o.length;c++){var d=o[c];if(d.getAttribute("src")==t||d.getAttribute("data-rspack")=="ompchamber:"+i){a=d;break}}a||(l=!0,(a=document.createElement("script")).timeout=120,s.nc&&a.setAttribute("nonce",s.nc),a.setAttribute("data-rspack","ompchamber:"+i),a.src=t),e[t]=[n];var p=function(n,i){a.onerror=a.onload=null,clearTimeout(u);var r=e[t];if(delete e[t],a.parentNode&&a.parentNode.removeChild(a),r&&r.forEach(function(e){return e(i)}),n)return n(i)},u=setTimeout(p.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=p.bind(null,a.onerror),a.onload=p.bind(null,a.onload),l&&document.head.appendChild(a)},s.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t=[],s.O=(e,n,i,r)=>{if(n){r=r||0;for(var a=t.length;a>0&&t[a-1][2]>r;a--)t[a]=t[a-1];t[a]=[n,i,r];return}for(var l=1/0,a=0;a<t.length;a++){for(var[n,i,r]=t[a],o=!0,c=0;c<n.length;c++)(!1&r||l>=r)&&Object.keys(s.O).every(e=>s.O[e](n[c]))?n.splice(c--,1):(o=!1,r<l&&(l=r));if(o){t.splice(a--,1);var d=i();void 0!==d&&(e=d)}}return e},s.p="/",n={qz:0},s.f.j=function(e,t){var i=s.o(n,e)?n[e]:void 0;if(0!==i)if(i)t.push(i[2]);else{var r=new Promise((t,r)=>i=n[e]=[t,r]);t.push(i[2]=r);var a=s.p+s.u(e),l=Error();s.l(a,function(t){if(s.o(n,e)&&(0!==(i=n[e])&&(n[e]=void 0),i)){var r=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;l.message="Loading chunk "+e+" failed.\n("+r+": "+a+")",l.name="ChunkLoadError",l.type=r,l.request=a,i[1](l)}},"chunk-"+e,e)}},s.O.j=e=>0===n[e],i=(e,t)=>{var i,r,[a,l,o]=t,c=0;if(a.some(e=>0!==n[e])){for(i in l)s.o(l,i)&&(s.m[i]=l[i]);if(o)var d=o(s)}for(e&&e(t);c<a.length;c++)r=a[c],s.o(n,r)&&n[r]&&n[r][0](),n[r]=0;return s.O(d)},(r=self.rspackChunkompchamber=self.rspackChunkompchamber||[]).forEach(i.bind(null,0)),r.push=i.bind(null,r.push.bind(r));var o=s.O(void 0,["121","a3","9","g"],()=>s("b"));o=s.O(o)})();
|