turbollm 1.9.1 → 1.9.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 (102) hide show
  1. package/dist/cli.js +98 -21
  2. package/dist/webdist/assets/{AgentEditPage-CL3LrppX.js → AgentEditPage-CyzZ8vDr.js} +1 -1
  3. package/dist/webdist/assets/{ChatScreen-C1Uc3Yku.js → ChatScreen-DWVblPWw.js} +1 -1
  4. package/dist/webdist/assets/{CodeComposer-DSTYQfZn.js → CodeComposer-BvNMY6PI.js} +1 -1
  5. package/dist/webdist/assets/{CodeHomeScreen-DuDMAhac.js → CodeHomeScreen-CmzaqOmH.js} +1 -1
  6. package/dist/webdist/assets/{CodeSessionScreen-BG_3mBQw.js → CodeSessionScreen-BtA5u3li.js} +1 -1
  7. package/dist/webdist/assets/{CustomizeScreen-59VclUX9.js → CustomizeScreen-ACC_4SMn.js} +3 -3
  8. package/dist/webdist/assets/{DeveloperScreen-CJ5t_W-i.js → DeveloperScreen-CSJZh91v.js} +1 -1
  9. package/dist/webdist/assets/{EnginesScreen-DDhDoBD2.js → EnginesScreen-ChGdOOW9.js} +1 -1
  10. package/dist/webdist/assets/{FsBrowser-BPZbbFQF.js → FsBrowser-D9RjrjvO.js} +1 -1
  11. package/dist/webdist/assets/{ModelLoadMenu-g3YRMrnX.js → ModelLoadMenu-DzaxKmIV.js} +1 -1
  12. package/dist/webdist/assets/{ModelsScreen-BA1BBOol.js → ModelsScreen-wuI7h511.js} +1 -1
  13. package/dist/webdist/assets/{SettingsScreen-UC-wUufq.js → SettingsScreen-DsKi9vxM.js} +1 -1
  14. package/dist/webdist/assets/{SkillEditPage-BVNWgPo7.js → SkillEditPage-XGTaeQ8o.js} +1 -1
  15. package/dist/webdist/assets/{TokensScreen-Dx0tdvdc.js → TokensScreen-B02y3G-H.js} +1 -1
  16. package/dist/webdist/assets/{ToolApprovalBar-CEs5ZIWL.js → ToolApprovalBar-D4YRUMat.js} +3 -3
  17. package/dist/webdist/assets/WorkspaceScreen-DRoUxluw.js +1 -0
  18. package/dist/webdist/assets/{agent-api-DmI6MYbf.js → agent-api-D86F96i6.js} +1 -1
  19. package/dist/webdist/assets/{arc-D8VgiHW6.js → arc-BScxM0vj.js} +1 -1
  20. package/dist/webdist/assets/{architectureDiagram-3BPJPVTR-DFCF60GK.js → architectureDiagram-3BPJPVTR-DbIjWGrc.js} +1 -1
  21. package/dist/webdist/assets/{arrow-left-DHiJ-HMU.js → arrow-left-Cz7XgLgo.js} +1 -1
  22. package/dist/webdist/assets/{badge-Dpeo8_A8.js → badge-CRVn2top.js} +1 -1
  23. package/dist/webdist/assets/{blockDiagram-GPEHLZMM-B2mr9ptS.js → blockDiagram-GPEHLZMM-COy0nYNX.js} +1 -1
  24. package/dist/webdist/assets/{bot-JdsNC3xo.js → bot-C-sGABri.js} +1 -1
  25. package/dist/webdist/assets/{c4Diagram-AAUBKEIU-9WcH4zG5.js → c4Diagram-AAUBKEIU-CoiZua-v.js} +1 -1
  26. package/dist/webdist/assets/channel-8eXCTkKl.js +1 -0
  27. package/dist/webdist/assets/{chat-api-C2cu2N3E.js → chat-api-CdVOTSst.js} +1 -1
  28. package/dist/webdist/assets/{chat-queries-Bk8dtRmW.js → chat-queries-DINfS8uv.js} +1 -1
  29. package/dist/webdist/assets/check-Do9IgpFj.js +1 -0
  30. package/dist/webdist/assets/{chevron-left-ffmUS1bo.js → chevron-left-CbPqt11D.js} +1 -1
  31. package/dist/webdist/assets/{chevron-right-lQ08UCEN.js → chevron-right-C8EPnhrg.js} +1 -1
  32. package/dist/webdist/assets/{chunk-2J33WTMH-Do7hk3aY.js → chunk-2J33WTMH-B-ggs358.js} +1 -1
  33. package/dist/webdist/assets/{chunk-4BX2VUAB-COch2q0l.js → chunk-4BX2VUAB-CBSHARpe.js} +1 -1
  34. package/dist/webdist/assets/{chunk-55IACEB6-DlRNdk5b.js → chunk-55IACEB6-BikCaTgS.js} +1 -1
  35. package/dist/webdist/assets/{chunk-727SXJPM-_IBt-4x9.js → chunk-727SXJPM-B8Uooh_X.js} +1 -1
  36. package/dist/webdist/assets/{chunk-AQP2D5EJ-DkBsRXEx.js → chunk-AQP2D5EJ-C-wZiAmx.js} +1 -1
  37. package/dist/webdist/assets/{chunk-FMBD7UC4-jKwa055q.js → chunk-FMBD7UC4-lkRMU7V5.js} +1 -1
  38. package/dist/webdist/assets/{chunk-ND2GUHAM-Dy4o9e8b.js → chunk-ND2GUHAM-CTBUDTXK.js} +1 -1
  39. package/dist/webdist/assets/{chunk-QZHKN3VN-DTLVU8e_.js → chunk-QZHKN3VN-CKOXFQ-c.js} +1 -1
  40. package/dist/webdist/assets/{circle-check-CJNLOdAm.js → circle-check-dbo4u23c.js} +1 -1
  41. package/dist/webdist/assets/{circle-x-CNFOnIgE.js → circle-x-CuPWHB4Y.js} +1 -1
  42. package/dist/webdist/assets/classDiagram-4FO5ZUOK-D5bPDMhb.js +1 -0
  43. package/dist/webdist/assets/classDiagram-v2-Q7XG4LA2-D5bPDMhb.js +1 -0
  44. package/dist/webdist/assets/{common-Br2d43RA.js → common-RZkQjs09.js} +1 -1
  45. package/dist/webdist/assets/{copy-button-BrAlefJf.js → copy-button-DKUAZ6Ig.js} +1 -1
  46. package/dist/webdist/assets/{cose-bilkent-S5V4N54A-CMOi5ZRd.js → cose-bilkent-S5V4N54A-L3BPlYev.js} +1 -1
  47. package/dist/webdist/assets/{dagre-BM42HDAG-mkGoHAdD.js → dagre-BM42HDAG-DdFZFhxI.js} +1 -1
  48. package/dist/webdist/assets/{diagram-2AECGRRQ-DLYfv3Tt.js → diagram-2AECGRRQ-Bx4JyVtd.js} +1 -1
  49. package/dist/webdist/assets/{diagram-5GNKFQAL-gJ0FiE3K.js → diagram-5GNKFQAL-DYxtCUYO.js} +1 -1
  50. package/dist/webdist/assets/{diagram-KO2AKTUF-pHUoCM5r.js → diagram-KO2AKTUF-BSV0zTVR.js} +1 -1
  51. package/dist/webdist/assets/{diagram-LMA3HP47-CqAxBy3U.js → diagram-LMA3HP47-CS-L_g7_.js} +1 -1
  52. package/dist/webdist/assets/{diagram-OG6HWLK6-XzhT4DMJ.js → diagram-OG6HWLK6-D8uK9mOu.js} +1 -1
  53. package/dist/webdist/assets/{dialog-Fn-LQd0D.js → dialog-fsfhY_Ib.js} +1 -1
  54. package/dist/webdist/assets/{dropdown-menu-afNQJrSx.js → dropdown-menu-B6pYEdad.js} +1 -1
  55. package/dist/webdist/assets/{erDiagram-TEJ5UH35-Bb7my1c-.js → erDiagram-TEJ5UH35-DX-3blsY.js} +1 -1
  56. package/dist/webdist/assets/{flowDiagram-I6XJVG4X-CoYm4wZs.js → flowDiagram-I6XJVG4X-DUTsLqgt.js} +1 -1
  57. package/dist/webdist/assets/{ganttDiagram-6RSMTGT7-q-pnLU0O.js → ganttDiagram-6RSMTGT7-CwH0oq0S.js} +1 -1
  58. package/dist/webdist/assets/{git-branch-BHktl8gL.js → git-branch-BiMfcJ1j.js} +1 -1
  59. package/dist/webdist/assets/{gitGraphDiagram-PVQCEYII-COFNJi95.js → gitGraphDiagram-PVQCEYII-CmLeqvWh.js} +1 -1
  60. package/dist/webdist/assets/{index-BOZxjJ0U.js → index-DaNuMYPC.js} +2 -2
  61. package/dist/webdist/assets/{infoDiagram-5YYISTIA-Djua9vVH.js → infoDiagram-5YYISTIA-BFTUzkbq.js} +1 -1
  62. package/dist/webdist/assets/{ishikawaDiagram-YF4QCWOH-DKaU42pG.js → ishikawaDiagram-YF4QCWOH-BdQIrqQU.js} +1 -1
  63. package/dist/webdist/assets/{journeyDiagram-JHISSGLW-wKShS-ly.js → journeyDiagram-JHISSGLW-D1HmHaNc.js} +1 -1
  64. package/dist/webdist/assets/{kanban-definition-UN3LZRKU-ccEhP5YP.js → kanban-definition-UN3LZRKU-C5USgc8m.js} +1 -1
  65. package/dist/webdist/assets/{linear-D3ScBPAu.js → linear-BDGxyxLo.js} +1 -1
  66. package/dist/webdist/assets/{lock-CEFYRkdR.js → lock-DCb387O_.js} +1 -1
  67. package/dist/webdist/assets/{mermaid.core-B5yM_SbF.js → mermaid.core-DWCJxsCl.js} +4 -4
  68. package/dist/webdist/assets/{mindmap-definition-RKZ34NQL-Px--F1jE.js → mindmap-definition-RKZ34NQL-BV3H5rWG.js} +1 -1
  69. package/dist/webdist/assets/{pencil-TpRj93pU.js → pencil-BegDY0Zk.js} +1 -1
  70. package/dist/webdist/assets/{personas-BuO6F3d4.js → personas-DNCENHUd.js} +7 -3
  71. package/dist/webdist/assets/{pieDiagram-4H26LBE5-B8FreD07.js → pieDiagram-4H26LBE5-DDN9VAOL.js} +1 -1
  72. package/dist/webdist/assets/{plus-B58ZWo5O.js → plus-DrZmKBTt.js} +1 -1
  73. package/dist/webdist/assets/{quadrantDiagram-W4KKPZXB-D3OlRIB-.js → quadrantDiagram-W4KKPZXB-Bx16Ru8w.js} +1 -1
  74. package/dist/webdist/assets/{refresh-cw-BJYZs3Je.js → refresh-cw-B7Qjdj47.js} +1 -1
  75. package/dist/webdist/assets/{requirementDiagram-4Y6WPE33-Zp2Pf2Hh.js → requirementDiagram-4Y6WPE33-k0upGaul.js} +1 -1
  76. package/dist/webdist/assets/{rotate-ccw-BYQeOHaw.js → rotate-ccw-B7o8hLk6.js} +1 -1
  77. package/dist/webdist/assets/{sankeyDiagram-5OEKKPKP-D3YvZRj2.js → sankeyDiagram-5OEKKPKP-xyOWBpSr.js} +1 -1
  78. package/dist/webdist/assets/{sequenceDiagram-3UESZ5HK-CwCOjaOS.js → sequenceDiagram-3UESZ5HK-BhBclCRW.js} +1 -1
  79. package/dist/webdist/assets/{skeleton-M7Qfb5gz.js → skeleton-D15eL_7e.js} +1 -1
  80. package/dist/webdist/assets/{sliders-horizontal-BOcX1udY.js → sliders-horizontal-C4_t3PES.js} +1 -1
  81. package/dist/webdist/assets/{sparkles-Bb4uZg58.js → sparkles-BT45JGMR.js} +1 -1
  82. package/dist/webdist/assets/{star-D6dguvg4.js → star-SskkfhIb.js} +1 -1
  83. package/dist/webdist/assets/{stateDiagram-AJRCARHV-4aIcjOUO.js → stateDiagram-AJRCARHV-902Ow1i4.js} +1 -1
  84. package/dist/webdist/assets/stateDiagram-v2-BHNVJYJU-B5LKF3CJ.js +1 -0
  85. package/dist/webdist/assets/{switch-BYCZffjv.js → switch-C-l-ej5M.js} +1 -1
  86. package/dist/webdist/assets/{terminal-DBzVaX_I.js → terminal-55Og1Fyx.js} +1 -1
  87. package/dist/webdist/assets/{timeline-definition-PNZ67QCA-BhfTuD64.js → timeline-definition-PNZ67QCA-BEyTzrTZ.js} +1 -1
  88. package/dist/webdist/assets/{trash-2-CTqgFdhY.js → trash-2-B9nMCHMA.js} +1 -1
  89. package/dist/webdist/assets/{useIsDesktop--TrjyaAR.js → useIsDesktop-D2KX8NOA.js} +1 -1
  90. package/dist/webdist/assets/{vennDiagram-CIIHVFJN-D0sQwTM_.js → vennDiagram-CIIHVFJN-C77U6Nzk.js} +1 -1
  91. package/dist/webdist/assets/{wardley-L42UT6IY-BpAdkNng.js → wardley-L42UT6IY-BZ10FiAs.js} +1 -1
  92. package/dist/webdist/assets/{wardleyDiagram-YWT4CUSO-CCTB-C_D.js → wardleyDiagram-YWT4CUSO-DgrAaqyf.js} +1 -1
  93. package/dist/webdist/assets/{wrench-CDLv0ue0.js → wrench-DMY_WSQ9.js} +1 -1
  94. package/dist/webdist/assets/{xychartDiagram-2RQKCTM6-C7yHxVHX.js → xychartDiagram-2RQKCTM6-BlzVJUn3.js} +1 -1
  95. package/dist/webdist/index.html +1 -1
  96. package/package.json +1 -1
  97. package/dist/webdist/assets/WorkspaceScreen-CJuQPS2a.js +0 -1
  98. package/dist/webdist/assets/channel-C0sqITVY.js +0 -1
  99. package/dist/webdist/assets/check-BWcNPlGe.js +0 -1
  100. package/dist/webdist/assets/classDiagram-4FO5ZUOK-BwdZnjq3.js +0 -1
  101. package/dist/webdist/assets/classDiagram-v2-Q7XG4LA2-BwdZnjq3.js +0 -1
  102. package/dist/webdist/assets/stateDiagram-v2-BHNVJYJU-C0nTJDkn.js +0 -1
package/dist/cli.js CHANGED
@@ -3713,6 +3713,7 @@ function isIntegratedGpuName(name) {
3713
3713
  if (/iris|uhd graphics|hd graphics/.test(n)) return true;
3714
3714
  if (/\barc\b/.test(n) && !/\b(?:pro\s+)?[ab]\d{2,4}\b/.test(n)) return true;
3715
3715
  if (/radeon.*graphics/.test(n) && !/\b(rx|pro|instinct|vega\s*\d|firepro)\b/.test(n)) return true;
3716
+ if (/radeon\s*(?:[6-9]\d{2}|\d{4})\s*[ms]\b/.test(n) && !/\b(rx|pro|instinct|vega\s*\d|firepro)\b/.test(n)) return true;
3716
3717
  if (/intel/.test(n) && /graphics/.test(n) && !/\barc\b/.test(n)) return true;
3717
3718
  if (/mali|immortalis/.test(n)) return true;
3718
3719
  if (/adreno/.test(n)) return true;
@@ -3739,7 +3740,7 @@ function detectGpus() {
3739
3740
  const out = execFileSync2("system_profiler", ["SPDisplaysDataType"], { timeout: 8e3 }).toString();
3740
3741
  const m = out.match(/Chipset Model:\s*(.+)/);
3741
3742
  if (m && /Apple/.test(out)) {
3742
- return [{ name: m[1].trim(), vramMb: Math.round(os.totalmem() / 1e6 * 0.65), vendor: "apple" }];
3743
+ return [{ name: m[1].trim(), vramMb: Math.round(os.totalmem() / 1e6 * 0.65), vendor: "apple", unified: true }];
3743
3744
  }
3744
3745
  } catch {
3745
3746
  }
@@ -3766,8 +3767,9 @@ function enumWindowsGpus() {
3766
3767
  const [name, ram] = line.split("|");
3767
3768
  const nm = (name ?? "").trim();
3768
3769
  const bytes = parseInt((ram ?? "").trim(), 10) || 0;
3769
- const vramMb = isIntegratedGpuName(nm) ? Math.round(os.totalmem() / 1e6 * 0.5) : bytes > 0 ? Math.round(bytes / 1e6) : 0;
3770
- return { name: nm, vramMb, vendor: classifyVendor(nm) };
3770
+ const integrated = isIntegratedGpuName(nm);
3771
+ const vramMb = integrated ? Math.round(os.totalmem() / 1e6 * 0.5) : bytes > 0 ? Math.round(bytes / 1e6) : 0;
3772
+ return { name: nm, vramMb, vendor: classifyVendor(nm), ...integrated ? { unified: true } : {} };
3771
3773
  }).filter((g) => g.name && g.vendor !== "unknown");
3772
3774
  const registryVram = readWindowsVramRegistry();
3773
3775
  return wmiGpus.map((g) => {
@@ -3841,14 +3843,7 @@ function enumLinuxGpus() {
3841
3843
  timeout: 8e3
3842
3844
  }).toString();
3843
3845
  if (out.trim()) {
3844
- const gpus = out.trim().split("\n").filter(Boolean).map((line) => {
3845
- const vendor = classifyVendor(line);
3846
- const slot = line.trim().split(/\s+/)[0] ?? "";
3847
- const name = line.replace(/"/g, "").trim().slice(0, 80);
3848
- const sysfsVramMb = linuxVramMb(slot);
3849
- const vramMb = sysfsVramMb > 0 ? sysfsVramMb : isIntegratedGpuName(name) ? Math.round(os.totalmem() / 1e6 * 0.5) : 0;
3850
- return { name, vramMb, vendor };
3851
- }).filter((g) => g.vendor !== "unknown");
3846
+ const gpus = out.trim().split("\n").filter(Boolean).map((line) => linuxGpuFromLspci(line, linuxAmdgpuMem, linuxAmdIsApu, os.totalmem(), console.log)).filter((g) => g !== null && g.vendor !== "unknown");
3852
3847
  if (gpus.length) return gpus;
3853
3848
  }
3854
3849
  } catch {
@@ -3894,18 +3889,99 @@ function makeVulkanGpu(name, deviceType) {
3894
3889
  const vendor = classifyVendor(name);
3895
3890
  const integrated = /INTEGRATED_GPU/i.test(deviceType) || isIntegratedGpuName(name);
3896
3891
  const vramMb = integrated ? Math.round(os.totalmem() / 1e6 * 0.5) : 0;
3897
- return { name, vramMb, vendor };
3898
- }
3899
- function linuxVramMb(pciSlot) {
3900
- if (!pciSlot) return 0;
3892
+ return { name, vramMb, vendor, ...integrated ? { unified: true } : {} };
3893
+ }
3894
+ function parseLspciMm(line) {
3895
+ const slot = line.trim().split(/\s+/)[0] ?? "";
3896
+ const fields = (line.match(/"[^"]*"/g) ?? []).map((f) => f.slice(1, -1).trim());
3897
+ if (!slot || slot.includes('"') || fields.length < 3) return null;
3898
+ return { slot, deviceClass: fields[0], vendor: fields[1], device: fields[2] };
3899
+ }
3900
+ function linuxGpuFromLspci(line, readMem, isApu, totalRamBytes, log = () => {
3901
+ }) {
3902
+ const entry = parseLspciMm(line);
3903
+ const slot = entry?.slot ?? (line.trim().split(/\s+/)[0] ?? "");
3904
+ if (!slot) return null;
3905
+ const label = entry ? `${entry.vendor} ${entry.device}` : line;
3906
+ const device = entry ? /^device\s+[0-9a-f]{4}$/i.test(entry.device) ? `${entry.vendor} ${entry.device}` : entry.device : "";
3907
+ const name = entry ? device.slice(0, 80) : line.replace(/"/g, "").trim().slice(0, 80);
3908
+ const vendor = classifyVendor(label);
3909
+ const mem = readMem(slot);
3910
+ let vramMb = mem.vramMb;
3911
+ let unified = false;
3912
+ if (mem.vramMb > 0 && vendor === "amd" && mem.gttMb > 0 && isApu(slot, label)) {
3913
+ vramMb = amdApuVramMb(mem.vramMb, mem.gttMb, totalRamBytes);
3914
+ unified = true;
3915
+ log(`[sysinfo] amdgpu APU at ${slot}: vram=${mem.vramMb}MB + gtt=${mem.gttMb}MB \u2192 ${vramMb}MB usable`);
3916
+ } else if (vramMb === 0 && isIntegratedGpuName(label)) {
3917
+ vramMb = Math.round(totalRamBytes / 1e6 * 0.5);
3918
+ unified = true;
3919
+ }
3920
+ return { name, vramMb, vendor, ...unified ? { unified: true } : {} };
3921
+ }
3922
+ function linuxAmdgpuMem(pciSlot) {
3923
+ if (!pciSlot) return { vramMb: 0, gttMb: 0 };
3901
3924
  for (const dev of [`/sys/bus/pci/devices/0000:${pciSlot}`, `/sys/bus/pci/devices/${pciSlot}`]) {
3902
- try {
3903
- const bytes = parseInt(fs.readFileSync(`${dev}/mem_info_vram_total`, "utf8").trim(), 10);
3904
- if (Number.isFinite(bytes) && bytes > 0) return Math.round(bytes / 1e6);
3905
- } catch {
3925
+ const vram = readSysfsBytes(dev, "mem_info_vram_total");
3926
+ if (vram > 0) return { vramMb: Math.round(vram / 1e6), gttMb: Math.round(readSysfsBytes(dev, "mem_info_gtt_total") / 1e6) };
3927
+ }
3928
+ return { vramMb: 0, gttMb: 0 };
3929
+ }
3930
+ function readSysfsBytes(dir, attr) {
3931
+ try {
3932
+ const bytes = parseInt(fs.readFileSync(`${dir}/${attr}`, "utf8").trim(), 10);
3933
+ return Number.isFinite(bytes) && bytes > 0 ? bytes : 0;
3934
+ } catch {
3935
+ return 0;
3936
+ }
3937
+ }
3938
+ function amdApuVramMb(vramMb, gttMb, totalRamBytes) {
3939
+ const cap = Math.round(totalRamBytes / 1e6 * 0.9);
3940
+ return Math.max(vramMb, Math.min(vramMb + gttMb, cap));
3941
+ }
3942
+ function parseKfdNodes(propsTexts) {
3943
+ const nodes = [];
3944
+ for (const text of propsTexts) {
3945
+ const prop = (key) => {
3946
+ const m = new RegExp(`^${key}\\s+(\\d+)\\s*$`, "m").exec(text);
3947
+ return m ? parseInt(m[1], 10) : 0;
3948
+ };
3949
+ if (prop("simd_count") <= 0) continue;
3950
+ nodes.push({ domain: prop("domain"), locationId: prop("location_id"), fused: prop("cpu_cores_count") > 0 });
3951
+ }
3952
+ return nodes;
3953
+ }
3954
+ function pciSlotToKfdIds(slot) {
3955
+ const m = /^(?:([0-9a-f]{1,4}):)?([0-9a-f]{1,2}):([0-9a-f]{1,2})\.([0-7])$/i.exec(slot.trim());
3956
+ if (!m) return null;
3957
+ return {
3958
+ domain: m[1] === void 0 ? 0 : parseInt(m[1], 16),
3959
+ locationId: parseInt(m[2], 16) << 8 | (parseInt(m[3], 16) & 31) << 3 | parseInt(m[4], 10)
3960
+ };
3961
+ }
3962
+ function linuxAmdIsApu(pciSlot, label) {
3963
+ if (kfdReportsFusedNode(pciSlot)) return true;
3964
+ return isIntegratedGpuName(label);
3965
+ }
3966
+ function kfdReportsFusedNode(pciSlot) {
3967
+ const ids = pciSlotToKfdIds(pciSlot);
3968
+ if (!ids) return false;
3969
+ return readKfdNodes().some((n) => n.domain === ids.domain && n.locationId === ids.locationId && n.fused);
3970
+ }
3971
+ function readKfdNodes() {
3972
+ const base2 = "/sys/class/kfd/kfd/topology/nodes";
3973
+ try {
3974
+ const texts = [];
3975
+ for (const entry of fs.readdirSync(base2)) {
3976
+ try {
3977
+ texts.push(fs.readFileSync(`${base2}/${entry}/properties`, "utf8"));
3978
+ } catch {
3979
+ }
3906
3980
  }
3981
+ return parseKfdNodes(texts);
3982
+ } catch {
3983
+ return [];
3907
3984
  }
3908
- return 0;
3909
3985
  }
3910
3986
  function getCpuModel() {
3911
3987
  const model = os.cpus()[0]?.model?.trim();
@@ -14279,7 +14355,8 @@ function detectHardware(info = getSysInfo()) {
14279
14355
  const arch2 = process.arch === "arm64" ? "arm64" : "x64";
14280
14356
  const gpuVendor = primaryVendor(info);
14281
14357
  const hasGpu = gpuVendor !== "unknown" && info.gpus.length > 0;
14282
- const ofVendor = info.gpus.filter((g) => g.vendor === gpuVendor);
14358
+ const allOfVendor = info.gpus.filter((g) => g.vendor === gpuVendor);
14359
+ const ofVendor = allOfVendor.some((g) => !g.unified) ? allOfVendor.filter((g) => !g.unified) : allOfVendor;
14283
14360
  const pool = ofVendor.length ? ofVendor : info.gpus;
14284
14361
  const headline = pool.reduce(
14285
14362
  (best, g) => !best || g.vramMb > best.vramMb ? g : best,
@@ -1 +1 @@
1
- import{j as e}from"./radix-j_81dozL.js";import{u as M,b as W,r as b}from"./vendor-BFom-Mq6.js";import{u as $,b as G,c as H,d as Y,e as J,a as E,B as y,f as B,t as h,A as C}from"./index-BOZxjJ0U.js";import{f as U}from"./chat-api-C2cu2N3E.js";import{f as V,a as X}from"./agent-api-DmI6MYbf.js";import{P as z}from"./personas-BuO6F3d4.js";import{C as Z}from"./chevron-left-ffmUS1bo.js";import{R as ee}from"./rotate-ccw-BYQeOHaw.js";import{T as te}from"./trash-2-CTqgFdhY.js";import{C as se}from"./chevron-right-lQ08UCEN.js";const ne=()=>({name:"",description:"",systemPrompt:"",skillIds:[],tools:[]});function oe(s){const d=[],x=new Map;for(const n of s){const o=/^mcp__([^_]+(?:_[^_]+)*)__/.exec(n.name);if(!o){d.push(n);continue}const i=o[1],p=/^\[([^\]]+)\]/.exec(n.description),c=p?p[1]:i.replace(/_/g," ");x.has(i)||x.set(i,{key:i,label:c,tools:[]}),x.get(i).tools.push(n)}return{builtin:d,groups:[...x.values()].sort((n,o)=>n.label.localeCompare(o.label))}}function ae(s){return s.replace(/^mcp__[^_]+(?:_[^_]+)*__/,"")}function le(s){return s.replace(/^\[[^\]]+\]\s*/,"")}function q({tool:s,checked:d,onToggle:x}){return e.jsxs("label",{className:"flex cursor-pointer items-start gap-2 text-[12px]",children:[e.jsx("input",{type:"checkbox",className:"mt-0.5",checked:d,onChange:x}),e.jsxs("span",{className:"flex flex-col",children:[e.jsx("span",{className:"font-mono text-ink",children:ae(s.name)}),s.description&&e.jsx("span",{className:"text-faint",children:le(s.description)})]})]})}function re({group:s,selected:d,onToggleAll:x,onToggleOne:n}){const[o,i]=b.useState(!1),p=s.tools.map(l=>l.name),c=p.filter(l=>d.has(l)).length,a=c===p.length,f=c>0&&!a,u=b.useRef(null);return b.useEffect(()=>{u.current&&(u.current.indeterminate=f)},[f]),e.jsxs("div",{className:"rounded-md border border-border",children:[e.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-2",children:[e.jsx("input",{ref:u,type:"checkbox",checked:a,onChange:()=>x(p,!a)}),e.jsxs("button",{type:"button",onClick:()=>i(l=>!l),className:"flex flex-1 items-center gap-1.5 text-left text-[13px] text-ink",children:[e.jsx(se,{size:12,className:B("shrink-0 text-faint transition-transform",o&&"rotate-90")}),s.label,e.jsxs("span",{className:"text-[11px] text-faint",children:["(",c,"/",p.length,")"]})]})]}),o&&e.jsx("div",{className:"flex flex-col gap-1.5 border-t border-border px-3 py-2 pl-9",children:s.tools.map(l=>e.jsx(q,{tool:l,checked:d.has(l.name),onToggle:()=>n(l.name)},l.name))})]})}function ie({tools:s,selected:d,onChange:x}){const n=new Set(d),{builtin:o,groups:i}=oe(s),p=a=>x(n.has(a)?d.filter(f=>f!==a):[...d,a]),c=(a,f)=>{const u=d.filter(l=>!a.includes(l));x(f?[...u,...a]:u)};return s.length===0?e.jsx("p",{className:"text-[12px] text-faint",children:"No tools available yet."}):e.jsxs("div",{className:"flex flex-col gap-2",children:[o.length>0&&e.jsx("div",{className:"flex flex-col gap-2 rounded-md border border-border bg-panel-2 p-3",children:o.map(a=>e.jsx(q,{tool:a,checked:n.has(a.name),onToggle:()=>p(a.name)},a.name))}),i.map(a=>e.jsx(re,{group:a,selected:n,onToggleAll:c,onToggleOne:p},a.key))]})}function ke(){const{agentId:s="new"}=M(),d=W(),x=$(),n=s==="new",o=!n&&z.some(t=>t.id===s),i=o?z.find(t=>t.id===s):void 0,p=G(),c=!n&&!o?(p.data??[]).find(t=>t.id===s):void 0,a=H(),f=Y(),u=J(),l=o?f.data?.[s]:void 0,_=E({queryKey:X.list(),queryFn:V,staleTime:0}),k=_.data??[],I=E({queryKey:["available-tools"],queryFn:U}),j=I.data??[],[m,g]=b.useState(ne()),[S,T]=b.useState(!1),[A,P]=b.useState(!1),[D,w]=b.useState(!1),[R,L]=b.useState("skills");n&&!S&&(k.length||j.length)&&(g(t=>({...t,skillIds:k.map(r=>r.id),tools:j.map(r=>r.name)})),T(!0)),!n&&!o&&!S&&c&&(g({name:c.name,description:c.description,systemPrompt:c.systemPrompt,skillIds:c.skillIds,tools:c.tools}),T(!0)),o&&!S&&i&&f.isSuccess&&(k.length||j.length)&&(g({name:l?.name??i.name,description:l?.description??i.description,systemPrompt:l?.systemPrompt??i.systemPrompt,skillIds:l?.skillIds??k.map(t=>t.id),tools:l?.tools??j.map(t=>t.name)}),T(!0));const N=()=>d("/customize"),Q=t=>g(r=>({...r,skillIds:r.skillIds.includes(t)?r.skillIds.filter(v=>v!==t):[...r.skillIds,t]})),O=()=>{if(!m.name.trim()){h.error("Name is required.");return}P(!0);const t={name:m.name.trim(),description:m.description.trim(),systemPrompt:m.systemPrompt,skillIds:m.skillIds,tools:m.tools};if(o){u.save.mutate({id:s,override:t},{onSuccess:()=>{h.success("Agent saved."),N()},onError:v=>{h.error(v instanceof C?v.message:"Could not save agent."),P(!1)}});return}const r={onSuccess:()=>{x.invalidateQueries({queryKey:["chat-agents"]}),h.success(n?"Agent created.":"Agent saved."),N()},onError:v=>{h.error(v instanceof C?v.message:"Could not save agent."),P(!1)}};n?a.add.mutate(t,r):a.update.mutate({id:s,patch:t},r)},F=()=>{u.reset.mutate(s,{onSuccess:()=>{h.success("Reset to default."),i&&g({name:i.name,description:i.description,systemPrompt:i.systemPrompt,skillIds:k.map(t=>t.id),tools:j.map(t=>t.name)})},onError:t=>h.error(t instanceof C?t.message:"Could not reset agent.")})},K=()=>{a.remove.mutate(s,{onSuccess:()=>{h.success("Agent deleted."),N()},onError:t=>h.error(t instanceof C?t.message:"Could not delete agent.")})};return!n&&!o&&p.isSuccess&&!c?e.jsxs("div",{className:"flex w-full flex-col items-center gap-3 px-8 py-16",children:[e.jsx("p",{className:"text-[14px] text-muted",children:"That agent no longer exists."}),e.jsx(y,{size:"sm",variant:"outline",onClick:N,children:"Back to agents"})]}):e.jsxs("div",{className:"flex w-full max-w-4xl flex-col gap-5 px-4 py-6 md:px-8",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("button",{type:"button",onClick:N,className:"text-faint hover:text-ink",title:"Back to agents",children:e.jsx(Z,{size:18})}),e.jsx("span",{className:"text-[15px] font-medium text-ink",children:n?"New agent":o?l?"Edit agent (modified built-in)":"Edit agent (built-in)":"Edit agent"}),e.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[o&&e.jsxs(y,{size:"sm",variant:"outline",onClick:F,disabled:u.reset.isPending,children:[e.jsx(ee,{size:13})," Reset to default"]}),e.jsx(y,{size:"sm",variant:"outline",onClick:N,children:"Cancel"}),e.jsx(y,{size:"sm",onClick:O,disabled:A||!m.name.trim(),children:A?"Saving…":"Save"})]})]}),o&&e.jsx("p",{className:"rounded-md border border-border bg-panel px-3 py-2 text-[12px] text-muted",children:"Built-in agents can be edited in place — Reset to default discards your changes and restores TurboLLM's original prompt and access."}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-[12px] font-medium text-muted",children:"Name"}),e.jsx("input",{className:"rounded-md border border-border bg-bg px-3 py-1.5 text-[13px] text-ink outline-none focus:border-accent placeholder:text-faint",placeholder:"Release Notes Writer",value:m.name,onChange:t=>g(r=>({...r,name:t.target.value}))})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-[12px] font-medium text-muted",children:"Description"}),e.jsx("input",{className:"rounded-md border border-border bg-bg px-3 py-1.5 text-[13px] text-ink outline-none focus:border-accent placeholder:text-faint",placeholder:"What this agent is for, in one line",value:m.description,onChange:t=>g(r=>({...r,description:t.target.value}))})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-[12px] font-medium text-muted",children:"System prompt"}),e.jsx("textarea",{className:"min-h-[160px] resize-y rounded-md border border-border bg-bg px-3 py-2 font-mono text-[12px] leading-relaxed text-ink outline-none focus:border-accent placeholder:text-faint",placeholder:"You are…",value:m.systemPrompt,onChange:t=>g(r=>({...r,systemPrompt:t.target.value}))})]}),e.jsxs("div",{className:"flex flex-col gap-2.5",children:[e.jsx("div",{className:"inline-flex w-fit rounded-md border border-border p-0.5",children:["skills","tools"].map(t=>e.jsx("button",{type:"button",onClick:()=>L(t),className:B("rounded px-3 py-1.5 text-[13px] font-medium transition-colors",R===t?"bg-accent/12 text-accent":"text-muted hover:text-ink"),children:t==="skills"?`Skills (${m.skillIds.length})`:`Tools (${m.tools.length})`},t))}),R==="skills"?_.isLoading?e.jsx("p",{className:"text-[12px] text-faint",children:"Loading…"}):k.length===0?e.jsx("p",{className:"text-[12px] text-faint",children:"No skills yet — create one under Customize → Skills."}):e.jsx("div",{className:"flex flex-col gap-2 rounded-md border border-border bg-panel-2 p-3",children:k.map(t=>e.jsxs("label",{className:"flex cursor-pointer items-start gap-2 text-[13px]",children:[e.jsx("input",{type:"checkbox",className:"mt-0.5",checked:m.skillIds.includes(t.id),onChange:()=>Q(t.id)}),e.jsxs("span",{className:"flex flex-col",children:[e.jsx("span",{className:"text-ink",children:t.name}),t.description&&e.jsx("span",{className:"text-[12px] text-muted",children:t.description})]})]},t.id))}):I.isLoading?e.jsx("p",{className:"text-[12px] text-faint",children:"Loading…"}):e.jsx(ie,{tools:j,selected:m.tools,onChange:t=>g(r=>({...r,tools:t}))})]}),!n&&!o&&(D?e.jsxs("div",{className:"flex items-center gap-2 self-start rounded-md border border-border bg-panel p-2 text-[12px]",children:[e.jsx("span",{className:"flex-1 text-muted",children:"Delete this agent?"}),e.jsx("button",{type:"button",onClick:K,className:"rounded px-2 py-1 text-[color:var(--err)] hover:bg-[color:color-mix(in_srgb,var(--err)_12%,transparent)]",children:"Delete"}),e.jsx("button",{type:"button",onClick:()=>w(!1),className:"rounded px-2 py-1 text-faint hover:text-ink",children:"Cancel"})]}):e.jsxs("button",{type:"button",onClick:()=>w(!0),className:"flex items-center gap-1.5 self-start text-[12px] text-faint hover:text-[color:var(--err)]",children:[e.jsx(te,{size:13})," Delete agent"]}))]})}export{ke as AgentEditPage};
1
+ import{j as e}from"./radix-j_81dozL.js";import{u as M,b as W,r as b}from"./vendor-BFom-Mq6.js";import{u as $,b as G,c as H,d as Y,e as J,a as E,B as y,f as B,t as h,A as C}from"./index-DaNuMYPC.js";import{f as U}from"./chat-api-CdVOTSst.js";import{f as V,a as X}from"./agent-api-D86F96i6.js";import{P as z}from"./personas-DNCENHUd.js";import{C as Z}from"./chevron-left-CbPqt11D.js";import{R as ee}from"./rotate-ccw-B7o8hLk6.js";import{T as te}from"./trash-2-B9nMCHMA.js";import{C as se}from"./chevron-right-C8EPnhrg.js";const ne=()=>({name:"",description:"",systemPrompt:"",skillIds:[],tools:[]});function oe(s){const d=[],x=new Map;for(const n of s){const o=/^mcp__([^_]+(?:_[^_]+)*)__/.exec(n.name);if(!o){d.push(n);continue}const i=o[1],p=/^\[([^\]]+)\]/.exec(n.description),c=p?p[1]:i.replace(/_/g," ");x.has(i)||x.set(i,{key:i,label:c,tools:[]}),x.get(i).tools.push(n)}return{builtin:d,groups:[...x.values()].sort((n,o)=>n.label.localeCompare(o.label))}}function ae(s){return s.replace(/^mcp__[^_]+(?:_[^_]+)*__/,"")}function le(s){return s.replace(/^\[[^\]]+\]\s*/,"")}function q({tool:s,checked:d,onToggle:x}){return e.jsxs("label",{className:"flex cursor-pointer items-start gap-2 text-[12px]",children:[e.jsx("input",{type:"checkbox",className:"mt-0.5",checked:d,onChange:x}),e.jsxs("span",{className:"flex flex-col",children:[e.jsx("span",{className:"font-mono text-ink",children:ae(s.name)}),s.description&&e.jsx("span",{className:"text-faint",children:le(s.description)})]})]})}function re({group:s,selected:d,onToggleAll:x,onToggleOne:n}){const[o,i]=b.useState(!1),p=s.tools.map(l=>l.name),c=p.filter(l=>d.has(l)).length,a=c===p.length,f=c>0&&!a,u=b.useRef(null);return b.useEffect(()=>{u.current&&(u.current.indeterminate=f)},[f]),e.jsxs("div",{className:"rounded-md border border-border",children:[e.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-2",children:[e.jsx("input",{ref:u,type:"checkbox",checked:a,onChange:()=>x(p,!a)}),e.jsxs("button",{type:"button",onClick:()=>i(l=>!l),className:"flex flex-1 items-center gap-1.5 text-left text-[13px] text-ink",children:[e.jsx(se,{size:12,className:B("shrink-0 text-faint transition-transform",o&&"rotate-90")}),s.label,e.jsxs("span",{className:"text-[11px] text-faint",children:["(",c,"/",p.length,")"]})]})]}),o&&e.jsx("div",{className:"flex flex-col gap-1.5 border-t border-border px-3 py-2 pl-9",children:s.tools.map(l=>e.jsx(q,{tool:l,checked:d.has(l.name),onToggle:()=>n(l.name)},l.name))})]})}function ie({tools:s,selected:d,onChange:x}){const n=new Set(d),{builtin:o,groups:i}=oe(s),p=a=>x(n.has(a)?d.filter(f=>f!==a):[...d,a]),c=(a,f)=>{const u=d.filter(l=>!a.includes(l));x(f?[...u,...a]:u)};return s.length===0?e.jsx("p",{className:"text-[12px] text-faint",children:"No tools available yet."}):e.jsxs("div",{className:"flex flex-col gap-2",children:[o.length>0&&e.jsx("div",{className:"flex flex-col gap-2 rounded-md border border-border bg-panel-2 p-3",children:o.map(a=>e.jsx(q,{tool:a,checked:n.has(a.name),onToggle:()=>p(a.name)},a.name))}),i.map(a=>e.jsx(re,{group:a,selected:n,onToggleAll:c,onToggleOne:p},a.key))]})}function ke(){const{agentId:s="new"}=M(),d=W(),x=$(),n=s==="new",o=!n&&z.some(t=>t.id===s),i=o?z.find(t=>t.id===s):void 0,p=G(),c=!n&&!o?(p.data??[]).find(t=>t.id===s):void 0,a=H(),f=Y(),u=J(),l=o?f.data?.[s]:void 0,_=E({queryKey:X.list(),queryFn:V,staleTime:0}),k=_.data??[],I=E({queryKey:["available-tools"],queryFn:U}),j=I.data??[],[m,g]=b.useState(ne()),[S,T]=b.useState(!1),[A,P]=b.useState(!1),[D,w]=b.useState(!1),[R,L]=b.useState("skills");n&&!S&&(k.length||j.length)&&(g(t=>({...t,skillIds:k.map(r=>r.id),tools:j.map(r=>r.name)})),T(!0)),!n&&!o&&!S&&c&&(g({name:c.name,description:c.description,systemPrompt:c.systemPrompt,skillIds:c.skillIds,tools:c.tools}),T(!0)),o&&!S&&i&&f.isSuccess&&(k.length||j.length)&&(g({name:l?.name??i.name,description:l?.description??i.description,systemPrompt:l?.systemPrompt??i.systemPrompt,skillIds:l?.skillIds??k.map(t=>t.id),tools:l?.tools??j.map(t=>t.name)}),T(!0));const N=()=>d("/customize"),Q=t=>g(r=>({...r,skillIds:r.skillIds.includes(t)?r.skillIds.filter(v=>v!==t):[...r.skillIds,t]})),O=()=>{if(!m.name.trim()){h.error("Name is required.");return}P(!0);const t={name:m.name.trim(),description:m.description.trim(),systemPrompt:m.systemPrompt,skillIds:m.skillIds,tools:m.tools};if(o){u.save.mutate({id:s,override:t},{onSuccess:()=>{h.success("Agent saved."),N()},onError:v=>{h.error(v instanceof C?v.message:"Could not save agent."),P(!1)}});return}const r={onSuccess:()=>{x.invalidateQueries({queryKey:["chat-agents"]}),h.success(n?"Agent created.":"Agent saved."),N()},onError:v=>{h.error(v instanceof C?v.message:"Could not save agent."),P(!1)}};n?a.add.mutate(t,r):a.update.mutate({id:s,patch:t},r)},F=()=>{u.reset.mutate(s,{onSuccess:()=>{h.success("Reset to default."),i&&g({name:i.name,description:i.description,systemPrompt:i.systemPrompt,skillIds:k.map(t=>t.id),tools:j.map(t=>t.name)})},onError:t=>h.error(t instanceof C?t.message:"Could not reset agent.")})},K=()=>{a.remove.mutate(s,{onSuccess:()=>{h.success("Agent deleted."),N()},onError:t=>h.error(t instanceof C?t.message:"Could not delete agent.")})};return!n&&!o&&p.isSuccess&&!c?e.jsxs("div",{className:"flex w-full flex-col items-center gap-3 px-8 py-16",children:[e.jsx("p",{className:"text-[14px] text-muted",children:"That agent no longer exists."}),e.jsx(y,{size:"sm",variant:"outline",onClick:N,children:"Back to agents"})]}):e.jsxs("div",{className:"flex w-full max-w-4xl flex-col gap-5 px-4 py-6 md:px-8",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("button",{type:"button",onClick:N,className:"text-faint hover:text-ink",title:"Back to agents",children:e.jsx(Z,{size:18})}),e.jsx("span",{className:"text-[15px] font-medium text-ink",children:n?"New agent":o?l?"Edit agent (modified built-in)":"Edit agent (built-in)":"Edit agent"}),e.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[o&&e.jsxs(y,{size:"sm",variant:"outline",onClick:F,disabled:u.reset.isPending,children:[e.jsx(ee,{size:13})," Reset to default"]}),e.jsx(y,{size:"sm",variant:"outline",onClick:N,children:"Cancel"}),e.jsx(y,{size:"sm",onClick:O,disabled:A||!m.name.trim(),children:A?"Saving…":"Save"})]})]}),o&&e.jsx("p",{className:"rounded-md border border-border bg-panel px-3 py-2 text-[12px] text-muted",children:"Built-in agents can be edited in place — Reset to default discards your changes and restores TurboLLM's original prompt and access."}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-[12px] font-medium text-muted",children:"Name"}),e.jsx("input",{className:"rounded-md border border-border bg-bg px-3 py-1.5 text-[13px] text-ink outline-none focus:border-accent placeholder:text-faint",placeholder:"Release Notes Writer",value:m.name,onChange:t=>g(r=>({...r,name:t.target.value}))})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-[12px] font-medium text-muted",children:"Description"}),e.jsx("input",{className:"rounded-md border border-border bg-bg px-3 py-1.5 text-[13px] text-ink outline-none focus:border-accent placeholder:text-faint",placeholder:"What this agent is for, in one line",value:m.description,onChange:t=>g(r=>({...r,description:t.target.value}))})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-[12px] font-medium text-muted",children:"System prompt"}),e.jsx("textarea",{className:"min-h-[160px] resize-y rounded-md border border-border bg-bg px-3 py-2 font-mono text-[12px] leading-relaxed text-ink outline-none focus:border-accent placeholder:text-faint",placeholder:"You are…",value:m.systemPrompt,onChange:t=>g(r=>({...r,systemPrompt:t.target.value}))})]}),e.jsxs("div",{className:"flex flex-col gap-2.5",children:[e.jsx("div",{className:"inline-flex w-fit rounded-md border border-border p-0.5",children:["skills","tools"].map(t=>e.jsx("button",{type:"button",onClick:()=>L(t),className:B("rounded px-3 py-1.5 text-[13px] font-medium transition-colors",R===t?"bg-accent/12 text-accent":"text-muted hover:text-ink"),children:t==="skills"?`Skills (${m.skillIds.length})`:`Tools (${m.tools.length})`},t))}),R==="skills"?_.isLoading?e.jsx("p",{className:"text-[12px] text-faint",children:"Loading…"}):k.length===0?e.jsx("p",{className:"text-[12px] text-faint",children:"No skills yet — create one under Customize → Skills."}):e.jsx("div",{className:"flex flex-col gap-2 rounded-md border border-border bg-panel-2 p-3",children:k.map(t=>e.jsxs("label",{className:"flex cursor-pointer items-start gap-2 text-[13px]",children:[e.jsx("input",{type:"checkbox",className:"mt-0.5",checked:m.skillIds.includes(t.id),onChange:()=>Q(t.id)}),e.jsxs("span",{className:"flex flex-col",children:[e.jsx("span",{className:"text-ink",children:t.name}),t.description&&e.jsx("span",{className:"text-[12px] text-muted",children:t.description})]})]},t.id))}):I.isLoading?e.jsx("p",{className:"text-[12px] text-faint",children:"Loading…"}):e.jsx(ie,{tools:j,selected:m.tools,onChange:t=>g(r=>({...r,tools:t}))})]}),!n&&!o&&(D?e.jsxs("div",{className:"flex items-center gap-2 self-start rounded-md border border-border bg-panel p-2 text-[12px]",children:[e.jsx("span",{className:"flex-1 text-muted",children:"Delete this agent?"}),e.jsx("button",{type:"button",onClick:K,className:"rounded px-2 py-1 text-[color:var(--err)] hover:bg-[color:color-mix(in_srgb,var(--err)_12%,transparent)]",children:"Delete"}),e.jsx("button",{type:"button",onClick:()=>w(!1),className:"rounded px-2 py-1 text-faint hover:text-ink",children:"Cancel"})]}):e.jsxs("button",{type:"button",onClick:()=>w(!0),className:"flex items-center gap-1.5 self-start text-[12px] text-faint hover:text-[color:var(--err)]",children:[e.jsx(te,{size:13})," Delete agent"]}))]})}export{ke as AgentEditPage};