@cdoing/opentuicli 0.1.19 → 0.1.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/esbuild.config.cjs +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
1
2
|
var br=Object.defineProperty;var Je=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(n,o)=>(typeof require<"u"?require:n)[o]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var K=(e,n)=>()=>(e&&(n=e(e=0)),n);var pr=(e,n)=>{for(var o in n)br(e,o,{get:n[o],enumerable:!0})};var Sn,vn,Gt=K(()=>{Sn=e=>{let n,o=new Set,t=(h,b)=>{let d=typeof h=="function"?h(n):h;if(!Object.is(d,n)){let D=n;n=b??(typeof d!="object"||d===null)?d:Object.assign({},n,d),o.forEach(y=>y(n,D))}},i=()=>n,a={setState:t,getState:i,getInitialState:()=>l,subscribe:h=>(o.add(h),()=>o.delete(h))},l=n=e(t,i,a);return a},vn=(e=>e?Sn(e):Sn)});import St from"react";function Sr(e,n=yr){let o=St.useSyncExternalStore(e.subscribe,St.useCallback(()=>n(e.getState()),[e,n]),St.useCallback(()=>n(e.getInitialState()),[e,n]));return St.useDebugValue(o),o}var yr,wn,Dn,kn=K(()=>{Gt();yr=e=>e;wn=e=>{let n=vn(e),o=t=>Sr(n,t);return Object.assign(o,n),o},Dn=(e=>e?wn(e):wn)});var Cn=K(()=>{Gt();kn()});function Wt(e,n){let o;try{o=e()}catch{return}return{getItem:i=>{var r;let c=l=>l===null?null:JSON.parse(l,n?.reviver),a=(r=o.getItem(i))!=null?r:null;return a instanceof Promise?a.then(c):c(a)},setItem:(i,r)=>o.setItem(i,JSON.stringify(r,n?.replacer)),removeItem:i=>o.removeItem(i)}}var Ut,vr,Mn,Tn=K(()=>{Ut=e=>n=>{try{let o=e(n);return o instanceof Promise?o:{then(t){return Ut(t)(o)},catch(t){return this}}}catch(o){return{then(t){return this},catch(t){return Ut(t)(o)}}}},vr=(e,n)=>(o,t,i)=>{let r={storage:Wt(()=>window.localStorage),partialize:f=>f,version:0,merge:(f,g)=>({...g,...f}),...n},c=!1,a=0,l=new Set,h=new Set,b=r.storage;if(!b)return e((...f)=>{console.warn(`[zustand persist middleware] Unable to update item '${r.name}', the given storage is currently unavailable.`),o(...f)},t,i);let d=()=>{let f=r.partialize({...t()});return b.setItem(r.name,{state:f,version:r.version})},D=i.setState;i.setState=(f,g)=>(D(f,g),d());let y=e((...f)=>(o(...f),d()),t,i);i.getInitialState=()=>y;let k,N=()=>{var f,g;if(!b)return;let T=++a;c=!1,l.forEach(R=>{var F;return R((F=t())!=null?F:y)});let I=((g=r.onRehydrateStorage)==null?void 0:g.call(r,(f=t())!=null?f:y))||void 0;return Ut(b.getItem.bind(b))(r.name).then(R=>{if(R)if(typeof R.version=="number"&&R.version!==r.version){if(r.migrate){let F=r.migrate(R.state,R.version);return F instanceof Promise?F.then(L=>[!0,L]):[!0,F]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,R.state];return[!1,void 0]}).then(R=>{var F;if(T!==a)return;let[L,v]=R;if(k=r.merge(v,(F=t())!=null?F:y),o(k,!0),L)return d()}).then(()=>{T===a&&(I?.(t(),void 0),k=t(),c=!0,h.forEach(R=>R(k)))}).catch(R=>{T===a&&I?.(void 0,R)})};return i.persist={setOptions:f=>{r={...r,...f},f.storage&&(b=f.storage)},clearStorage:()=>{b?.removeItem(r.name)},getOptions:()=>r,rehydrate:()=>N(),hasHydrated:()=>c,onHydrate:f=>(l.add(f),()=>{l.delete(f)}),onFinishHydration:f=>(h.add(f),()=>{h.delete(f)})},r.skipHydration||N(),k||y},Mn=vr});import*as fe from"fs";import*as vt from"path";import*as $n from"os";var ke,wr,se,qt=K(()=>{"use strict";Cn();Tn();ke=vt.join($n.homedir(),".cdoing","tui-settings.json"),wr={getItem:e=>{try{if(!fe.existsSync(ke))return null;let n=JSON.parse(fe.readFileSync(ke,"utf-8"));return JSON.stringify(n[e]??null)}catch{return null}},setItem:(e,n)=>{try{let o=vt.dirname(ke);fe.existsSync(o)||fe.mkdirSync(o,{recursive:!0});let t={};try{fe.existsSync(ke)&&(t=JSON.parse(fe.readFileSync(ke,"utf-8")))}catch{}t[e]=JSON.parse(n),fe.writeFileSync(ke,JSON.stringify(t,null,2),"utf-8")}catch{}},removeItem:e=>{try{if(!fe.existsSync(ke))return;let n=JSON.parse(fe.readFileSync(ke,"utf-8"));delete n[e],fe.writeFileSync(ke,JSON.stringify(n,null,2),"utf-8")}catch{}}},se=Dn()(Mn(e=>({themeId:"vercel",mode:"dark",syncTerminalBg:!0,sidebarMode:"auto",provider:"anthropic",model:"",setThemeId:n=>e({themeId:n}),setMode:n=>e({mode:n}),setSyncTerminalBg:n=>e({syncTerminalBg:n}),setSidebarMode:n=>e({sidebarMode:n}),setProvider:n=>e({provider:n}),setModel:n=>e({model:n})}),{name:"tui-settings",storage:Wt(()=>wr),partialize:e=>({themeId:e.themeId,mode:e.mode,syncTerminalBg:e.syncTerminalBg,sidebarMode:e.sidebarMode,provider:e.provider,model:e.model})}))});import{RGBA as Kt,rgbToHex as Dr,SyntaxStyle as kr}from"@opentui/core";import{createContext as Cr,useContext as Mr,useState as rt,useEffect as Tr,useRef as wt,useMemo as $r}from"react";import{jsx as Rr}from"@opentui/react/jsx-runtime";function Z(e){return Kt.fromHex(e)}function _(e){return{text:Z(e.text),textMuted:Z(e.textMuted),textDim:Z(e.textDim),primary:Z(e.primary),secondary:Z(e.secondary),success:Z(e.success),error:Z(e.error),warning:Z(e.warning),info:Z(e.info),border:Z(e.border),borderFocused:Z(e.primary),bg:Z(e.bg),bgSubtle:Z(e.bgSubtle),userText:Z(e.success),assistantText:Z(e.text),systemText:Z(e.warning),toolText:Z(e.textMuted),toolRunning:Z(e.warning),toolDone:Z(e.success),toolError:Z(e.error),diffAdd:Z(e.diffAdd||e.success),diffRemove:Z(e.diffRemove||e.error),diffHunk:Z(e.info)}}function An(){return Object.keys(Ye).sort((e,n)=>e==="default"?-1:n==="default"?1:e.localeCompare(n))}function Re(e,n){let o=Ye[e]||Ye.default;return n==="light"?o.light:o.dark}function Ar(e,n,o){let[t,i,r]=[e,n,o].map(c=>{let a=c/255;return a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4)});return .2126*t+.7152*i+.0722*r}function Or(){return new Promise(e=>{if(!process.stdin.isTTY||!process.stdout.isTTY){e(null);return}let n=setTimeout(()=>{i(),e(null)},500),o="",t=c=>{o+=c.toString();let a=o.match(/\x1b\]11;rgb:([0-9a-fA-F]{2,4})\/([0-9a-fA-F]{2,4})\/([0-9a-fA-F]{2,4})/);if(a){i();let l=h=>h.length<=2?parseInt(h,16):Math.round(parseInt(h,16)/65535*255);e({r:l(a[1]),g:l(a[2]),b:l(a[3])})}},i=()=>{clearTimeout(n),process.stdin.removeListener("data",t),r===!1&&process.stdin.setRawMode(!1)},r=process.stdin.isRaw;try{process.stdin.setRawMode(!0)}catch{e(null);return}process.stdin.on("data",t),process.stdout.write("\x1B]11;?\x07")})}function Pr(){let e=process.env.COLORFGBG;if(e){let n=e.split(";");if(parseInt(n[n.length-1]||"0",10)>8)return"light"}return"dark"}async function On(){if(it)return it;let e=await Or();return e?it=Ar(e.r,e.g,e.b)>.5?"light":"dark":it=Pr(),it}function Ve(e){if(!process.stdout.isTTY)return;let n=Dr(e);process.stdout.write(`\x1B]11;${n}\x07`)}function Dt(){process.stdout.isTTY&&process.stdout.write("\x1B]111;\x07")}function Ir(e){return kr.fromStyles({default:{fg:e.text},"markup.heading.1":{fg:e.primary,bold:!0},"markup.heading.2":{fg:e.primary,bold:!0},"markup.heading.3":{fg:e.info,bold:!0},"markup.heading.4":{fg:e.info,bold:!0},"markup.heading.5":{fg:e.info},"markup.heading.6":{fg:e.info},"markup.bold":{bold:!0},"markup.italic":{italic:!0},"markup.list":{fg:e.warning},"markup.link":{fg:e.info,underline:!0},"markup.raw":{fg:e.warning},"markup.quote":{fg:e.textMuted,italic:!0},keyword:{fg:e.secondary,bold:!0},"keyword.control":{fg:e.secondary,bold:!0},"keyword.operator":{fg:e.secondary},string:{fg:e.success},"string.quoted":{fg:e.success},comment:{fg:e.textDim,italic:!0},"comment.line":{fg:e.textDim,italic:!0},"comment.block":{fg:e.textDim,italic:!0},constant:{fg:e.warning},"constant.numeric":{fg:e.warning},number:{fg:e.warning},variable:{fg:e.text},"variable.parameter":{fg:e.text},function:{fg:e.info},"entity.name.function":{fg:e.info},"support.function":{fg:e.info},type:{fg:e.primary},"entity.name.type":{fg:e.primary},"support.type":{fg:e.primary},operator:{fg:e.textMuted},punctuation:{fg:e.textMuted}})}function In(e){let n=e.mode==="light"?"light":e.mode==="auto"&&e.detectedMode||"dark",o=e.themeId||"vercel",[t,i]=rt(o),[r,c]=rt(n),[a,l]=rt(Re(o,n)),[h,b]=rt(e.syncTerminalBg??!1),[d,D]=rt(null),y=wt(h);y.current=h;let k=wt(d);k.current=d;let N=wt(r);N.current=r;let f=wt(t);f.current=t;let g=v=>{y.current&&(k.current?Ve(Kt.fromHex(k.current)):Ve(v.bg))},T=v=>{i(v),f.current=v;let M=Re(v,N.current);l(M),g(M),se.getState().setThemeId(v)},I=v=>{c(v),N.current=v;let M=Re(f.current,v);l(M),g(M),se.getState().setMode(v)},R=v=>{D(v),k.current=v,y.current&&Ve(v?Kt.fromHex(v):Re(f.current,N.current).bg)},F=v=>{if(b(v),y.current=v,v){let M=Re(f.current,N.current);g(M)}else Dt();se.getState().setSyncTerminalBg(v)};Tr(()=>{if(y.current){let v=Re(o,n);g(v)}return()=>{y.current&&Dt()}},[]);let L=$r(()=>Ir(a),[a]);return Rr(Pn.Provider,{value:{theme:a,themeId:t,mode:r,syntaxStyle:L,customBg:d,setThemeId:T,setMode:I,setCustomBg:R,syncTerminalBg:h,setSyncTerminalBg:F},children:e.children})}function G(){let e=Mr(Pn);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}var Ye,it,Pn,te=K(()=>{"use strict";qt();Ye={default:{name:"Default",dark:_({bg:"#000000",bgSubtle:"#111111",text:"#e5e7eb",textMuted:"#9ca3af",textDim:"#6b7280",primary:"#06b6d4",secondary:"#8b5cf6",success:"#22c55e",error:"#ef4444",warning:"#eab308",info:"#3b82f6",border:"#374151"}),light:_({bg:"#ffffff",bgSubtle:"#f3f4f6",text:"#1f2937",textMuted:"#6b7280",textDim:"#9ca3af",primary:"#0891b2",secondary:"#7c3aed",success:"#16a34a",error:"#dc2626",warning:"#ca8a04",info:"#2563eb",border:"#d1d5db"})},catppuccin:{name:"Catppuccin",dark:_({bg:"#1e1e2e",bgSubtle:"#313244",text:"#cdd6f4",textMuted:"#a6adc8",textDim:"#6c7086",primary:"#89b4fa",secondary:"#cba6f7",success:"#a6e3a1",error:"#f38ba8",warning:"#f9e2af",info:"#74c7ec",border:"#45475a"}),light:_({bg:"#eff1f5",bgSubtle:"#e6e9ef",text:"#4c4f69",textMuted:"#6c6f85",textDim:"#9ca0b0",primary:"#1e66f5",secondary:"#8839ef",success:"#40a02b",error:"#d20f39",warning:"#df8e1d",info:"#04a5e5",border:"#ccd0da"})},dracula:{name:"Dracula",dark:_({bg:"#282a36",bgSubtle:"#44475a",text:"#f8f8f2",textMuted:"#6272a4",textDim:"#44475a",primary:"#bd93f9",secondary:"#ff79c6",success:"#50fa7b",error:"#ff5555",warning:"#f1fa8c",info:"#8be9fd",border:"#44475a"}),light:_({bg:"#f8f8f2",bgSubtle:"#e6e6e6",text:"#282a36",textMuted:"#6272a4",textDim:"#999999",primary:"#7c3aed",secondary:"#d946ef",success:"#16a34a",error:"#dc2626",warning:"#ca8a04",info:"#0891b2",border:"#d1d5db"})},nord:{name:"Nord",dark:_({bg:"#2e3440",bgSubtle:"#3b4252",text:"#eceff4",textMuted:"#d8dee9",textDim:"#4c566a",primary:"#88c0d0",secondary:"#b48ead",success:"#a3be8c",error:"#bf616a",warning:"#ebcb8b",info:"#81a1c1",border:"#434c5e"}),light:_({bg:"#eceff4",bgSubtle:"#e5e9f0",text:"#2e3440",textMuted:"#4c566a",textDim:"#7b88a1",primary:"#5e81ac",secondary:"#b48ead",success:"#a3be8c",error:"#bf616a",warning:"#ebcb8b",info:"#81a1c1",border:"#d8dee9"})},tokyonight:{name:"Tokyo Night",dark:_({bg:"#1a1b26",bgSubtle:"#24283b",text:"#c0caf5",textMuted:"#a9b1d6",textDim:"#565f89",primary:"#7aa2f7",secondary:"#bb9af7",success:"#9ece6a",error:"#f7768e",warning:"#e0af68",info:"#7dcfff",border:"#3b4261"}),light:_({bg:"#d5d6db",bgSubtle:"#cbccd1",text:"#343b58",textMuted:"#565a6e",textDim:"#9699a3",primary:"#34548a",secondary:"#5a4a78",success:"#485e30",error:"#8c4351",warning:"#8f5e15",info:"#0f4b6e",border:"#b4b5b9"})},gruvbox:{name:"Gruvbox",dark:_({bg:"#282828",bgSubtle:"#3c3836",text:"#ebdbb2",textMuted:"#a89984",textDim:"#665c54",primary:"#fabd2f",secondary:"#d3869b",success:"#b8bb26",error:"#fb4934",warning:"#fe8019",info:"#83a598",border:"#504945"}),light:_({bg:"#fbf1c7",bgSubtle:"#f2e5bc",text:"#3c3836",textMuted:"#7c6f64",textDim:"#a89984",primary:"#b57614",secondary:"#8f3f71",success:"#79740e",error:"#9d0006",warning:"#af3a03",info:"#427b58",border:"#d5c4a1"})},rosepine:{name:"Ros\xE9 Pine",dark:_({bg:"#191724",bgSubtle:"#1f1d2e",text:"#e0def4",textMuted:"#908caa",textDim:"#6e6a86",primary:"#c4a7e7",secondary:"#ebbcba",success:"#31748f",error:"#eb6f92",warning:"#f6c177",info:"#9ccfd8",border:"#26233a"}),light:_({bg:"#faf4ed",bgSubtle:"#f2e9e1",text:"#575279",textMuted:"#797593",textDim:"#9893a5",primary:"#907aa9",secondary:"#d7827e",success:"#286983",error:"#b4637a",warning:"#ea9d34",info:"#56949f",border:"#dfdad9"})},monokai:{name:"Monokai",dark:_({bg:"#272822",bgSubtle:"#3e3d32",text:"#f8f8f2",textMuted:"#75715e",textDim:"#49483e",primary:"#66d9ef",secondary:"#ae81ff",success:"#a6e22e",error:"#f92672",warning:"#e6db74",info:"#66d9ef",border:"#49483e"}),light:_({bg:"#fafafa",bgSubtle:"#f0f0f0",text:"#272822",textMuted:"#75715e",textDim:"#b0b0b0",primary:"#0096d1",secondary:"#7c3aed",success:"#629e25",error:"#c4265e",warning:"#b5a21d",info:"#0096d1",border:"#d0d0d0"})},solarized:{name:"Solarized",dark:_({bg:"#002b36",bgSubtle:"#073642",text:"#839496",textMuted:"#657b83",textDim:"#586e75",primary:"#268bd2",secondary:"#6c71c4",success:"#859900",error:"#dc322f",warning:"#b58900",info:"#2aa198",border:"#073642"}),light:_({bg:"#fdf6e3",bgSubtle:"#eee8d5",text:"#657b83",textMuted:"#839496",textDim:"#93a1a1",primary:"#268bd2",secondary:"#6c71c4",success:"#859900",error:"#dc322f",warning:"#b58900",info:"#2aa198",border:"#eee8d5"})},amoled:{name:"AMOLED",dark:_({bg:"#000000",bgSubtle:"#0a0a0a",text:"#ffffff",textMuted:"#888888",textDim:"#555555",primary:"#00e5ff",secondary:"#e040fb",success:"#00e676",error:"#ff1744",warning:"#ffea00",info:"#40c4ff",border:"#222222"}),light:_({bg:"#ffffff",bgSubtle:"#f5f5f5",text:"#000000",textMuted:"#666666",textDim:"#aaaaaa",primary:"#0097a7",secondary:"#7b1fa2",success:"#2e7d32",error:"#c62828",warning:"#f9a825",info:"#0277bd",border:"#e0e0e0"})},github:{name:"GitHub",dark:_({bg:"#0d1117",bgSubtle:"#161b22",text:"#e6edf3",textMuted:"#8b949e",textDim:"#484f58",primary:"#58a6ff",secondary:"#bc8cff",success:"#3fb950",error:"#f85149",warning:"#d29922",info:"#58a6ff",border:"#30363d"}),light:_({bg:"#ffffff",bgSubtle:"#f6f8fa",text:"#1f2328",textMuted:"#656d76",textDim:"#8c959f",primary:"#0969da",secondary:"#8250df",success:"#1a7f37",error:"#cf222e",warning:"#9a6700",info:"#0969da",border:"#d0d7de"})},material:{name:"Material",dark:_({bg:"#263238",bgSubtle:"#37474f",text:"#eeffff",textMuted:"#b0bec5",textDim:"#546e7a",primary:"#82aaff",secondary:"#c792ea",success:"#c3e88d",error:"#ff5370",warning:"#ffcb6b",info:"#89ddff",border:"#37474f"}),light:_({bg:"#fafafa",bgSubtle:"#eeeeee",text:"#90a4ae",textMuted:"#546e7a",textDim:"#b0bec5",primary:"#6182b8",secondary:"#7c4dff",success:"#91b859",error:"#e53935",warning:"#f76d47",info:"#39adb5",border:"#d0d0d0"})},synthwave:{name:"Synthwave '84",dark:_({bg:"#262335",bgSubtle:"#34294f",text:"#ffffff",textMuted:"#bbbbbb",textDim:"#6d5da0",primary:"#ff7edb",secondary:"#36f9f6",success:"#72f1b8",error:"#fe4450",warning:"#fede5d",info:"#36f9f6",border:"#495495"}),light:_({bg:"#f5f0ff",bgSubtle:"#e8e0f0",text:"#262335",textMuted:"#6d5da0",textDim:"#a090c0",primary:"#b03090",secondary:"#108888",success:"#308050",error:"#c03030",warning:"#a08000",info:"#207080",border:"#d0c8e0"})},everforest:{name:"Everforest",dark:_({bg:"#2d353b",bgSubtle:"#343f44",text:"#d3c6aa",textMuted:"#859289",textDim:"#5c6a72",primary:"#a7c080",secondary:"#d699b6",success:"#a7c080",error:"#e67e80",warning:"#dbbc7f",info:"#7fbbb3",border:"#475258"}),light:_({bg:"#fdf6e3",bgSubtle:"#f3efda",text:"#5c6a72",textMuted:"#829181",textDim:"#a6b0a0",primary:"#8da101",secondary:"#df69ba",success:"#8da101",error:"#f85552",warning:"#dfa000",info:"#35a77c",border:"#e0dcc7"})},cobalt2:{name:"Cobalt2",dark:_({bg:"#193549",bgSubtle:"#1f4662",text:"#ffffff",textMuted:"#8db0cc",textDim:"#4d7ea0",primary:"#ffc600",secondary:"#ff9d00",success:"#3ad900",error:"#ff628c",warning:"#ffc600",info:"#80fcff",border:"#2a5a7a"}),light:_({bg:"#ffffff",bgSubtle:"#f0f0f0",text:"#193549",textMuted:"#4d7ea0",textDim:"#8db0cc",primary:"#b88d00",secondary:"#cc7a00",success:"#2ba600",error:"#cc4e70",warning:"#b88d00",info:"#0090a0",border:"#d0d0d0"})},kanagawa:{name:"Kanagawa",dark:_({bg:"#1F1F28",bgSubtle:"#2A2A37",text:"#DCD7BA",textMuted:"#727169",textDim:"#54546D",primary:"#7E9CD8",secondary:"#957FB8",success:"#98BB6C",error:"#E82424",warning:"#D7A657",info:"#76946A",border:"#54546D"}),light:_({bg:"#F2E9DE",bgSubtle:"#EAE4D7",text:"#54433A",textMuted:"#9E9389",textDim:"#B8AFA6",primary:"#2D4F67",secondary:"#957FB8",success:"#98BB6C",error:"#E82424",warning:"#D7A657",info:"#76946A",border:"#D4CBBF"})},nightowl:{name:"Night Owl",dark:_({bg:"#011627",bgSubtle:"#0b2942",text:"#d6deeb",textMuted:"#637777",textDim:"#44596b",primary:"#82aaff",secondary:"#c792ea",success:"#addb67",error:"#ef5350",warning:"#ffcb8b",info:"#7fdbca",border:"#1d3b53"}),light:_({bg:"#fbfbfb",bgSubtle:"#f0f0f0",text:"#403f53",textMuted:"#989fb1",textDim:"#c0c0c0",primary:"#4876d6",secondary:"#994cc3",success:"#4d804e",error:"#de3d3b",warning:"#e0af68",info:"#0c969b",border:"#d9d9d9"})},onedark:{name:"One Dark",dark:_({bg:"#282c34",bgSubtle:"#2c313c",text:"#abb2bf",textMuted:"#636d83",textDim:"#4b5263",primary:"#61afef",secondary:"#c678dd",success:"#98c379",error:"#e06c75",warning:"#e5c07b",info:"#56b6c2",border:"#3e4451"}),light:_({bg:"#fafafa",bgSubtle:"#f0f0f0",text:"#383a42",textMuted:"#a0a1a7",textDim:"#c0c0c0",primary:"#4078f2",secondary:"#a626a4",success:"#50a14f",error:"#e45649",warning:"#c18401",info:"#0184bc",border:"#d3d3d3"})},matrix:{name:"Matrix",dark:_({bg:"#0a0e0a",bgSubtle:"#0e130d",text:"#62ff94",textMuted:"#8ca391",textDim:"#3d4a44",primary:"#2eff6a",secondary:"#00efff",success:"#62ff94",error:"#ff4b4b",warning:"#e6ff57",info:"#30b3ff",border:"#1e2a1b"}),light:_({bg:"#eef3ea",bgSubtle:"#e4ebe1",text:"#203022",textMuted:"#748476",textDim:"#a0b0a5",primary:"#1cc24b",secondary:"#24f6d9",success:"#1cc24b",error:"#ff4b4b",warning:"#e6ff57",info:"#30b3ff",border:"#748476"})},flexoki:{name:"Flexoki",dark:_({bg:"#100f0f",bgSubtle:"#1c1b1a",text:"#cecdc3",textMuted:"#878580",textDim:"#575653",primary:"#4385be",secondary:"#8b7ec8",success:"#879a39",error:"#d14d41",warning:"#da702c",info:"#3aa99f",border:"#343331"}),light:_({bg:"#fffcf0",bgSubtle:"#f2f0e5",text:"#100f0f",textMuted:"#878580",textDim:"#b7b5ac",primary:"#205ea6",secondary:"#5e409d",success:"#66800b",error:"#af3029",warning:"#bc5215",info:"#24837b",border:"#e6e4d9"})},cursor:{name:"Cursor",dark:_({bg:"#1e1e1e",bgSubtle:"#252526",text:"#d4d4d4",textMuted:"#808080",textDim:"#5a5a5a",primary:"#007acc",secondary:"#c586c0",success:"#6a9955",error:"#f44747",warning:"#cca700",info:"#4ec9b0",border:"#333333"}),light:_({bg:"#ffffff",bgSubtle:"#f3f3f3",text:"#1e1e1e",textMuted:"#808080",textDim:"#b0b0b0",primary:"#007acc",secondary:"#af00db",success:"#388a34",error:"#cd3131",warning:"#bf8803",info:"#16825d",border:"#e5e5e5"})},vercel:{name:"Vercel",dark:_({bg:"#000000",bgSubtle:"#111111",text:"#ededed",textMuted:"#888888",textDim:"#444444",primary:"#ffffff",secondary:"#888888",success:"#0070f3",error:"#ee0000",warning:"#f5a623",info:"#0070f3",border:"#333333"}),light:_({bg:"#ffffff",bgSubtle:"#fafafa",text:"#000000",textMuted:"#666666",textDim:"#999999",primary:"#000000",secondary:"#666666",success:"#0070f3",error:"#ee0000",warning:"#f5a623",info:"#0070f3",border:"#eaeaea"})},"osaka-jade":{name:"Osaka Jade",dark:_({bg:"#111c18",bgSubtle:"#1a2520",text:"#C1C497",textMuted:"#53685B",textDim:"#3d4a44",primary:"#2DD5B7",secondary:"#D2689C",success:"#549e6a",error:"#FF5345",warning:"#E5C736",info:"#2DD5B7",border:"#3d4a44"}),light:_({bg:"#F6F5DD",bgSubtle:"#E8E7CC",text:"#111c18",textMuted:"#53685B",textDim:"#A8A78C",primary:"#1faa90",secondary:"#a8527a",success:"#3d7a52",error:"#c7392d",warning:"#b5a020",info:"#1faa90",border:"#A8A78C"})}};it=null;Pn=Cr(void 0)});import{createContext as Br,useContext as Er}from"react";import{jsx as _r}from"@opentui/react/jsx-runtime";function Bn(e){return _r(Rn.Provider,{value:e.value,children:e.children})}function kt(){let e=Er(Rn);if(!e)throw new Error("useSDK must be used within SDKProvider");return e}var Rn,Ct=K(()=>{"use strict";Rn=Br(void 0)});import{createContext as Lr,useContext as Nr,useState as jr,useEffect as Fr,useCallback as En,useRef as _n}from"react";import{jsx as Mt,jsxs as Nn}from"@opentui/react/jsx-runtime";function Ur(e,n){switch(e){case"info":return n.info;case"success":return n.success;case"warning":return n.warning;case"error":return n.error}}function Fn(e){let{theme:n}=G(),[o,t]=jr([]),i=_n(0),r=_n(new Map),c=En(l=>{t(b=>b.filter(d=>d.id!==l));let h=r.current.get(l);h&&(clearTimeout(h),r.current.delete(l))},[]),a=En((l,h,b)=>{let d=++i.current,D=b??Wr,y={id:d,type:l,message:h,duration:D};t(N=>{let f=[...N,y];if(f.length>Ln){let g=f.splice(0,f.length-Ln);for(let T of g){let I=r.current.get(T.id);I&&(clearTimeout(I),r.current.delete(T.id))}}return f});let k=setTimeout(()=>{c(d)},D);r.current.set(d,k)},[c]);return Fr(()=>()=>{for(let l of r.current.values())clearTimeout(l);r.current.clear()},[]),Nn(jn.Provider,{value:{toast:a},children:[e.children,o.length>0&&Mt("box",{flexDirection:"column",alignItems:"flex-end",children:o.map(l=>{let h=Ur(l.type,n),b=Gr[l.type];return Nn("box",{height:1,flexDirection:"row",justifyContent:"flex-end",children:[Mt("text",{fg:h,children:` ${b} `}),Mt("text",{fg:n.text,children:l.message}),Mt("text",{fg:n.textDim,children:" "})]},l.id)})})]})}function Gn(){let e=Nr(jn);if(!e)throw new Error("useToast must be used within ToastProvider");return e}var Gr,jn,Wr,Ln,Ht=K(()=>{"use strict";te();Gr={info:"\u2139",success:"\u2713",warning:"\u26A0",error:"\u2717"};jn=Lr(void 0),Wr=3e3,Ln=3});import*as je from"fs";import*as st from"path";function at(e,n){if(!e)return[];if(e.startsWith("/"))return Un.filter(t=>t.name.startsWith(e)).map(t=>({text:t.name,description:t.description,type:"command"}));if(e.startsWith("@")||e.includes(" @")){let t=e.lastIndexOf("@"),i=e.substring(t),r=[];for(let c of Wn)c.trigger.startsWith(i)&&r.push({text:c.trigger,description:c.description,type:"mention"});if(i==="@"||i.startsWith("@file ")||i.startsWith("@f")){let c=i.startsWith("@file ")?i.substring(6):"",a=Jr(n,c);for(let l of a.slice(0,10))r.push({text:`@file ${l}`,description:"",type:"file"})}return r}let o=e.split(" ");if(o.length>=1){let t=o[0],i=qr[t];if(i&&o.length<=2){let r=o[1]||"";return i.filter(c=>c.startsWith(r)).map(c=>({text:`${t} ${c}`,description:"",type:"subcommand"}))}}if(o.length>=2){let t=Kr(e,n);if(t.length>0){let i=o.slice(0,-1).join(" ")+" ";return t.map(r=>({text:i+r,description:r.endsWith("/")?"directory":"file",type:"file"}))}}return[]}function qn(e,n){if(!e)return"";if(e.startsWith("/")){let t=Un.find(i=>i.name.startsWith(e)&&i.name!==e);return t?t.name.substring(e.length):""}let o=e.lastIndexOf("@");if(o>=0&&o===e.length-e.substring(o).length){let t=e.substring(o),i=Wn.find(r=>r.trigger.startsWith(t)&&r.trigger!==t);return i?i.trigger.substring(t.length):""}return""}function Kr(e,n){let o=["cd","ls","cat","head","tail","less","more","vim","nano","code","open","rm","cp","mv","mkdir","touch","chmod"],t=e.split(" ");if(t.length<2)return[];let i=t[0];if(!o.includes(i))return[];let r=t[t.length-1]||"";return Hr(n,r)}function Hr(e,n){try{let o=n.includes("/")?st.resolve(e,n.substring(0,n.lastIndexOf("/")+1)):e,t=n.includes("/")?n.substring(n.lastIndexOf("/")+1):n;if(!je.existsSync(o)||!je.statSync(o).isDirectory())return[];let i=je.readdirSync(o,{withFileTypes:!0}),r=n.includes("/")?n.substring(0,n.lastIndexOf("/")+1):"";return i.filter(c=>!c.name.startsWith(".")||n.startsWith(".")).filter(c=>c.name.toLowerCase().startsWith(t.toLowerCase())).sort((c,a)=>c.isDirectory()!==a.isDirectory()?c.isDirectory()?-1:1:c.name.localeCompare(a.name)).slice(0,20).map(c=>r+c.name+(c.isDirectory()?"/":""))}catch{return[]}}function Jr(e,n){let o=[],t=n.toLowerCase(),i=new Set(["node_modules",".git","dist","build","__pycache__",".cache","coverage"]),r=(c,a,l)=>{if(!(l>3||o.length>=15))try{let h=je.readdirSync(st.join(e,c),{withFileTypes:!0});for(let b of h){if(b.name.startsWith(".")||i.has(b.name))continue;if(o.length>=15)break;let d=a?`${a}/${b.name}`:b.name;b.isDirectory()?((!n||d.toLowerCase().includes(t))&&o.push(d+"/"),r(st.join(c,b.name),d,l+1)):(!n||d.toLowerCase().includes(t))&&o.push(d)}}catch{}};return r("","",0),o}var Un,Wn,qr,Kn=K(()=>{"use strict";Un=[{name:"/help",description:"Show available commands"},{name:"/clear",description:"Clear chat history"},{name:"/new",description:"Start new conversation"},{name:"/model",description:"Show/change model"},{name:"/provider",description:"Show/change provider"},{name:"/mode",description:"Cycle permission mode"},{name:"/usage",description:"Show token usage & cost"},{name:"/compact",description:"Compress context"},{name:"/config",description:"Show/set configuration"},{name:"/dir",description:"Change working directory"},{name:"/history",description:"Browse past sessions"},{name:"/ls",description:"List conversations"},{name:"/resume",description:"Resume conversation by ID"},{name:"/view",description:"View a conversation"},{name:"/fork",description:"Fork current conversation"},{name:"/delete",description:"Delete a conversation"},{name:"/plan",description:"Plan mode (approve/reject/show/off)"},{name:"/plan approve",description:"Approve plan and start building"},{name:"/plan reject",description:"Reject plan"},{name:"/plan show",description:"Show current plan"},{name:"/plan off",description:"Cancel plan mode"},{name:"/tasks",description:"Show active tasks"},{name:"/memory",description:"Show agent memory"},{name:"/permissions",description:"Show permission rules"},{name:"/hooks",description:"Show configured hooks"},{name:"/rules",description:"Show project rules"},{name:"/mcp",description:"MCP server management"},{name:"/context",description:"Show context providers"},{name:"/effort",description:"Set effort level"},{name:"/theme",description:"Switch theme"},{name:"/bg",description:"Run in background"},{name:"/jobs",description:"Show background jobs"},{name:"/login",description:"OAuth login"},{name:"/logout",description:"OAuth logout"},{name:"/setup",description:"Run setup wizard"},{name:"/doctor",description:"Check system health"},{name:"/init",description:"Initialize project config"},{name:"/exit",description:"Quit the TUI"},{name:"/quit",description:"Quit the TUI"},{name:"/btw",description:"Ask without adding to history"},{name:"/auth-status",description:"Show authentication status"},{name:"/queue",description:"Show message queue"}],Wn=[{trigger:"@terminal",description:"Recent terminal output"},{trigger:"@url",description:"Fetch URL content"},{trigger:"@tree",description:"Project file tree"},{trigger:"@codebase",description:"Full codebase context"},{trigger:"@clip",description:"Clipboard content"},{trigger:"@file",description:"Include a file"}],qr={npm:["install","run","test","start","build","init","publish","uninstall","update","ls","audit","ci"],yarn:["install","add","remove","run","build","test","start","dev","upgrade","info","why"],pnpm:["install","add","remove","run","build","test","dev","update","store"],bun:["install","add","remove","run","build","test","dev","init","create"],git:["status","add","commit","push","pull","fetch","checkout","branch","merge","rebase","log","diff","stash","reset","clone","remote","tag","cherry-pick","bisect","show","blame","reflog"],docker:["build","run","exec","ps","images","pull","push","stop","rm","logs","compose"],python:["-m","-c","--version","manage.py"],python3:["-m","-c","--version","manage.py"],pip:["install","uninstall","freeze","list","show"],cargo:["build","run","test","check","clippy","fmt","new","init","add","publish"],go:["build","run","test","get","mod","fmt","vet","install","generate"],make:["build","test","clean","install","all"],kubectl:["get","describe","apply","delete","logs","exec","port-forward","scale"],gh:["pr","issue","repo","run","release","api","auth","browse"],turbo:["build","dev","test","lint","run"],npx:["tsc","ts-node","eslint","prettier","jest","vitest","playwright"]}});import{TextAttributes as ct,RGBA as Vr}from"@opentui/core";import{useState as Tt,useRef as Hn,useMemo as Jn}from"react";import{useKeyboard as Yr}from"@opentui/react";import{execSync as dt}from"child_process";import{Fragment as Vn,jsx as z,jsxs as Fe}from"@opentui/react/jsx-runtime";function zr(){try{if(process.platform==="darwin")return dt("pbpaste",{encoding:"utf-8"});try{return dt("xclip -selection clipboard -o",{encoding:"utf-8"})}catch{return dt("xsel --clipboard --output",{encoding:"utf-8"})}}catch{return""}}function Xr(){if(process.platform!=="darwin")return null;try{if(dt(`osascript -e 'clipboard info' 2>/dev/null | grep -q "TIFF\\|PNG\\|JPEG" && echo "yes" || echo "no"`,{encoding:"utf-8",timeout:1e3}).trim()!=="yes")return null;let n=dt("osascript -e 'set theImage to the clipboard as \xABclass PNGf\xBB' -e 'return theImage' 2>/dev/null | base64",{encoding:"utf-8",timeout:3e3,maxBuffer:20*1024*1024}).trim();if(n&&n.length>100)return{data:n,mimeType:"image/png"}}catch{}return null}function $t(e){let{theme:n,customBg:o}=G(),t=n,[i,r]=Tt(""),[c,a]=Tt([]),[l,h]=Tt(0),[b,d]=Tt(!1),D=Hn(i);D.current=i;let y=Hn(0),k=Jn(()=>{if(!i)return[];let v=at(i,e.workingDir);return v.length>0&&v[0].type==="file"?[{text:i,description:"submit as typed",type:"file"},...v]:v},[i,e.workingDir]),N=Jn(()=>b&&k.length>0?"":qn(i,e.workingDir),[i,e.workingDir,b,k.length]),f=b&&k.length>0;Yr(v=>{if(!e.suppressInput){if(v.name==="tab"&&e.onModeChange&&e.mode){e.onModeChange(e.mode==="build"?"plan":"build");return}if(f){if(v.name==="up"){h(M=>M<=0?k.length-1:M-1);return}if(v.name==="down"){h(M=>M>=k.length-1?0:M+1);return}if(v.name==="return"){let M=k[l];if(M){let U=M.text.trim();U&&(e.onSubmit(U,c.length>0?[...c]:void 0),r(""),a([])),d(!1),h(0)}return}if(v.name==="escape"){d(!1);return}if(v.name==="right"){let M=k[l];M&&(r(M.text+" "),d(!1),h(0));return}}if(N&&v.name==="right"){r(M=>M+N);return}if(v.ctrl&&v.name==="v"){let M=Xr();if(M){y.current+=1,a(H=>[...H,M]),r(H=>H+`[Image #${y.current}] `);return}let U=zr().trim();if(U){let H=U.split(`
|
|
2
3
|
`)[0]||"";r($=>$+H)}return}if(v.ctrl&&v.name==="u"){r(""),a([]),d(!1);return}if(v.ctrl&&v.name==="w"){r(M=>M.replace(/\S+\s*$/,""));return}if(v.name==="return"&&!v.shift){let M=D.current.trim();(M||c.length>0)&&(e.onSubmit(M||"Describe this image.",c.length>0?[...c]:void 0),r(""),a([]),d(!1));return}if(v.name==="backspace"){r(M=>{let U=M.slice(0,-1);return U.startsWith("/")||U.includes("@")||at(U,e.workingDir).length>0?(d(!0),h(0)):d(!1),U});return}if(v.name==="escape"&&b){d(!1);return}if(v.name==="space"){r(M=>{let U=M+" ";return M.startsWith("/")?d(!1):at(U,e.workingDir).length>0&&(d(!0),h(0)),U});return}v.name&&v.name.length===1&&!v.ctrl&&!v.meta&&r(M=>{let U=M+v.name;return(U.startsWith("/")||U.includes("@")||at(U,e.workingDir).length>0)&&(d(!0),h(0)),U})}});let g=i.startsWith("/"),T=Math.max(0,Math.min(l-Math.floor(lt/2),k.length-lt)),I=k.slice(T,T+lt),R=T>0,F=T+lt<k.length,L=o?Vr.fromHex(o):t.bg;return Fe("box",{flexDirection:"column",flexShrink:0,backgroundColor:L,children:[f&&Fe("box",{flexDirection:"column",paddingX:1,backgroundColor:L,children:[R&&z("box",{children:z("text",{fg:t.textDim,children:` \u25B2 ${T} more`})}),I.map((v,M)=>{let H=T+M===l,$=v.type==="command"?t.warning:v.type==="mention"?t.info:v.type==="file"?t.success:t.textMuted;return Fe("box",{flexDirection:"row",children:[z("text",{fg:H?t.primary:$,attributes:H?ct.BOLD:void 0,children:H?" \u276F ":" "}),z("text",{fg:H?t.text:$,children:v.text}),v.description?z("text",{fg:t.textDim,children:` ${v.description}`}):null]},v.text)}),F&&z("box",{children:z("text",{fg:t.textDim,children:` \u25BC ${k.length-T-lt} more`})})]}),c.length>0&&z("box",{height:1,paddingX:1,children:z("text",{fg:t.primary,children:` \u{1F5BC} ${c.length} image${c.length>1?"s":""} attached`})}),Fe("box",{height:3,borderStyle:"single",borderColor:t.borderFocused,backgroundColor:L,flexDirection:"row",alignItems:"center",paddingX:1,children:[z("text",{fg:g?t.warning:t.primary,attributes:ct.BOLD,children:g?" / ":" > "}),i?Fe(Vn,{children:[z("text",{fg:t.text,children:i}),N?z("text",{fg:t.textDim,children:N}):z("text",{fg:t.primary,children:"\u258A"})]}):z("text",{fg:t.textDim,children:e.placeholder||"Type a message... (^V paste, / commands, @ context, \u2192 accept)"})]}),e.mode&&Fe("box",{height:1,flexDirection:"row",backgroundColor:L,paddingX:1,children:[z("box",{backgroundColor:e.mode==="build"?t.primary:void 0,children:z("text",{fg:e.mode==="build"?t.bg:t.textMuted,attributes:e.mode==="build"?ct.BOLD:void 0,children:" Build "})}),z("text",{fg:t.textDim,children:" "}),z("box",{backgroundColor:e.mode==="plan"?t.secondary:void 0,children:z("text",{fg:e.mode==="plan"?t.bg:t.textMuted,attributes:e.mode==="plan"?ct.BOLD:void 0,children:" Plan "})}),e.modelLabel&&Fe(Vn,{children:[z("text",{fg:t.textDim,children:" "}),z("text",{fg:t.textMuted,attributes:ct.ITALIC,children:e.modelLabel})]}),z("box",{flexGrow:1}),z("text",{fg:t.textDim,children:"tab mode "}),z("text",{fg:t.textDim,children:"ctrl+p commands"})]})]})}var lt,Jt=K(()=>{"use strict";te();Kn();lt=6});import{TextAttributes as Yn}from"@opentui/core";import{useTerminalDimensions as Qr}from"@opentui/react";import{jsx as Se,jsxs as zn}from"@opentui/react/jsx-runtime";function Xn(e){let{theme:n}=G(),o=n,t=Qr(),i=t.width||80,r=t.height||24,c=()=>{let f=process.env.HOME||"",g=e.workingDir;return f&&g.startsWith(f)?"~"+g.slice(f.length):g},a="Multi-provider AI coding assistant",l="v0.1.1",h=i<60||r<20,b=!h&&(i<80||r<30),d=h?null:b?ei:Zr,D=[["Provider",e.provider],["Model",e.model],["Theme",e.themeId],["Directory",c()]],y=Math.max(...D.map(([f])=>f.length)),k=[{key:"Enter",label:"Send message / start session",id:"start"},{key:"Ctrl+P",label:"Command palette",id:"commands"},{key:"Ctrl+O",label:"Switch model",id:"model"},{key:"Ctrl+T",label:"Change theme",id:"theme"},{key:"Ctrl+N",label:"New session",id:"new"},{key:"Ctrl+S",label:"Browse sessions",id:"sessions"},{key:"/setup",label:"Setup wizard",id:"setup"},{key:"Ctrl+C",label:"Quit",id:"quit"}],N=Math.max(...k.map(f=>f.key.length));return zn("box",{flexDirection:"column",flexGrow:1,flexShrink:1,overflow:"hidden",children:[zn("box",{flexDirection:"column",alignItems:"center",justifyContent:"center",flexGrow:1,children:[d&&d.map((f,g)=>Se("text",{fg:o.primary,attributes:Yn.BOLD,children:f},`logo-${g}`)),Se("text",{fg:o.textDim,children:a}),Se("text",{fg:o.textMuted,children:l}),Se("text",{children:""}),D.map(([f,g],T)=>{let I=`${f.padStart(y)} ${g}`;return Se("text",{fg:o.textDim,children:I},`info-${T}`)}),Se("text",{children:""}),Se("text",{fg:o.primary,attributes:Yn.BOLD,children:"Actions"}),k.map((f,g)=>{let T=`${f.key.padStart(N)} ${f.label}`;return Se("text",{fg:o.textMuted,children:T},`act-${g}`)}),Se("text",{children:""}),Se("text",{fg:o.textDim,children:"Powered by @opentui/react + @cdoing/ai"})]}),e.onSubmit&&Se($t,{onSubmit:e.onSubmit,workingDir:e.workingDir,placeholder:"Start typing to begin a session... (/ commands, @ context)"})]})}var Zr,ei,Qn=K(()=>{"use strict";te();Jt();Zr=[" \u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 ","\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D ","\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2554\u2588\u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2588\u2557","\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2551\u255A\u2588\u2588\u2557\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551","\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551\u2588\u2588\u2551 \u255A\u2588\u2588\u2588\u2588\u2551\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D"," \u255A\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D "],ei=["\u250C\u2500\u2510\u250C\u2510 \u250C\u2500\u2510\u252C\u250C\u2510\u250C\u250C\u2500\u2510","\u2502 \u2502\u2502\u2502 \u2502\u2502\u2502\u2502\u2502\u2502\u2502\u2502 \u252C","\u2514\u2500\u2518\u2514\u2518\u2514\u2500\u2518\u2514\u2500\u2518\u2518\u2514\u2518\u2514\u2500\u2518"]});import{TextAttributes as Be}from"@opentui/core";import{Fragment as to,jsx as A,jsxs as ge}from"@opentui/react/jsx-runtime";function Ge(e){return e.replace(/`([^`]+)`/g,"$1").replace(/\*\*([^*]+)\*\*/g,"$1").replace(/(?<!\w)\*([^*]+)\*(?!\w)/g,"$1")}function Zn(e){let n=e.theme,{syntaxStyle:o}=G(),t=e.text.split(`
|
|
3
4
|
`),i=[],r=0;for(;r<t.length;){let c=t[r];if(c.startsWith("```")){let h=[c];for(r++;r<t.length;){if(h.push(t[r]),t[r].startsWith("```")){r++;break}r++}let b=h.join(`
|