tmex-cli 0.16.1 → 0.16.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/CHANGELOG.md +12 -50
  2. package/dist/runtime/server.js +392 -106
  3. package/package.json +1 -1
  4. package/resources/fe-dist/assets/DevicePage-CgDkuNLp.js +24 -0
  5. package/resources/fe-dist/assets/{DevicesPage-sJHXbS_f.js → DevicesPage-B_jvUZtl.js} +1 -1
  6. package/resources/fe-dist/assets/{FilePage-7FFd1YcW.js → FilePage-DTSmWM1D.js} +1 -1
  7. package/resources/fe-dist/assets/SettingsPage-LTHV37Rj.js +39 -0
  8. package/resources/fe-dist/assets/agent-tab-vPjPGa5f.js +38 -0
  9. package/resources/fe-dist/assets/{api-DV7-9Pvt.js → api-D_FToAy0.js} +1 -1
  10. package/resources/fe-dist/assets/{arc-PDHKfnGP.js → arc-BSCyoyGW.js} +1 -1
  11. package/resources/fe-dist/assets/{architectureDiagram-3BPJPVTR-BiPHTh1e.js → architectureDiagram-3BPJPVTR-CBO0dAe2.js} +1 -1
  12. package/resources/fe-dist/assets/{blockDiagram-GPEHLZMM-DP_BRHKg.js → blockDiagram-GPEHLZMM-0ONANm30.js} +1 -1
  13. package/resources/fe-dist/assets/{c4Diagram-AAUBKEIU-D16QYgyT.js → c4Diagram-AAUBKEIU-DpvhCnF8.js} +1 -1
  14. package/resources/fe-dist/assets/{card-DmfNw0hd.js → card-CD9i-fLq.js} +1 -1
  15. package/resources/fe-dist/assets/channel-DBhb6_En.js +1 -0
  16. package/resources/fe-dist/assets/{chunk-2J33WTMH-DOjtL7ww.js → chunk-2J33WTMH-MmS9_ur_.js} +1 -1
  17. package/resources/fe-dist/assets/{chunk-4BX2VUAB-BbT67ZXa.js → chunk-4BX2VUAB-CLd4Yxwh.js} +1 -1
  18. package/resources/fe-dist/assets/{chunk-55IACEB6-CnnXwmY_.js → chunk-55IACEB6-DgCH4WwT.js} +1 -1
  19. package/resources/fe-dist/assets/{chunk-727SXJPM-TyUdLEW5.js → chunk-727SXJPM-B9DM5PB4.js} +1 -1
  20. package/resources/fe-dist/assets/{chunk-AQP2D5EJ-BMpK4dqa.js → chunk-AQP2D5EJ-DQwC9D9W.js} +1 -1
  21. package/resources/fe-dist/assets/{chunk-FMBD7UC4-Dx0HVCZZ.js → chunk-FMBD7UC4-BnvyNYGh.js} +1 -1
  22. package/resources/fe-dist/assets/{chunk-ND2GUHAM-BQCoMEti.js → chunk-ND2GUHAM-BzcZgEWG.js} +1 -1
  23. package/resources/fe-dist/assets/{chunk-QZHKN3VN-ilmf5OgK.js → chunk-QZHKN3VN-C9BaHIUI.js} +1 -1
  24. package/resources/fe-dist/assets/classDiagram-4FO5ZUOK-9V2iXOG7.js +1 -0
  25. package/resources/fe-dist/assets/classDiagram-v2-Q7XG4LA2-9V2iXOG7.js +1 -0
  26. package/resources/fe-dist/assets/{copy-Ct5TNzGp.js → copy-DzIk8AxV.js} +1 -1
  27. package/resources/fe-dist/assets/{cose-bilkent-S5V4N54A-CpWhM7Za.js → cose-bilkent-S5V4N54A-NkTc0ObP.js} +1 -1
  28. package/resources/fe-dist/assets/{dagre-BM42HDAG-CWJttTzC.js → dagre-BM42HDAG-BdFDBfE_.js} +1 -1
  29. package/resources/fe-dist/assets/{diagram-2AECGRRQ-BD8ny_Yg.js → diagram-2AECGRRQ-Ba4Y0igR.js} +1 -1
  30. package/resources/fe-dist/assets/{diagram-5GNKFQAL-CeHcPWRz.js → diagram-5GNKFQAL-B4_Or8Vp.js} +1 -1
  31. package/resources/fe-dist/assets/{diagram-KO2AKTUF-tVlrBE8C.js → diagram-KO2AKTUF-DbmmHTYj.js} +1 -1
  32. package/resources/fe-dist/assets/{diagram-LMA3HP47-DGUn-oQn.js → diagram-LMA3HP47-CRrd6lc4.js} +1 -1
  33. package/resources/fe-dist/assets/{diagram-OG6HWLK6-xKCd1kwA.js → diagram-OG6HWLK6-BOEazFIu.js} +1 -1
  34. package/resources/fe-dist/assets/en_US-BihUhDmr.js +1 -0
  35. package/resources/fe-dist/assets/{erDiagram-TEJ5UH35-C6M5qkGl.js → erDiagram-TEJ5UH35-Dk-UowK8.js} +1 -1
  36. package/resources/fe-dist/assets/{files-tab-BWkYfaye.js → files-tab-D2vddvsj.js} +1 -1
  37. package/resources/fe-dist/assets/{flowDiagram-I6XJVG4X-D0MZDHnB.js → flowDiagram-I6XJVG4X-BhbGYx-g.js} +1 -1
  38. package/resources/fe-dist/assets/{ganttDiagram-6RSMTGT7-YeduSSa_.js → ganttDiagram-6RSMTGT7-iezClDTv.js} +1 -1
  39. package/resources/fe-dist/assets/{gitGraphDiagram-PVQCEYII-Nem1Mvvg.js → gitGraphDiagram-PVQCEYII-Ncqf3CQw.js} +1 -1
  40. package/resources/fe-dist/assets/{index-iee3U_rD.js → index-DOfY8kwB.js} +1 -1
  41. package/resources/fe-dist/assets/{index-B3ddLSja.js → index-UoApkLSY.js} +63 -63
  42. package/resources/fe-dist/assets/index-j9kTGUS5.css +1 -0
  43. package/resources/fe-dist/assets/{infoDiagram-5YYISTIA-Bh6bbh_V.js → infoDiagram-5YYISTIA-CUg3PkAb.js} +1 -1
  44. package/resources/fe-dist/assets/{ishikawaDiagram-YF4QCWOH-CsZHu48j.js → ishikawaDiagram-YF4QCWOH-DU0ekJw5.js} +1 -1
  45. package/resources/fe-dist/assets/ja_JP-f5sXmz8W.js +1 -0
  46. package/resources/fe-dist/assets/{journeyDiagram-JHISSGLW-CPgnovXt.js → journeyDiagram-JHISSGLW-Ji7WtMH7.js} +1 -1
  47. package/resources/fe-dist/assets/{kanban-definition-UN3LZRKU-D4OAuDsS.js → kanban-definition-UN3LZRKU-B8zVyM8Q.js} +1 -1
  48. package/resources/fe-dist/assets/{linear-CcA4wV7f.js → linear-tNPPicfI.js} +1 -1
  49. package/resources/fe-dist/assets/{markdown-preview-CBGlxpTs.js → markdown-preview-CzbcKxcJ.js} +3 -3
  50. package/resources/fe-dist/assets/{mermaid.core-D-CshtYr.js → mermaid.core-BoNU6G1d.js} +5 -5
  51. package/resources/fe-dist/assets/{mindmap-definition-RKZ34NQL-DBpI1nMC.js → mindmap-definition-RKZ34NQL-D_v1LaNP.js} +1 -1
  52. package/resources/fe-dist/assets/{pieDiagram-4H26LBE5-D4kh0_Y0.js → pieDiagram-4H26LBE5-B1CHCpFf.js} +1 -1
  53. package/resources/fe-dist/assets/{quadrantDiagram-W4KKPZXB-DNw3oGHQ.js → quadrantDiagram-W4KKPZXB-DvA3zgR7.js} +1 -1
  54. package/resources/fe-dist/assets/{requirementDiagram-4Y6WPE33-DqtMaND0.js → requirementDiagram-4Y6WPE33-BCna6ZG5.js} +1 -1
  55. package/resources/fe-dist/assets/{sankeyDiagram-5OEKKPKP-D-m9Pyie.js → sankeyDiagram-5OEKKPKP-KEllFLAf.js} +1 -1
  56. package/resources/fe-dist/assets/{send-DaOB9hLq.js → send-BgCF67Uc.js} +1 -1
  57. package/resources/fe-dist/assets/{sequenceDiagram-3UESZ5HK-CjrimNJf.js → sequenceDiagram-3UESZ5HK-DRsq_jg_.js} +1 -1
  58. package/resources/fe-dist/assets/{stateDiagram-AJRCARHV-BT5d8Z8W.js → stateDiagram-AJRCARHV-DhATBo8D.js} +1 -1
  59. package/resources/fe-dist/assets/stateDiagram-v2-BHNVJYJU-Dn_gMFVD.js +1 -0
  60. package/resources/fe-dist/assets/{terminal-settings-panel-DDhlnbRH.js → terminal-settings-panel-DsMMZFBi.js} +1 -1
  61. package/resources/fe-dist/assets/{timeline-definition-PNZ67QCA-BeocAFDX.js → timeline-definition-PNZ67QCA-Det7AzPd.js} +1 -1
  62. package/resources/fe-dist/assets/{transfer-toast-DXl4RHsV.js → transfer-toast-CHcCj3qf.js} +1 -1
  63. package/resources/fe-dist/assets/{triangle-alert-FQRTtbTP.js → triangle-alert-BjHP6Ipw.js} +1 -1
  64. package/resources/fe-dist/assets/{vennDiagram-CIIHVFJN-CYlmUB5_.js → vennDiagram-CIIHVFJN-BF4R466L.js} +1 -1
  65. package/resources/fe-dist/assets/{wardley-L42UT6IY-CTyaodt9.js → wardley-L42UT6IY-DLHZ_6-V.js} +1 -1
  66. package/resources/fe-dist/assets/{wardleyDiagram-YWT4CUSO-DNlEcEwQ.js → wardleyDiagram-YWT4CUSO-CekN3Ye6.js} +1 -1
  67. package/resources/fe-dist/assets/{xychartDiagram-2RQKCTM6-7Zi-6P-I.js → xychartDiagram-2RQKCTM6-CJD3yg0M.js} +1 -1
  68. package/resources/fe-dist/assets/{zap-BFIAXPXd.js → zap-Dx7JTXJN.js} +1 -1
  69. package/resources/fe-dist/assets/zh_CN-CPdvelFW.js +1 -0
  70. package/resources/fe-dist/index.html +2 -2
  71. package/resources/gateway-drizzle/0012_naive_lizard.sql +8 -0
  72. package/resources/gateway-drizzle/0013_bored_blindfold.sql +1 -0
  73. package/resources/gateway-drizzle/meta/_journal.json +14 -0
  74. package/resources/fe-dist/assets/DevicePage-Ccz8gNji.js +0 -24
  75. package/resources/fe-dist/assets/SettingsPage-FrEtqZyI.js +0 -39
  76. package/resources/fe-dist/assets/agent-tab-9THUj7Cf.js +0 -38
  77. package/resources/fe-dist/assets/channel-Dzz9b4fW.js +0 -1
  78. package/resources/fe-dist/assets/classDiagram-4FO5ZUOK-BB9_4XLL.js +0 -1
  79. package/resources/fe-dist/assets/classDiagram-v2-Q7XG4LA2-BB9_4XLL.js +0 -1
  80. package/resources/fe-dist/assets/en_US-CjVU4anP.js +0 -1
  81. package/resources/fe-dist/assets/index-CuFTSN9i.css +0 -1
  82. package/resources/fe-dist/assets/ja_JP-Bq-BwOH_.js +0 -1
  83. package/resources/fe-dist/assets/stateDiagram-v2-BHNVJYJU-kSh9IuUW.js +0 -1
  84. package/resources/fe-dist/assets/zh_CN-BuxyXhCT.js +0 -1
@@ -0,0 +1,38 @@
1
+ import{Y as T,r as v,j as e,X as S,u as I,an as se,ao as ne,ap as re,aq as ae,ar as oe,am as F,as as B,at as H,B as N,C as Ie,F as Ce,H as _e,I as Se,G as Me,M as ze,x as J,c as K,N as Te,O as Ee,R as Be,U as X,au as $e,av as qe,V as ie,v as Ae,aw as Pe,af as Oe,ax as Re,ay as h,d as Fe,az as He,aA as Ke,P as Le,aB as We,a2 as Z,aC as De}from"./index-UoApkLSY.js";import{M as Ue,r as Ge}from"./index-DOfY8kwB.js";import{K as Qe,S as Y}from"./send-BgCF67Uc.js";import{Z as de}from"./zap-Dx7JTXJN.js";/**
2
+ * @license lucide-react v0.564.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const Ve=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Je=T("arrow-down",Ve);/**
7
+ * @license lucide-react v0.564.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const Xe=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],Ze=T("brain",Xe);/**
12
+ * @license lucide-react v0.564.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const Ye=[["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"M3 10a2 2 0 0 0 2 2h3",key:"1npucw"}],["path",{d:"M3 5v12a2 2 0 0 0 2 2h3",key:"x1gjn2"}]],et=T("list-tree",Ye);/**
17
+ * @license lucide-react v0.564.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */const tt=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],st=T("search",tt);/**
22
+ * @license lucide-react v0.564.0 - ISC
23
+ *
24
+ * This source code is licensed under the ISC license.
25
+ * See the LICENSE file in the root directory of this source tree.
26
+ */const nt=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],rt=T("square",nt);/**
27
+ * @license lucide-react v0.564.0 - ISC
28
+ *
29
+ * This source code is licensed under the ISC license.
30
+ * See the LICENSE file in the root directory of this source tree.
31
+ */const at=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],ot=T("terminal",at);/**
32
+ * @license lucide-react v0.564.0 - ISC
33
+ *
34
+ * This source code is licensed under the ISC license.
35
+ * See the LICENSE file in the root directory of this source tree.
36
+ */const it=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],dt=T("wrench",it);function lt(t){const s=t.split(`
37
+ `),n=[];let i=[],o=!1;const d=()=>{const c=i.join(`
38
+ `);c.trim()&&n.push(c),i=[]};for(const c of s){if(/^\s*(```|~~~)/.test(c)){o=!o,i.push(c);continue}if(!o&&c.trim()===""){d();continue}i.push(c)}return d(),n}const ct={a:({node:t,...s})=>e.jsx("a",{...s,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline underline-offset-2 break-all"}),pre:({node:t,...s})=>e.jsx("pre",{...s,className:"bg-muted overflow-x-auto rounded-md p-2 font-mono text-xs leading-relaxed"}),code:({node:t,className:s,...n})=>e.jsx("code",{...n,className:S("bg-muted rounded px-1 font-mono text-xs",s)}),ul:({node:t,...s})=>e.jsx("ul",{...s,className:"list-disc pl-5"}),ol:({node:t,...s})=>e.jsx("ol",{...s,className:"list-decimal pl-5"}),blockquote:({node:t,...s})=>e.jsx("blockquote",{...s,className:"border-border text-muted-foreground border-l-2 pl-2"}),h1:({node:t,...s})=>e.jsx("h1",{...s,className:"text-base font-semibold"}),h2:({node:t,...s})=>e.jsx("h2",{...s,className:"text-sm font-semibold"}),h3:({node:t,...s})=>e.jsx("h3",{...s,className:"text-sm font-semibold"}),table:({node:t,...s})=>e.jsx("div",{className:"overflow-x-auto",children:e.jsx("table",{...s,className:"border-border w-full border-collapse border text-xs"})}),th:({node:t,...s})=>e.jsx("th",{...s,className:"border-border bg-muted border px-2 py-1 text-left"}),td:({node:t,...s})=>e.jsx("td",{...s,className:"border-border border px-2 py-1"})},ut=v.memo(function({content:s}){return e.jsx(Ue,{remarkPlugins:[Ge],components:ct,children:s})});function mt({text:t,streaming:s=!1,className:n}){const i=v.useMemo(()=>lt(t),[t]);return e.jsxs("div",{className:S("flex min-w-0 flex-col gap-2 text-sm leading-relaxed",n),children:[i.map((o,d)=>e.jsx(ut,{content:o},d)),s&&e.jsx("span",{"data-testid":"agent-streaming-cursor",className:"bg-foreground inline-block h-4 w-2 animate-pulse self-start"})]})}function xt({text:t,streaming:s=!1,className:n}){return e.jsx("div",{"data-testid":"agent-assistant-message",className:S("min-w-0 max-w-full self-start",n),children:e.jsx(mt,{text:t,streaming:s})})}function pt({text:t,streaming:s=!1,className:n}){const{t:i}=I();return e.jsxs(se,{"data-testid":"agent-reasoning-block",className:S("min-w-0 max-w-full self-start",n),children:[e.jsxs(ne,{className:"text-muted-foreground hover:text-foreground group flex items-center gap-1 text-xs",children:[e.jsx(re,{className:"size-3 transition-transform group-data-[panel-open]:rotate-90"}),e.jsx(Ze,{className:"size-3"}),e.jsx("span",{children:i("agent.reasoning.title")}),s&&e.jsx(ae,{className:"size-3 animate-spin"})]}),e.jsx(oe,{children:e.jsx("div",{className:"text-muted-foreground border-border mt-1 border-l-2 pl-2 text-xs whitespace-pre-wrap break-words",children:t})})]})}const ft=["send_input","read_screen","web_search","fetch_url","run_command","get_pane_info"],gt=["send_input","read_screen","web_search","fetch_url"];function C(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function $(t){if(typeof t=="string")return t;try{return JSON.stringify(t,null,2)}catch{return String(t)}}function ht(t){return C(t.output)&&typeof t.output.error=="string"?t.output.error:t.isError?$(t.output):null}function ee(t){switch(t){case"send_input":return e.jsx(Qe,{className:"size-3.5"});case"read_screen":return e.jsx(ze,{className:"size-3.5"});case"web_search":return e.jsx(st,{className:"size-3.5"});case"fetch_url":return e.jsx(Me,{className:"size-3.5"});default:return e.jsx(dt,{className:"size-3.5"})}}const le=v.createContext(!1);function E({label:t,text:s}){const n=v.useContext(le);return e.jsxs(se,{defaultOpen:n,children:[e.jsxs(ne,{className:"text-muted-foreground hover:text-foreground group flex items-center gap-1 text-xs",children:[e.jsx(re,{className:"size-3 transition-transform group-data-[panel-open]:rotate-90"}),e.jsx("span",{children:t})]}),e.jsx(oe,{children:e.jsx("pre",{className:"bg-muted mt-1 max-h-64 overflow-auto rounded-md p-2 font-mono text-xs whitespace-pre-wrap break-all",children:s})})]})}function jt(t){if(typeof t!="string")return null;try{const s=JSON.parse(t);return Array.isArray(s)?s.filter(C).map(n=>({title:typeof n.title=="string"?n.title:"",url:typeof n.url=="string"?n.url:"",snippet:typeof n.snippet=="string"?n.snippet:""})).filter(n=>n.url):null}catch{return null}}function wt({call:t}){const{t:s}=I(),n=C(t.input)?t.input:{},i=typeof n.text=="string"?n.text:"",o=Array.isArray(n.keys)?n.keys.filter(m=>typeof m=="string"):[],d=Array.isArray(n.combos)?n.combos.filter(C):[],c=C(t.output)?t.output:{},f=typeof c.screenTail=="string"?c.screenTail:"",l=o.length>0||d.length>0;return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[i&&e.jsx("pre",{className:"bg-muted max-h-40 overflow-auto rounded-md p-2 font-mono text-xs whitespace-pre-wrap break-all",children:i}),l&&e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[o.map((m,g)=>e.jsx(J,{variant:"outline",className:"font-mono",children:m},`k-${g}-${m}`)),d.map((m,g)=>{const x=Array.isArray(m.modifiers)?m.modifiers.filter(k=>typeof k=="string"):[],w=typeof m.key=="string"?m.key:"";if(!w&&x.length===0)return null;const u=[...x.map(k=>`${k.charAt(0).toUpperCase()}${k.slice(1)}`),w].filter(Boolean).join("+");return e.jsx(J,{variant:"outline",className:"font-mono",children:u},`c-${g}-${u}`)})]}),f&&e.jsx(E,{label:s("agent.tool.result"),text:f})]})}function bt({call:t}){const{t:s}=I(),n=C(t.output)?t.output:{},i=typeof n.screen=="string"?n.screen:"";return i?e.jsx(E,{label:s("agent.tool.screen"),text:i}):null}function yt({call:t}){const{t:s}=I(),n=C(t.input)?t.input:{},i=typeof n.query=="string"?n.query:"",o=t.resolved&&!t.isError&&!t.denied?jt(t.output):null;return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[i&&e.jsxs("p",{className:"text-muted-foreground text-xs break-words",children:["“",i,"”"]}),o&&o.length>0&&e.jsx("ul",{className:"flex flex-col gap-1",children:o.map(d=>e.jsxs("li",{className:"min-w-0 text-xs",children:[e.jsx("a",{href:d.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary block truncate underline underline-offset-2",title:d.title||d.url,children:d.title||d.url}),d.snippet&&e.jsx("p",{className:"text-muted-foreground line-clamp-2 break-words",children:d.snippet})]},d.url))}),t.resolved&&!t.isError&&!t.denied&&!o&&typeof t.output=="string"&&e.jsx(E,{label:s("agent.tool.result"),text:t.output})]})}function vt({call:t}){const{t:s}=I(),n=C(t.input)?t.input:{},i=typeof n.url=="string"?n.url:"",o=typeof t.output=="string"?t.output:"";return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[i&&e.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"text-primary block truncate text-xs underline underline-offset-2",title:i,children:i}),t.resolved&&!t.isError&&!t.denied&&o&&e.jsx(E,{label:s("agent.tool.result"),text:o})]})}const Nt=/^[A-Za-z0-9+/]{256,}={0,2}$/,kt=/^https?:\/\/\S+\.(png|jpe?g|webp|gif)(\?\S*)?$/i;function It(t){return typeof t!="string"||t.length===0?null:t.startsWith("data:image/")||kt.test(t)?t:Nt.test(t.replace(/\s/g,""))?`data:image/png;base64,${t.replace(/\s/g,"")}`:null}function Ct(t){if(!t.resolved||t.isError||t.denied)return[];const s=[],n=(i,o)=>{if(s.length>=8||o>3)return;const d=It(i);if(d){s.push(d);return}if(Array.isArray(i)){for(const c of i)n(c,o+1);return}if(C(i))for(const c of["result","image","images","url","b64_json","data"])c in i&&n(i[c],o+1)};return n(t.output,0),[...new Set(s)]}function _t({images:t}){return t.length===0?null:e.jsx("div",{className:"flex flex-wrap gap-2",children:t.map((s,n)=>e.jsx("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:"block",children:e.jsx("img",{src:s,alt:"generated",className:"max-h-64 max-w-full rounded-md border border-border object-contain",loading:"lazy"})},n))})}function St({call:t,hideOutput:s}){const{t:n}=I();return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.input!==void 0&&e.jsx(E,{label:n("agent.tool.input"),text:$(t.input)}),!s&&t.resolved&&!t.isError&&!t.denied&&t.output!==void 0&&e.jsx(E,{label:n("agent.tool.result"),text:$(t.output)})]})}function Mt(t){const s=C(t.input)?t.input:{};switch(t.toolName){case"send_input":{const n=[],i=typeof s.text=="string"?s.text:"";i&&n.push(i.slice(0,40));const o=Array.isArray(s.combos)?s.combos:[],d=Array.isArray(s.keys)?s.keys:[],c=o.length+d.length;return c>0&&n.push(`+${c} key${c>1?"s":""}`),n.join(" · ")||"(empty)"}case"read_screen":{const n=C(t.output)?t.output:{},i=typeof n.rows=="number"?n.rows:null;return i!==null?`(${i} rows)`:"(screen)"}case"run_command":return(typeof s.command=="string"?s.command:"").slice(0,60)||"(command)";case"web_search":return(typeof s.query=="string"?s.query:"").slice(0,60)||"(query)";case"fetch_url":return(typeof s.url=="string"?s.url:"").slice(0,60)||"(url)";case"get_pane_info":return"(pane info)";default:return $(t.input).slice(0,60)||""}}function zt({call:t,confirmationId:s,onDecide:n,className:i}){const{t:o}=I(),[d,c]=v.useState(!1),f=!!s&&!t.resolved,l=t.resolved&&t.denied,m=t.resolved&&!l?ht(t):null,g=!t.resolved&&!f,x=l&&typeof t.output=="string"?t.output:"",w=ft.includes(t.toolName)?o(`agent.tool.${t.toolName}`):t.toolName,u=Ct(t),k=gt.includes(t.toolName);return e.jsxs("div",{"data-tool-name":t.toolName,"data-tool-denied":l||void 0,className:S("border-border bg-card flex max-w-full min-w-0 flex-col gap-1.5 self-start rounded-lg border p-2",m!==null&&"border-destructive/50",l&&"opacity-80",i),children:[e.jsxs("button",{type:"button",onClick:()=>c(!0),"data-testid":`agent-tool-card-${t.toolCallId}`,className:"border-border bg-card/50 hover:bg-accent/50 flex max-w-full min-w-0 items-center gap-1.5 rounded-md border px-1.5 py-1 text-xs transition-colors",children:[ee(t.toolName),e.jsx("span",{className:"min-w-0 shrink-0 font-medium truncate",children:w}),e.jsx("span",{className:"text-muted-foreground min-w-0 flex-1 truncate",children:Mt(t)}),g&&e.jsx(ae,{className:"text-muted-foreground size-3 shrink-0 animate-spin"}),t.resolved&&!l&&m===null&&e.jsx(F,{className:"size-3 shrink-0 text-emerald-500"}),m!==null&&e.jsx(B,{className:"text-destructive size-3 shrink-0"}),l&&e.jsx(H,{className:"text-destructive size-3 shrink-0"})]}),m!==null&&e.jsx("p",{className:"text-destructive text-xs break-words whitespace-pre-wrap",children:m}),x&&e.jsx("p",{className:"text-muted-foreground text-xs break-words whitespace-pre-wrap",children:x}),f&&s&&e.jsxs("div",{"data-testid":`agent-tool-approval-${t.toolCallId}`,className:"flex items-center gap-2 pt-1",children:[e.jsx("span",{className:"text-muted-foreground min-w-0 flex-1 text-xs",children:o("agent.confirm.title")}),e.jsxs(N,{"data-testid":"agent-confirm-approve",size:"xs",variant:"secondary",onClick:()=>n==null?void 0:n(s,!0),children:[e.jsx(F,{}),o("agent.confirm.approve")]}),e.jsxs(N,{"data-testid":"agent-confirm-deny",size:"xs",variant:"destructive",onClick:()=>n==null?void 0:n(s,!1),children:[e.jsx(H,{}),o("agent.confirm.deny")]})]}),e.jsx(Ie,{open:d,onOpenChange:c,children:e.jsxs(Ce,{className:"flex max-h-[80vh] max-w-2xl flex-col gap-3 overflow-hidden sm:max-w-2xl",children:[e.jsx(_e,{children:e.jsxs(Se,{className:"flex items-center gap-1.5 text-sm",children:[ee(t.toolName),e.jsx("span",{children:w})]})}),e.jsx("div",{className:"text-muted-foreground flex flex-col gap-3 overflow-auto text-xs",children:e.jsxs(le.Provider,{value:!0,children:[t.toolName==="send_input"&&e.jsx(wt,{call:t}),t.toolName==="read_screen"&&e.jsx(bt,{call:t}),t.toolName==="web_search"&&e.jsx(yt,{call:t}),t.toolName==="fetch_url"&&e.jsx(vt,{call:t}),!k&&e.jsx(St,{call:t,hideOutput:u.length>0}),e.jsx(_t,{images:u})]})})]})})]})}function Tt({text:t,className:s}){return e.jsx("div",{"data-testid":"agent-user-message",className:S("bg-primary text-primary-foreground max-w-[85%] self-end rounded-2xl px-3 py-2 text-sm whitespace-pre-wrap break-words",s),children:t})}const Et=48;function Bt(){return e.jsxs("div",{"data-testid":"agent-running-indicator",className:"flex items-center gap-1 self-start px-1",children:[e.jsx("span",{className:"bg-muted-foreground size-1.5 animate-pulse rounded-full"}),e.jsx("span",{className:"bg-muted-foreground size-1.5 animate-pulse rounded-full [animation-delay:150ms]"}),e.jsx("span",{className:"bg-muted-foreground size-1.5 animate-pulse rounded-full [animation-delay:300ms]"})]})}function $t({blocks:t,running:s,emptyText:n,confirmationByToolCallId:i,onDecide:o,className:d}){const{t:c}=I(),f=v.useRef(null),l=v.useRef(!0),[m,g]=v.useState(!1),x=()=>{const u=f.current;u&&(u.scrollTop=u.scrollHeight,l.current=!0,g(!1))};v.useEffect(()=>{if(l.current){const u=f.current;u&&(u.scrollTop=u.scrollHeight)}else g(!0)},[t,s]);const w=()=>{const u=f.current;if(!u)return;const b=u.scrollHeight-u.scrollTop-u.clientHeight<Et;l.current=b,g(!b)};return t.length===0&&!s?e.jsx("div",{"data-testid":"agent-chat-thread",className:S("flex min-h-0 flex-1 items-center justify-center p-4",d),children:e.jsx("p",{className:"text-muted-foreground text-sm",children:n})}):e.jsxs("div",{className:S("relative min-h-0 flex-1",d),children:[e.jsx("div",{ref:f,"data-testid":"agent-chat-thread",className:"h-full overflow-y-auto p-3",onScroll:w,children:e.jsxs("div",{className:"flex flex-col gap-3",children:[t.map(u=>{switch(u.kind){case"user":return e.jsx(Tt,{text:u.text},u.key);case"assistant-text":return e.jsx(xt,{text:u.text,streaming:u.streaming},u.key);case"reasoning":return e.jsx(pt,{text:u.text,streaming:u.streaming},u.key);case"tool-call":return e.jsx(zt,{call:u.call,confirmationId:i.get(u.call.toolCallId),onDecide:o},u.key);default:return null}}),s&&e.jsx(Bt,{})]})}),m&&e.jsx(N,{"data-testid":"agent-scroll-to-bottom",size:"icon-sm",variant:"secondary",className:"absolute right-3 bottom-3 z-10 rounded-full shadow-md",onClick:x,"aria-label":c("agent.panel.scrollToBottom"),children:e.jsx(Je,{})})]})}const L="::";function te(t,s){return`${t??""}${L}${s}`}function qt(t){const s=t.indexOf(L);return s<0?{providerId:null,modelId:t}:{providerId:t.slice(0,s)||null,modelId:t.slice(s+L.length)}}function At({providerId:t,modelId:s,onChange:n,disabled:i,className:o}){var b;const{t:d}=I(),{data:c}=K({queryKey:["llm-providers"],queryFn:async()=>{const p=await fetch("/api/llm/providers");if(!p.ok)throw new Error("Failed to load providers");return await p.json()},throwOnError:!1}),{data:f}=K({queryKey:["llm-settings"],queryFn:async()=>{const p=await fetch("/api/llm/settings");if(!p.ok)throw new Error("Failed to load settings");return await p.json()},throwOnError:!1}),l=((c==null?void 0:c.providers)??[]).filter(p=>p.enabled&&p.models.length>0),m=t??(f==null?void 0:f.settings.defaultProviderId)??null,g=s??(f==null?void 0:f.settings.defaultModelId)??null,x=g?te(m,g):"",w=l.some(p=>p.id===m&&p.models.includes(g??"")),u=((b=l.find(p=>p.id===m))==null?void 0:b.name)??null,k=g?u?`${u}/${g}`:g:d("agent.model.placeholder");return e.jsxs(Te,{value:x,onValueChange:p=>{if(typeof p!="string"||!p)return;const r=qt(p);n(r.providerId,r.modelId)},disabled:i||l.length===0,children:[e.jsx(Ee,{size:"sm",className:S("h-7 w-full min-w-0 border-transparent bg-transparent text-muted-foreground text-xs hover:border-border/40 dark:bg-transparent dark:hover:bg-transparent",o),"data-testid":"agent-model-picker","aria-label":d("agent.model.select"),children:e.jsx("span",{className:"min-w-0 truncate",children:k})}),e.jsxs(Be,{children:[!w&&g&&e.jsx(X,{value:x,className:"text-muted-foreground",children:g}),l.map(p=>e.jsxs($e,{children:[e.jsx(qe,{children:p.name}),p.models.map(r=>e.jsx(X,{value:te(p.id,r),children:r},`${p.id}:${r}`))]},p.id))]})]})}function Pt({queued:t,onEdit:s,onWithdraw:n,onSteer:i}){const{t:o}=I(),[d,c]=v.useState(null),[f,l]=v.useState("");if(t.length===0)return null;const m=x=>{c(x.id),l(x.text)},g=x=>{const w=f.trim();w&&s(x,w),c(null)};return e.jsxs("div",{"data-testid":"agent-queue",className:"bg-muted/50 mx-3 mb-2 flex shrink-0 flex-col gap-1.5 rounded-xl px-2.5 py-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-muted-foreground text-xs font-medium",children:o("agent.queue.title",{count:t.length})}),e.jsxs(N,{"data-testid":"agent-queue-steer",size:"xs",variant:"outline",onClick:i,title:o("agent.queue.steerHint"),children:[e.jsx(de,{}),o("agent.queue.steer")]})]}),e.jsx("ul",{className:"flex flex-col gap-1",children:t.map(x=>e.jsx("li",{"data-testid":`agent-queue-item-${x.id}`,className:"bg-background/60 flex items-start gap-1.5 rounded-lg px-2 py-1",children:d===x.id?e.jsxs(e.Fragment,{children:[e.jsx(ie,{value:f,onChange:w=>l(w.target.value),onKeyDown:w=>{w.key==="Enter"&&!w.shiftKey&&(w.preventDefault(),g(x.id)),w.key==="Escape"&&c(null)},rows:1,className:"max-h-32 min-h-7 flex-1 resize-none text-xs",autoFocus:!0}),e.jsx(N,{size:"icon-sm",variant:"ghost",onClick:()=>g(x.id),"aria-label":o("common.save"),children:e.jsx(F,{})})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"min-w-0 flex-1 truncate text-xs",children:x.text}),e.jsx(N,{size:"icon-sm",variant:"ghost",onClick:()=>m(x),"aria-label":o("common.edit"),children:e.jsx(Ae,{})}),e.jsx(N,{"data-testid":`agent-queue-withdraw-${x.id}`,size:"icon-sm",variant:"ghost",onClick:()=>n(x.id),"aria-label":o("agent.queue.withdraw"),children:e.jsx(H,{})})]})},x.id))})]})}function Ot({onSend:t,onSteer:s,onStop:n,running:i,steerable:o,disabled:d,modelPicker:c,writeModeControl:f}){const{t:l}=I(),[m,g]=v.useState(""),x=h(b=>{var p;return((p=b.draft)==null?void 0:p.prompt)??null}),w=v.useRef(null);v.useEffect(()=>{x&&x!==w.current&&(w.current=x,g(x))},[x]);const u=()=>{const b=m.trim();!b||d||(t==null||t(b),g(""))},k=()=>{const b=m.trim();!b||d||(s==null||s(b),g(""))};return e.jsxs("div",{"data-testid":"agent-chat-input",className:"bg-chat-surface flex shrink-0 flex-col gap-2 mx-3 mb-2.5 rounded-xl mt-1.5 focus-within:ring-1 focus-within:ring-ring/30",children:[e.jsx(ie,{"data-testid":"agent-chat-input-textarea",value:m,onChange:b=>g(b.target.value),onKeyDown:b=>{b.key==="Enter"&&!b.shiftKey&&!b.nativeEvent.isComposing&&(b.preventDefault(),u())},placeholder:l("agent.panel.inputPlaceholder"),disabled:d,className:"max-h-40 min-h-[4.5rem] w-full resize-none border-transparent bg-transparent p-3 text-[13px] shadow-none focus-visible:border-transparent focus-visible:ring-0 disabled:bg-transparent dark:bg-transparent dark:disabled:bg-transparent",rows:3}),e.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2 px-2.5 pb-2.5",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[f,c&&e.jsx("div",{className:"min-w-0 flex-1",children:c})]}),i?e.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-1.5",children:[o&&e.jsx(N,{"data-testid":"agent-chat-steer",size:"icon",variant:"outline",disabled:d||m.trim().length===0,onClick:k,"aria-label":l("agent.queue.steer"),title:l("agent.queue.steerHint"),children:e.jsx(de,{})}),e.jsx(N,{"data-testid":"agent-chat-send",size:"icon",variant:"secondary",disabled:d||m.trim().length===0,onClick:u,"aria-label":l("agent.panel.send"),children:e.jsx(Y,{})}),e.jsx(N,{"data-testid":"agent-chat-stop",size:"icon",variant:"destructive",onClick:()=>n==null?void 0:n(),"aria-label":l("agent.panel.stop"),children:e.jsx(rt,{})})]}):e.jsx(N,{"data-testid":"agent-chat-send",size:"icon",className:"ml-auto shrink-0",disabled:d||m.trim().length===0,onClick:u,"aria-label":l("agent.panel.send"),children:e.jsx(Y,{})})]})]})}function Rt(t,s,n){var d;if(!t.deviceId||!t.paneId)return null;const i=((d=n==null?void 0:n.find(c=>c.id===t.deviceId))==null?void 0:d.name)??null,o=s[t.deviceId];if(!(o!=null&&o.session))return{label:`${t.paneId}@${i??"?"}`,state:"unknown",windowId:null};for(const c of o.session.windows){const f=c.panes.find(l=>l.id===t.paneId);if(f)return{label:De({paneCustomName:f.customName,paneTitle:f.title,windowName:c.name,windowCustomName:c.customName,deviceName:i}),state:"valid",windowId:c.id}}return{label:`${t.paneId}@${i??"?"}`,state:"invalid",windowId:null}}function Wt(){var Q;const{t}=I(),s=Pe(),n=Oe(a=>a.setSidebarTab),i=Re("/devices/:deviceId/windows/:windowId/panes/:paneId"),o=(i==null?void 0:i.params.deviceId)??null,d=(i==null?void 0:i.params.paneId)??null,c=h(a=>a.sessions),f=h(a=>a.activeSessionId),l=h(a=>a.draft),m=h(a=>a.activeSessionId?a.messages[a.activeSessionId]:void 0),g=h(a=>a.activeSessionId?a.inProgress[a.activeSessionId]:void 0),x=h(a=>a.activeSessionId?a.pendingConfirmations[a.activeSessionId]:void 0),w=h(a=>a.activeSessionId?a.sending[a.activeSessionId]:void 0),u=h(a=>a.activeSessionId?a.queued[a.activeSessionId]:void 0),k=h(a=>a.defaultWriteMode),b=Fe(a=>a.snapshots),{data:p}=K({queryKey:["devices"],queryFn:async()=>{const a=await fetch("/api/devices");if(!a.ok)throw new Error("Failed to load devices");return a.json()},throwOnError:!1});v.useEffect(()=>{const a=h.getState();a.ensureInitialized(),a.loadSessions()},[]);const r=f?c[f]:void 0,q=v.useMemo(()=>{var j,M;if(!o||!d)return null;const a=(M=(j=b[o])==null?void 0:j.session)==null?void 0:M.windows;for(const _ of a??[]){const V=_.panes.find(ke=>ke.id===d);if(V)return V.title??null}return null},[o,d,b]);v.useEffect(()=>{!r&&!l&&o&&d&&h.getState().startDraft(o,d,q)},[r,l,o,d,q]);const ce=v.useMemo(()=>{const a=new Map;for(const j of x??[])a.set(j.toolCallId,j.id);return a},[x]),ue=v.useMemo(()=>{const a=He(m,g),j=new Set;for(const _ of a)_.kind==="tool-call"&&j.add(_.call.toolCallId);const M=[];for(const _ of x??[])j.has(_.toolCallId)||M.push({kind:"tool-call",key:`confirmation-${_.id}`,call:{toolCallId:_.toolCallId,toolName:_.toolName,input:_.input,isError:!1,denied:!1,resolved:!1}});return M.length>0?[...a,...M]:a},[m,g,x]),W=r??(l?{deviceId:l.deviceId,paneId:l.paneId}:null),y=W?Rt(W,b,p==null?void 0:p.devices):null,me=!!(r&&d&&o&&(r.paneId!==d||r.deviceId!==o)),A=(r==null?void 0:r.status)==="running",D=Ke(m),z=!!(r&&(!r.deviceId||!((Q=p==null?void 0:p.devices)!=null&&Q.some(a=>a.id===r.deviceId))||(y==null?void 0:y.state)==="invalid")),P=u??[],xe=(a,j)=>{f&&h.getState().decideConfirmation(f,a,j)},U=()=>{if(r!=null&&r.deviceId){if((y==null?void 0:y.state)==="valid"&&y.windowId&&r.paneId){s(`/devices/${r.deviceId}/windows/${y.windowId}/panes/${encodeURIComponent(r.paneId)}`);return}(y==null?void 0:y.state)==="unknown"&&s(`/devices/${r.deviceId}`)}},pe=()=>{!o||!d||h.getState().startDraft(o,d,q)},fe=(a,j)=>{r?h.getState().setSessionModel(r.id,a,j):l&&h.getState().updateDraft({providerId:a,modelId:j})},ge=a=>{const j=h.getState();if(r){r.status==="running"?j.enqueueMessage(r.id,a):j.sendMessage(r.id,a);return}l&&(async()=>{const M=await j.materializeDraft();M&&await j.sendMessage(M.id,a)})()},he=a=>{r&&h.getState().enqueueMessage(r.id,a,!0)},je=()=>{if(!r)return;const a=P[0];if(!a)return;const j=h.getState();(async()=>(await j.withdrawQueuedMessage(r.id,a.id),await j.enqueueMessage(r.id,a.text,!0)))()},we=r?r.providerId:(l==null?void 0:l.providerId)??null,be=r?r.modelId:(l==null?void 0:l.modelId)??null,O=!!(r||l),R=!!(l&&!r),G=r?r.writeMode:k,ye=(r==null?void 0:r.allowControlChars)??!1,ve=!!(r&&((m==null?void 0:m.length)??0)>0),Ne=z||!O||(r==null?void 0:r.status)==="waiting_confirmation"||!!w;return e.jsxs("div",{"data-testid":"agent-tab",className:"flex h-full min-h-0 flex-col",children:[e.jsxs("div",{className:"flex shrink-0 items-center gap-2 px-3 py-2",children:[y?e.jsxs("button",{type:"button","data-testid":"agent-binding-chip","data-binding-state":y.state,className:S("border-border flex min-w-0 items-center gap-1 rounded-full border px-2 py-0.5 text-xs",r&&y.state==="valid"?"hover:bg-muted cursor-pointer":"text-muted-foreground",y.state==="invalid"&&"opacity-60"),onClick:U,disabled:!r||y.state==="invalid",children:[e.jsx(ot,{className:"size-3 shrink-0"}),e.jsx("span",{className:"min-w-0 truncate",children:y.label}),y.state==="invalid"&&e.jsxs("span",{className:"shrink-0",children:["· ",t("agent.binding.invalid")]})]}):e.jsx("div",{className:"min-w-0 flex-1"}),e.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-1",children:[e.jsx(N,{"data-testid":"agent-session-switch",size:"icon-sm",variant:"ghost",onClick:()=>n("panes"),"aria-label":t("agent.session.switch"),title:t("agent.session.switch"),children:e.jsx(et,{})}),ve&&e.jsx(N,{"data-testid":"agent-session-new",size:"icon-sm",variant:"ghost",disabled:!o||!d,onClick:pe,"aria-label":t("agent.session.new"),title:t(!o||!d?"agent.session.selectPaneHint":"agent.session.new"),children:e.jsx(Le,{})})]})]}),z&&e.jsxs("div",{"data-testid":"agent-orphan-banner",className:"bg-muted/50 text-muted-foreground mx-3 mb-1.5 flex shrink-0 items-start gap-2 rounded-lg px-2 py-1.5 text-xs",children:[e.jsx(B,{className:"mt-0.5 size-3.5 shrink-0"}),e.jsx("span",{className:"min-w-0 flex-1",children:t("agent.orphan.readonly")})]}),r&&!z&&me&&e.jsxs("div",{"data-testid":"agent-pane-mismatch",className:"bg-muted/50 mx-3 mb-1.5 flex shrink-0 flex-wrap items-center gap-2 rounded-lg px-2 py-1.5 text-xs",children:[e.jsx(B,{className:"text-muted-foreground size-3.5 shrink-0"}),e.jsx("span",{className:"text-muted-foreground min-w-0 flex-1",children:t("agent.binding.mismatchTitle")}),(y==null?void 0:y.state)==="valid"&&e.jsx(N,{"data-testid":"agent-binding-goto",size:"xs",variant:"outline",onClick:U,children:t("agent.binding.goTo")}),d&&e.jsx(N,{"data-testid":"agent-binding-rebind",size:"xs",variant:"outline",onClick:()=>{h.getState().rebindPane(r.id,d)},children:t("agent.binding.rebind")})]}),(r==null?void 0:r.status)==="error"&&r.lastError&&e.jsxs("div",{"data-testid":"agent-error-banner",className:"bg-destructive/10 text-destructive mx-3 mb-1.5 flex shrink-0 items-start gap-2 rounded-lg px-2 py-1.5 text-xs",children:[e.jsx(B,{className:"mt-0.5 size-3.5 shrink-0"}),e.jsx("span",{className:"min-w-0 flex-1 break-words",children:r.lastError}),D&&!z&&e.jsx(N,{"data-testid":"agent-error-retry",size:"xs",variant:"outline",className:"shrink-0",disabled:!!w,onClick:()=>{h.getState().sendMessage(r.id,D)},children:t("agent.panel.retry")})]}),!R&&e.jsx($t,{blocks:r?ue:[],running:!!A,emptyText:t(O?"agent.panel.empty":"agent.session.selectPaneHint"),confirmationByToolCallId:ce,onDecide:xe,className:"bg-chat-surface mx-3 mb-2 overflow-hidden rounded-xl"},(r==null?void 0:r.id)??(l?"draft":"none")),r&&!z&&P.length>0&&e.jsx(Pt,{queued:P,onEdit:(a,j)=>void h.getState().editQueuedMessage(r.id,a,j),onWithdraw:a=>void h.getState().withdrawQueuedMessage(r.id,a),onSteer:je}),O&&e.jsxs("div",{className:R?"flex min-h-0 flex-1 flex-col justify-center":"contents",children:[R&&e.jsxs("div",{className:"flex flex-col items-center gap-2 px-6 pb-6 text-center",children:[e.jsx(We,{className:"text-muted-foreground size-9"}),e.jsx("h3",{className:"text-sm font-medium",children:t("agent.welcome.title")}),e.jsx("p",{className:"text-muted-foreground text-xs",children:t("agent.welcome.subtitle")})]}),e.jsx(Ot,{disabled:Ne,running:!!A,steerable:!!r,onSend:ge,onSteer:he,onStop:()=>{r&&h.getState().stopSession(r.id)},modelPicker:e.jsx(At,{providerId:we,modelId:be,onChange:fe,disabled:A}),writeModeControl:e.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-muted-foreground text-xs",children:t(G==="auto"?"agent.writeMode.auto":"agent.writeMode.confirm")}),e.jsx(Z,{"data-testid":"agent-write-mode-switch",checked:G==="auto",disabled:!!r&&z,onCheckedChange:a=>{const j=a?"auto":"confirm";h.getState().setDefaultWriteMode(j),r&&h.getState().setWriteMode(r.id,j)}})]}),r&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-muted-foreground text-xs",title:t("agent.controlChars.hint"),children:t("agent.controlChars.label")}),e.jsx(Z,{"data-testid":"agent-control-chars-switch",checked:ye,disabled:z,title:t("agent.controlChars.hint"),onCheckedChange:a=>{h.getState().setAllowControlChars(r.id,a)}})]})]})})]})]})}export{Wt as AgentTab};
@@ -1,4 +1,4 @@
1
- var N=Object.defineProperty;var P=(t,e,o)=>e in t?N(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o;var O=(t,e,o)=>P(t,typeof e!="symbol"?e+"":e,o);import{Y as x}from"./index-B3ddLSja.js";/**
1
+ var N=Object.defineProperty;var P=(t,e,o)=>e in t?N(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o;var O=(t,e,o)=>P(t,typeof e!="symbol"?e+"":e,o);import{Y as x}from"./index-UoApkLSY.js";/**
2
2
  * @license lucide-react v0.564.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{a0 as ln,a1 as an,a2 as H,a3 as q,a4 as B,a5 as un,a6 as y,a7 as tn,a8 as L,a9 as _,aa as rn,ab as o,ac as on,ad as sn,ae as fn}from"./mermaid.core-D-CshtYr.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,I,D,v,A,C,a){var O=I-l,i=D-h,n=C-v,d=a-A,u=d*O-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*O,h+u*i]}function W(l,h,I,D,v,A,C){var a=l-I,O=h-D,i=(C?A:-A)/L(a*a+O*O),n=i*O,d=-i*a,u=l+n,s=h+d,f=I+n,c=D+d,F=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,S=(g<0?-1:1)*L(on(0,T*T*R-P*P)),j=(P*g-m*S)/R,z=(-P*m-g*S)/R,w=(P*g+m*S)/R,p=(-P*m+g*S)/R,x=j-F,e=z-t,r=w-F,G=p-t;return x*x+e*e>r*r+G*G&&(j=w,z=p),{cx:j,cy:z,x01:-n,y01:-d,x11:j*(v/T-1),y11:z*(v/T-1)}}function hn(){var l=cn,h=yn,I=B(0),D=null,v=gn,A=dn,C=mn,a=null,O=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=A.apply(this,arguments)-un,F=rn(c-f),t=c>f;if(a||(a=n=O()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(F>tn-y)a.moveTo(s*H(f),s*q(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*H(c),u*q(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=F,S=F,j=C.apply(this,arguments)/2,z=j>y&&(D?+D.apply(this,arguments):L(u*u+s*s)),w=_(rn(s-u)/2,+I.apply(this,arguments)),p=w,x=w,e,r;if(z>y){var G=sn(z/u*q(j)),M=sn(z/s*q(j));(P-=G*2)>y?(G*=t?1:-1,R+=G,T-=G):(P=0,R=T=(f+c)/2),(S-=M*2)>y?(M*=t?1:-1,m+=M,g-=M):(S=0,m=g=(f+c)/2)}var J=s*H(m),K=s*q(m),N=u*H(T),Q=u*q(T);if(w>y){var U=s*H(g),V=s*q(g),X=u*H(R),Y=u*q(R),E;if(F<an)if(E=pn(J,K,X,Y,U,V,N,Q)){var Z=J-E[0],$=K-E[1],b=U-E[0],k=V-E[1],nn=1/q(fn((Z*b+$*k)/(L(Z*Z+$*$)*L(b*b+k*k)))/2),en=L(E[0]*E[0]+E[1]*E[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}S>y?x>y?(e=W(X,Y,J,K,s,x,t),r=W(U,V,N,Q,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(J,K),a.arc(0,0,s,m,g,!t)):a.moveTo(J,K),!(u>y)||!(P>y)?a.lineTo(N,Q):p>y?(e=W(N,Q,U,V,u,-p,t),r=W(J,K,X,Y,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-an/2;return[H(d)*n,q(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:B(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:B(+n),i):h},i.cornerRadius=function(n){return arguments.length?(I=typeof n=="function"?n:B(+n),i):I},i.padRadius=function(n){return arguments.length?(D=n==null?null:typeof n=="function"?n:B(+n),i):D},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:B(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:B(+n),i):A},i.padAngle=function(n){return arguments.length?(C=typeof n=="function"?n:B(+n),i):C},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};
1
+ import{a0 as ln,a1 as an,a2 as H,a3 as q,a4 as B,a5 as un,a6 as y,a7 as tn,a8 as L,a9 as _,aa as rn,ab as o,ac as on,ad as sn,ae as fn}from"./mermaid.core-BoNU6G1d.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,I,D,v,A,C,a){var O=I-l,i=D-h,n=C-v,d=a-A,u=d*O-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*O,h+u*i]}function W(l,h,I,D,v,A,C){var a=l-I,O=h-D,i=(C?A:-A)/L(a*a+O*O),n=i*O,d=-i*a,u=l+n,s=h+d,f=I+n,c=D+d,F=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,S=(g<0?-1:1)*L(on(0,T*T*R-P*P)),j=(P*g-m*S)/R,z=(-P*m-g*S)/R,w=(P*g+m*S)/R,p=(-P*m+g*S)/R,x=j-F,e=z-t,r=w-F,G=p-t;return x*x+e*e>r*r+G*G&&(j=w,z=p),{cx:j,cy:z,x01:-n,y01:-d,x11:j*(v/T-1),y11:z*(v/T-1)}}function hn(){var l=cn,h=yn,I=B(0),D=null,v=gn,A=dn,C=mn,a=null,O=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=A.apply(this,arguments)-un,F=rn(c-f),t=c>f;if(a||(a=n=O()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(F>tn-y)a.moveTo(s*H(f),s*q(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*H(c),u*q(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=F,S=F,j=C.apply(this,arguments)/2,z=j>y&&(D?+D.apply(this,arguments):L(u*u+s*s)),w=_(rn(s-u)/2,+I.apply(this,arguments)),p=w,x=w,e,r;if(z>y){var G=sn(z/u*q(j)),M=sn(z/s*q(j));(P-=G*2)>y?(G*=t?1:-1,R+=G,T-=G):(P=0,R=T=(f+c)/2),(S-=M*2)>y?(M*=t?1:-1,m+=M,g-=M):(S=0,m=g=(f+c)/2)}var J=s*H(m),K=s*q(m),N=u*H(T),Q=u*q(T);if(w>y){var U=s*H(g),V=s*q(g),X=u*H(R),Y=u*q(R),E;if(F<an)if(E=pn(J,K,X,Y,U,V,N,Q)){var Z=J-E[0],$=K-E[1],b=U-E[0],k=V-E[1],nn=1/q(fn((Z*b+$*k)/(L(Z*Z+$*$)*L(b*b+k*k)))/2),en=L(E[0]*E[0]+E[1]*E[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}S>y?x>y?(e=W(X,Y,J,K,s,x,t),r=W(U,V,N,Q,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(J,K),a.arc(0,0,s,m,g,!t)):a.moveTo(J,K),!(u>y)||!(P>y)?a.lineTo(N,Q):p>y?(e=W(N,Q,U,V,u,-p,t),r=W(J,K,X,Y,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-an/2;return[H(d)*n,q(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:B(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:B(+n),i):h},i.cornerRadius=function(n){return arguments.length?(I=typeof n=="function"?n:B(+n),i):I},i.padRadius=function(n){return arguments.length?(D=n==null?null:typeof n=="function"?n:B(+n),i):D},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:B(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:B(+n),i):A},i.padAngle=function(n){return arguments.length?(C=typeof n=="function"?n:B(+n),i):C},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};