bazilion 0.51.0 → 0.52.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/dist/cli.js +74 -28
  2. package/dist/cli.js.map +1 -1
  3. package/dist/daemon.js +547 -187
  4. package/dist/daemon.js.map +1 -1
  5. package/dist/web/client/assets/AddProviderDialog-BiGLKnu2.js +1 -0
  6. package/dist/web/client/assets/{ConfigPage-pupvtSCX.js → ConfigPage-DvBzy2MN.js} +1 -1
  7. package/dist/web/client/assets/{ConfirmDialog-GFDcHI1L.js → ConfirmDialog-CiZ5tk9R.js} +1 -1
  8. package/dist/web/client/assets/{ConnectionsView-y1CeY-6U.js → ConnectionsView-Czkpm2JY.js} +1 -1
  9. package/dist/web/client/assets/Dialog-s_kPtI-W.js +1 -0
  10. package/dist/web/client/assets/ModelMenu-BfUPoRjV.js +1 -0
  11. package/dist/web/client/assets/{SectionTabs-D4ezA6U4.js → SectionTabs-DENNb6Nw.js} +1 -1
  12. package/dist/web/client/assets/{SkillFindings-BzLO1lNA.js → SkillFindings-Xng11qqx.js} +1 -1
  13. package/dist/web/client/assets/SpawnDialog-CKWFQ6jk.js +1 -0
  14. package/dist/web/client/assets/TeamThread-2rm1JGSk.js +1 -0
  15. package/dist/web/client/assets/{UnsavedChangesGuard-DBJikVgc.js → UnsavedChangesGuard-nx6dv2Yw.js} +1 -1
  16. package/dist/web/client/assets/_id-B72mIpcE.js +1 -0
  17. package/dist/web/client/assets/_id-Bzavnza1.js +1 -0
  18. package/dist/web/client/assets/access-Yw9jODuk.js +1 -0
  19. package/dist/web/client/assets/agents-C9xoyL7o.js +1 -0
  20. package/dist/web/client/assets/agents-TviG16wx.js +1 -0
  21. package/dist/web/client/assets/attention-DmURtlJm.js +1 -0
  22. package/dist/web/client/assets/chevron-right-CUZiA2aG.js +1 -0
  23. package/dist/web/client/assets/config-UZz_mjO5.js +1 -0
  24. package/dist/web/client/assets/dist-BWppw70N.js +41 -0
  25. package/dist/web/client/assets/dist-D2dwY7MR.js +1 -0
  26. package/dist/web/client/assets/index-Df1oUtAP.js +14 -0
  27. package/dist/web/client/assets/login-CPfdaqsV.js +1 -0
  28. package/dist/web/client/assets/mcp-FlYnNon0.js +1 -0
  29. package/dist/web/client/assets/model-facts-DoB6QD5y.js +1 -0
  30. package/dist/web/client/assets/parts-tIDBNsYA.js +1 -0
  31. package/dist/web/client/assets/routes-BZaWCoQj.js +76 -0
  32. package/dist/web/client/assets/skills-C7yDPC8s.js +1 -0
  33. package/dist/web/client/assets/{style-Cdzqt_TJ.js → style-DDuTFJUu.js} +1 -1
  34. package/dist/web/client/assets/styles-BviXU81u.css +2 -0
  35. package/dist/web/client/assets/{system-CsI66nyZ.js → system-CL3Kz36L.js} +1 -1
  36. package/dist/web/client/assets/teams-CQTEF5gV.js +1 -0
  37. package/dist/web/client/assets/teams-DQ7SqVyF.js +1 -0
  38. package/dist/web/client/assets/{telegram-C3dGndJV.js → telegram-BLgxtGhZ.js} +1 -1
  39. package/dist/web/client/assets/tools-pOQyGVYo.js +1 -0
  40. package/dist/web/client/assets/use-resource-C3MBZJop.js +1 -0
  41. package/dist/web/client/assets/welcome-Hr6JpMef.js +1 -0
  42. package/dist/web/client/assets/wrench-6BEIqKDn.js +1 -0
  43. package/dist/web/server/assets/{AddProviderDialog-CR6TRYdZ.js → AddProviderDialog-Tn4AskPm.js} +7 -304
  44. package/dist/web/server/assets/{ConfigPage-CIh3ohea.js → ConfigPage-DqDUujmt.js} +2 -2
  45. package/dist/web/server/assets/{ConfirmDialog-B79K2KEW.js → ConfirmDialog-DfaJ--A6.js} +2 -2
  46. package/dist/web/server/assets/{ConnectionsView-BIMYdp9C.js → ConnectionsView-DAG-zNBz.js} +6 -6
  47. package/dist/web/server/assets/{Dialog-CVqpXxuN.js → Dialog-aup_yJv5.js} +1 -1
  48. package/dist/web/server/assets/ModelMenu-DUY9aHkE.js +138 -0
  49. package/dist/web/server/assets/{Rail-Cg-efcpA.js → Rail-BIC_4ptO.js} +6 -6
  50. package/dist/web/server/assets/{SectionTabs-DrcgVeZd.js → SectionTabs-BGsrf-UQ.js} +3 -3
  51. package/dist/web/server/assets/{SkillFindings-DSDiL6hn.js → SkillFindings-BdATze1A.js} +1 -1
  52. package/dist/web/server/assets/{SpawnDialog-BUUlLxE9.js → SpawnDialog-D_SMPCG_.js} +11 -8
  53. package/dist/web/server/assets/{TeamForm-CvQAs2FA.js → TeamForm-ilBaeLI4.js} +1 -1
  54. package/dist/web/server/assets/{TeamThread-5CjVPcDr.js → TeamThread-DuLlGDcw.js} +3 -3
  55. package/dist/web/server/assets/{UnsavedChangesGuard-CyF2Z9p1.js → UnsavedChangesGuard-DrOvPV14.js} +1 -1
  56. package/dist/web/server/assets/{_id-Dg6M_qfr.js → _id-BsZcsabI.js} +11 -11
  57. package/dist/web/server/assets/{_id-BvAaRSUW.js → _id-D8Kj0F30.js} +2 -2
  58. package/dist/web/server/assets/{_id-8bsYEcGg.js → _id-DJnYgisy.js} +2 -2
  59. package/dist/web/server/assets/{_id-Dji7xr9C.js → _id-QYifTM9w.js} +3 -3
  60. package/dist/web/server/assets/{_id-0fEWiVZX.js → _id-yN0z7VqE.js} +6 -6
  61. package/dist/web/server/assets/{_tanstack-start-manifest_v-sxiIH4M7.js → _tanstack-start-manifest_v-D6zrzUC7.js} +84 -75
  62. package/dist/web/server/assets/{tokens-CEdl8puR.js → access-C_pupPks.js} +3 -3
  63. package/dist/web/server/assets/{tokens-DSLwQ1Pw.js → access-DKOpcHIJ.js} +10 -10
  64. package/dist/web/server/assets/{tokens-C-oDTqnp.js → access-GMGed5O8.js} +5 -5
  65. package/dist/web/server/assets/{agents-DktqUffG.js → agents-B6OR3x99.js} +13 -13
  66. package/dist/web/server/assets/{agents-BDA5yYZ2.js → agents-B7642eRO.js} +5 -5
  67. package/dist/web/server/assets/{agents-DM7guWF2.js → agents-BJ-_oC2e.js} +2 -2
  68. package/dist/web/server/assets/{agents-BTDxmp-F.js → agents-CjV0w-Zy.js} +2 -2
  69. package/dist/web/server/assets/{agents-xgZ9rsac.js → agents-Dy_Q-9lG.js} +3 -3
  70. package/dist/web/server/assets/{attention-De3-ehuf.js → attention-CLP4HYBz.js} +3 -3
  71. package/dist/web/server/assets/{attention-CHQEQiZl.js → attention-DS3O9UmJ.js} +2 -2
  72. package/dist/web/server/assets/{config-DzgkbBoD.js → config-DjTGA4iZ.js} +2 -2
  73. package/dist/web/server/assets/{config-DOp28gcy.js → config-Q7livfa3.js} +157 -9
  74. package/dist/web/server/assets/{createSsrRpc-CcLbajrF.js → createSsrRpc-GCCF14VW.js} +1 -1
  75. package/dist/web/server/assets/{mcp-CO_tycXU.js → mcp-BI-FD-JI.js} +5 -5
  76. package/dist/web/server/assets/{mcp-D3OCoHtO.js → mcp-ZARSOxZW.js} +2 -2
  77. package/dist/web/server/assets/model-facts-mrfrWQne.js +136 -0
  78. package/dist/web/server/assets/parts-B31PJkhi.js +190 -0
  79. package/dist/web/server/assets/{router-Cs2Ak4II.js → router-Dh2-IvLL.js} +39 -39
  80. package/dist/web/server/assets/{routes-BVwqgZGI.js → routes-BJIJWCIE.js} +3 -3
  81. package/dist/web/server/assets/{routes-BSNOKE-C.js → routes-C9NawqcV.js} +21 -17
  82. package/dist/web/server/assets/{routes-CO4l-GJ0.js → routes-CDskMy5C.js} +2 -2
  83. package/dist/web/server/assets/{skills-DKYV7PTk.js → skills-BqLq3ZXq.js} +5 -5
  84. package/dist/web/server/assets/{skills-CggQJk6a.js → skills-StN15QhC.js} +2 -2
  85. package/dist/web/server/assets/{system-CZ2qzBz3.js → system-BtRA2HUs.js} +2 -2
  86. package/dist/web/server/assets/{system-DsJfpBPl.js → system-Dl-1RhoP.js} +2 -2
  87. package/dist/web/server/assets/{teams-Bp2tERZe.js → teams-5PMGvHuM.js} +2 -2
  88. package/dist/web/server/assets/{teams-C-8iz-uV.js → teams-COaU0wN9.js} +4 -4
  89. package/dist/web/server/assets/{teams-B6PzNcoy.js → teams-Ca8W4mvl.js} +5 -5
  90. package/dist/web/server/assets/{teams-B6lBhvdL.js → teams-CbIPKf99.js} +2 -2
  91. package/dist/web/server/assets/{telegram-Gy7_9yih.js → telegram-CGol0CKX2.js} +3 -3
  92. package/dist/web/server/assets/{telegram-D2RZriz_.js → telegram-Cv0D4gyz.js} +5 -5
  93. package/dist/web/server/assets/{telegram-CXrP3hMp.js → telegram-Yx8nm6Ei.js} +5 -5
  94. package/dist/web/server/assets/tools-C-wwWjLI.js +12 -0
  95. package/dist/web/server/assets/tools-OfD22R-C.js +502 -0
  96. package/dist/web/server/assets/tools-ioJcPzMW.js +12 -0
  97. package/dist/web/server/assets/{use-resource-ChQozXVI.js → use-resource-DVzK0toP.js} +1 -1
  98. package/dist/web/server/assets/utils-C_uf36nf.js +8 -0
  99. package/dist/web/server/assets/{welcome-BLw1G6SS.js → welcome-FFEbrNT1.js} +6 -5
  100. package/dist/web/server/assets/{welcome-ByAkvHSP.js → welcome-jxmpE_Jb.js} +2 -2
  101. package/dist/web/server/assets/{workspace-DeEYMPDX.js → workspace-DaitCM0t.js} +1 -8
  102. package/dist/web/server/server.js +18 -18
  103. package/dist/worker.js +202 -120
  104. package/dist/worker.js.map +1 -1
  105. package/package.json +1 -1
  106. package/dist/web/client/assets/AddProviderDialog-Diic36c_.js +0 -1
  107. package/dist/web/client/assets/Dialog-bg86_x4v.js +0 -1
  108. package/dist/web/client/assets/FieldRow-B8eIni5r.js +0 -1
  109. package/dist/web/client/assets/ModelSelect-DvCLUmkW.js +0 -1
  110. package/dist/web/client/assets/SpawnDialog-YJX6UMBC.js +0 -1
  111. package/dist/web/client/assets/TeamThread-DFvbakHo.js +0 -1
  112. package/dist/web/client/assets/_id-BjNtLwak.js +0 -1
  113. package/dist/web/client/assets/_id-BklaQf3z.js +0 -1
  114. package/dist/web/client/assets/agents-D9cUF2d9.js +0 -1
  115. package/dist/web/client/assets/agents-wuBlzx4e.js +0 -1
  116. package/dist/web/client/assets/attention-8ZkSLl2e.js +0 -1
  117. package/dist/web/client/assets/config-Con_BbSh.js +0 -1
  118. package/dist/web/client/assets/index-Br9qkGM-.js +0 -54
  119. package/dist/web/client/assets/login-llnOKSJc.js +0 -1
  120. package/dist/web/client/assets/mcp-zIUguMSI.js +0 -1
  121. package/dist/web/client/assets/routes-BY5uqJ2n.js +0 -76
  122. package/dist/web/client/assets/services-esLrcTwe.js +0 -1
  123. package/dist/web/client/assets/skills-DzYXksM0.js +0 -1
  124. package/dist/web/client/assets/styles-BRSS6yrm.css +0 -2
  125. package/dist/web/client/assets/teams-CHE_zpxS.js +0 -1
  126. package/dist/web/client/assets/teams-dxG9OESG.js +0 -1
  127. package/dist/web/client/assets/tokens-CNNH-Wr9.js +0 -1
  128. package/dist/web/client/assets/use-resource-BjnxgGvh.js +0 -1
  129. package/dist/web/client/assets/welcome-C8EOtc8P.js +0 -1
  130. package/dist/web/server/assets/FieldRow-CHVhX2rS.js +0 -173
  131. package/dist/web/server/assets/ModelSelect-DrZrdndo.js +0 -43
  132. package/dist/web/server/assets/services-DZLxUSG8.js +0 -13
  133. package/dist/web/server/assets/services-DsHRLL8q.js +0 -12
  134. package/dist/web/server/assets/services-DsvpaF3L.js +0 -74
  135. /package/dist/web/server/assets/{system-DtswhLW62.js → system-DtswhLW6.js} +0 -0
@@ -1,8 +1,8 @@
1
1
  import { n as createServerFn } from "../server.js";
2
- import { t as createSsrRpc } from "./createSsrRpc-CcLbajrF.js";
2
+ import { t as createSsrRpc } from "./createSsrRpc-GCCF14VW.js";
3
3
  import { createFileRoute, lazyRouteComponent } from "@tanstack/react-router";
4
4
  //#region src/routes/attention/index.tsx
5
- var $$splitComponentImporter = () => import("./attention-De3-ehuf.js");
5
+ var $$splitComponentImporter = () => import("./attention-CLP4HYBz.js");
6
6
  var loadAttention = createServerFn({ method: "GET" }).handler(createSsrRpc("883b401299422096ee31ee824f9a24b49d06bdcedce398789778c4c549a92f3a"));
7
7
  var Route = createFileRoute("/attention/")({
8
8
  loader: () => loadAttention(),
@@ -1,8 +1,8 @@
1
1
  import { n as createServerFn } from "../server.js";
2
- import { t as createSsrRpc } from "./createSsrRpc-CcLbajrF.js";
2
+ import { t as createSsrRpc } from "./createSsrRpc-GCCF14VW.js";
3
3
  import { createFileRoute, lazyRouteComponent } from "@tanstack/react-router";
4
4
  //#region src/routes/config/index.tsx
5
- var $$splitComponentImporter = () => import("./config-DOp28gcy.js");
5
+ var $$splitComponentImporter = () => import("./config-Q7livfa3.js");
6
6
  var fetchModelsPage = createServerFn({ method: "GET" }).handler(createSsrRpc("71b6b12251ac92cf4ee888c1d2b6eba3beaac079f9c39eaed95fafcd15908731"));
7
7
  var Route = createFileRoute("/config/")({
8
8
  validateSearch: (search) => ({
@@ -1,13 +1,14 @@
1
- import { E as errorMessage, d as Button, w as api } from "./workspace-DeEYMPDX.js";
2
- import { r as useResource } from "./use-resource-ChQozXVI.js";
3
- import { t as Dialog } from "./Dialog-CVqpXxuN.js";
4
- import { t as ConfirmDialog } from "./ConfirmDialog-B79K2KEW.js";
1
+ import { C as api, T as errorMessage, u as Button } from "./workspace-DaitCM0t.js";
2
+ import { r as useResource } from "./use-resource-DVzK0toP.js";
3
+ import { t as Dialog } from "./Dialog-aup_yJv5.js";
4
+ import { t as ConfirmDialog } from "./ConfirmDialog-DfaJ--A6.js";
5
5
  import { t as Segmented } from "./Segmented-3ZLdqa5U.js";
6
- import { t as Route } from "./config-DzgkbBoD.js";
7
- import { t as ConfigPage } from "./ConfigPage-CIh3ohea.js";
8
- import { S as usedByLine, _ as factsLine, b as priceLine, c as ModelRow, d as SetupCard, f as StateChip, g as credentialLine, h as ago, l as ProviderAvatar, m as Waiting, o as Chip, p as Switch, s as FailureBox, t as AddProviderDialog, u as SearchField, v as matchesModel, x as providerStatus, y as modelName } from "./AddProviderDialog-CR6TRYdZ.js";
9
- import { t as FieldRow } from "./FieldRow-CHVhX2rS.js";
10
- import { useMemo, useState } from "react";
6
+ import { d as providerStatus, f as usedByLine, i as factsLine, l as modelName, o as matchesModel, r as credentialLine, t as ago, u as priceLine } from "./model-facts-mrfrWQne.js";
7
+ import { t as Route } from "./config-DjTGA4iZ.js";
8
+ import { t as ConfigPage } from "./ConfigPage-DqDUujmt.js";
9
+ import { a as SearchField, c as Switch, i as ProviderAvatar, l as Waiting, n as FailureBox, o as SetupCard, r as ModelRow, s as StateChip, t as Chip } from "./parts-B31PJkhi.js";
10
+ import { t as AddProviderDialog } from "./AddProviderDialog-Tn4AskPm.js";
11
+ import { useId, useMemo, useState } from "react";
11
12
  import { useRouter } from "@tanstack/react-router";
12
13
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
13
14
  import { AlertTriangle, Check, ChevronRight, Images, MessageSquare, Plug, Plus, X } from "lucide-react";
@@ -635,6 +636,153 @@ function ProvidersCard({ providers, total, images, now, onOpen, onAdd }) {
635
636
  });
636
637
  }
637
638
  //#endregion
639
+ //#region src/components/FieldRow.tsx
640
+ /** One provider setting, saved on its own (secrets are stored encrypted). */
641
+ function FieldRow({ field }) {
642
+ const router = useRouter();
643
+ const path = `/api/config/fields/${encodeURIComponent(field.envVar)}`;
644
+ const inputId = useId();
645
+ const descriptionId = `${inputId}-description`;
646
+ const [value, setValue] = useState(field.kind === "config" ? field.value ?? "" : "");
647
+ const [busy, setBusy] = useState(false);
648
+ const [err, setErr] = useState(null);
649
+ const [savedAt, setSavedAt] = useState(null);
650
+ const [confirmRemove, setConfirmRemove] = useState(false);
651
+ const secretBlank = field.kind === "secret" && value.trim().length === 0;
652
+ async function save(e) {
653
+ e.preventDefault();
654
+ if (secretBlank) {
655
+ setErr(field.set ? "Paste a replacement value, or use remove credential to explicitly clear the stored secret." : "A secret value is required.");
656
+ return;
657
+ }
658
+ setBusy(true);
659
+ setErr(null);
660
+ try {
661
+ await api(path, {
662
+ method: "PUT",
663
+ body: { value }
664
+ });
665
+ setSavedAt(Date.now());
666
+ if (field.kind === "secret") setValue("");
667
+ await router.invalidate();
668
+ } catch (e) {
669
+ setErr(errorMessage(e));
670
+ } finally {
671
+ setBusy(false);
672
+ }
673
+ }
674
+ async function removeSecret() {
675
+ await api(path, { method: "DELETE" });
676
+ setValue("");
677
+ setErr(null);
678
+ setSavedAt(Date.now());
679
+ await router.invalidate();
680
+ }
681
+ return /* @__PURE__ */ jsxs("form", {
682
+ onSubmit: save,
683
+ className: "grid grid-cols-1 gap-2 border-b py-3 last:border-0 md:grid-cols-[12rem_minmax(0,1fr)_auto_auto] md:items-center",
684
+ children: [
685
+ /* @__PURE__ */ jsxs("div", {
686
+ className: "min-w-0",
687
+ children: [
688
+ /* @__PURE__ */ jsx("label", {
689
+ htmlFor: inputId,
690
+ className: "text-sm font-medium text-foreground",
691
+ children: field.label
692
+ }),
693
+ field.description && /* @__PURE__ */ jsx("div", {
694
+ id: descriptionId,
695
+ className: "text-xs text-muted-foreground mt-0.5",
696
+ children: field.description
697
+ }),
698
+ /* @__PURE__ */ jsxs("details", {
699
+ className: "mt-1 text-xs text-muted-foreground",
700
+ children: [/* @__PURE__ */ jsx("summary", {
701
+ className: "cursor-pointer",
702
+ children: "Advanced identifier"
703
+ }), /* @__PURE__ */ jsx("code", {
704
+ className: "mt-1 inline-block break-all font-mono",
705
+ children: field.envVar
706
+ })]
707
+ })
708
+ ]
709
+ }),
710
+ /* @__PURE__ */ jsx("div", {
711
+ className: "min-w-0",
712
+ children: field.kind === "config" ? /* @__PURE__ */ jsx("input", {
713
+ id: inputId,
714
+ type: "text",
715
+ "aria-describedby": field.description ? descriptionId : void 0,
716
+ value,
717
+ onChange: (e) => setValue(e.target.value),
718
+ placeholder: field.placeholder ?? "",
719
+ className: "w-full rounded-md border bg-background px-2 py-1.5 text-sm outline-none focus:ring-2 focus:ring-ring/30"
720
+ }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("input", {
721
+ id: inputId,
722
+ type: "password",
723
+ "aria-describedby": field.description ? descriptionId : void 0,
724
+ value,
725
+ onChange: (e) => setValue(e.target.value),
726
+ placeholder: field.set ? "(paste to replace stored value)" : field.placeholder ?? "paste key…",
727
+ autoComplete: "off",
728
+ className: "w-full rounded-md border bg-background px-2 py-1.5 text-sm outline-none focus:ring-2 focus:ring-ring/30"
729
+ }), field.set && /* @__PURE__ */ jsx("p", {
730
+ className: "mt-1 text-xs text-muted-foreground",
731
+ children: "Blank keeps the current credential. Removal is a separate explicit action."
732
+ })] })
733
+ }),
734
+ /* @__PURE__ */ jsxs("span", {
735
+ className: "text-xs",
736
+ children: [field.kind === "secret" && field.set && /* @__PURE__ */ jsx("span", {
737
+ className: "rounded-full bg-success/10 text-success px-1.5 py-0.5",
738
+ title: `preview: ${field.preview ?? ""}`,
739
+ children: "set"
740
+ }), savedAt && Date.now() - savedAt < 2e3 && /* @__PURE__ */ jsx("span", {
741
+ role: "status",
742
+ className: "text-success ml-2",
743
+ children: "saved ✓"
744
+ })]
745
+ }),
746
+ /* @__PURE__ */ jsxs("div", {
747
+ className: "flex flex-wrap gap-2 md:justify-self-end",
748
+ children: [/* @__PURE__ */ jsx(Button, {
749
+ variant: "ghost",
750
+ type: "submit",
751
+ disabled: busy || secretBlank,
752
+ className: "text-xs",
753
+ children: "save"
754
+ }), field.kind === "secret" && field.set && /* @__PURE__ */ jsx(Button, {
755
+ variant: "danger",
756
+ className: "text-xs",
757
+ onClick: () => setConfirmRemove(true),
758
+ children: "remove"
759
+ })]
760
+ }),
761
+ err && /* @__PURE__ */ jsx("p", {
762
+ role: "alert",
763
+ className: "text-xs text-danger md:col-span-4",
764
+ children: err
765
+ }),
766
+ /* @__PURE__ */ jsx(ConfirmDialog, {
767
+ open: confirmRemove,
768
+ title: `Remove ${field.label}?`,
769
+ description: /* @__PURE__ */ jsxs("p", { children: [
770
+ "This permanently deletes the stored ",
771
+ /* @__PURE__ */ jsx("code", {
772
+ className: "font-mono",
773
+ children: field.envVar
774
+ }),
775
+ " ",
776
+ "credential. Features that use it will fail until you save a replacement."
777
+ ] }),
778
+ confirmLabel: "remove stored credential",
779
+ onConfirm: removeSecret,
780
+ onOpenChange: setConfirmRemove
781
+ })
782
+ ]
783
+ });
784
+ }
785
+ //#endregion
638
786
  //#region src/components/setup/ProviderSheet.tsx
639
787
  var HEADING = "m-0 font-body text-[0.72rem] font-bold uppercase tracking-[0.08em] text-muted-foreground";
640
788
  /**
@@ -1,5 +1,5 @@
1
1
  import { i as getServerFnById, r as TSS_SERVER_FUNCTION } from "../server.js";
2
- import { u as cn } from "./workspace-DeEYMPDX.js";
2
+ import { t as cn } from "./utils-C_uf36nf.js";
3
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
4
  //#region src/components/Page.tsx
5
5
  var PAGE_SIZE_CLASS = {
@@ -1,8 +1,8 @@
1
- import { E as errorMessage, d as Button, w as api } from "./workspace-DeEYMPDX.js";
2
- import { t as ConfirmDialog } from "./ConfirmDialog-B79K2KEW.js";
3
- import { i as ItemRow, l as StatusBadge, r as ItemList, s as SectionCard } from "./createSsrRpc-CcLbajrF.js";
4
- import { t as Route } from "./mcp-D3OCoHtO.js";
5
- import { t as ConfigPage } from "./ConfigPage-CIh3ohea.js";
1
+ import { C as api, T as errorMessage, u as Button } from "./workspace-DaitCM0t.js";
2
+ import { t as ConfirmDialog } from "./ConfirmDialog-DfaJ--A6.js";
3
+ import { i as ItemRow, l as StatusBadge, r as ItemList, s as SectionCard } from "./createSsrRpc-GCCF14VW.js";
4
+ import { t as Route } from "./mcp-ZARSOxZW.js";
5
+ import { t as ConfigPage } from "./ConfigPage-DqDUujmt.js";
6
6
  import { useState } from "react";
7
7
  import { useRouter } from "@tanstack/react-router";
8
8
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -1,8 +1,8 @@
1
1
  import { n as createServerFn } from "../server.js";
2
- import { t as createSsrRpc } from "./createSsrRpc-CcLbajrF.js";
2
+ import { t as createSsrRpc } from "./createSsrRpc-GCCF14VW.js";
3
3
  import { createFileRoute, lazyRouteComponent } from "@tanstack/react-router";
4
4
  //#region src/routes/config/mcp.tsx
5
- var $$splitComponentImporter = () => import("./mcp-CO_tycXU.js");
5
+ var $$splitComponentImporter = () => import("./mcp-BI-FD-JI.js");
6
6
  var fetchServers = createServerFn({ method: "GET" }).handler(createSsrRpc("278849457893891c3d22806d15e11a0a42cc3630b30e9e62b74cf2d3b982ded7"));
7
7
  var Route = createFileRoute("/config/mcp")({
8
8
  loader: () => fetchServers(),
@@ -0,0 +1,136 @@
1
+ //#region src/lib/model-facts.ts
2
+ function modelName(model) {
3
+ return model.name ?? model.id;
4
+ }
5
+ /** A context window in the units people say: `1M`, `272K`. */
6
+ function formatContext(tokens) {
7
+ if (!tokens || tokens <= 0) return null;
8
+ if (tokens >= 1e6) return `${(tokens / 1e6).toFixed(1).replace(/\.0$/, "")}M`;
9
+ return `${Math.round(tokens / 1e3)}K`;
10
+ }
11
+ /** A dollar amount with cents, and the third decimal only when it carries something. */
12
+ function formatUsd(value) {
13
+ if (Number.isInteger(value)) return `$${value}`;
14
+ const fixed = value.toFixed(3);
15
+ return `$${fixed.endsWith("0") ? fixed.slice(0, -1) : fixed}`;
16
+ }
17
+ /** What a model can do, in one line. A model the catalog does not know has nothing to say. */
18
+ function factsLine(model, connect) {
19
+ const context = formatContext(model.contextWindow);
20
+ if (!model.name && !context) return connect === "local" ? "Loaded on the server" : "Not in the bundled catalog";
21
+ return [
22
+ context ? `${context} context` : null,
23
+ model.images ? "sees images" : "text only",
24
+ model.reasoning ? "reasoning" : null
25
+ ].filter(Boolean).join(" · ");
26
+ }
27
+ /** What a model costs: the list price per million tokens, or who pays instead. */
28
+ function priceLine(model, connect) {
29
+ if (connect === "signin") return "Included in your plan";
30
+ if (connect === "local") return "Runs on your hardware";
31
+ if (!model.price) return "No list price";
32
+ return `${formatUsd(model.price.input)} in · ${formatUsd(model.price.output)} out`;
33
+ }
34
+ function usedByLine(usedBy) {
35
+ const parts = [...usedBy.templates.map((name) => `${name} template`), usedBy.agents === 1 ? "1 Agent" : usedBy.agents > 1 ? `${usedBy.agents} Agents` : null].filter(Boolean);
36
+ return parts.length > 0 ? parts.join(", ") : "Not used yet";
37
+ }
38
+ /** The two facts that matter when choosing a model: how much it reads, whether it sees images. */
39
+ function menuFacts(model) {
40
+ const context = formatContext(model.contextWindow);
41
+ if (!context) return model.providerConnect === "local" ? "on this computer" : "";
42
+ return `${context} · ${model.images ? "sees images" : "text only"}`;
43
+ }
44
+ /** Chat models by provider, in the order the Models page lists them. */
45
+ function menuGroups(models) {
46
+ const groups = /* @__PURE__ */ new Map();
47
+ for (const model of models) {
48
+ const group = groups.get(model.provider) ?? {
49
+ provider: model.provider,
50
+ name: model.providerName,
51
+ trouble: model.providerState === "failing" || model.providerState === "incomplete" ? "not working" : null,
52
+ models: []
53
+ };
54
+ group.models.push(model);
55
+ groups.set(model.provider, group);
56
+ }
57
+ return [...groups.values()];
58
+ }
59
+ /** Whether a model matches what was typed: every word, in its name or id. */
60
+ function matchesModel(model, query) {
61
+ const haystack = `${model.name ?? ""} ${model.id}`.toLowerCase();
62
+ return query.toLowerCase().split(/\s+/).filter(Boolean).every((word) => haystack.includes(word));
63
+ }
64
+ /** "2 minutes ago", for something that happened at `at`. */
65
+ function ago(at, now) {
66
+ const seconds = Math.max(0, Math.round((now - at) / 1e3));
67
+ if (seconds < 45) return "just now";
68
+ const minutes = Math.round(seconds / 60);
69
+ if (minutes < 60) return minutes === 1 ? "1 minute ago" : `${minutes} minutes ago`;
70
+ const hours = Math.round(minutes / 60);
71
+ if (hours < 24) return hours === 1 ? "1 hour ago" : `${hours} hours ago`;
72
+ const days = Math.round(hours / 24);
73
+ if (days < 30) return days === 1 ? "yesterday" : `${days} days ago`;
74
+ return `on ${new Date(at).toISOString().slice(0, 10)}`;
75
+ }
76
+ var FAILURE_LABEL = {
77
+ credentials: "Key rejected",
78
+ unreachable: "Not answering",
79
+ model: "Model unavailable",
80
+ limit: "Limit reached",
81
+ other: "Failing"
82
+ };
83
+ /** A provider's state as a chip: a few words and how loud they are. */
84
+ function providerStatus(provider, now) {
85
+ switch (provider.state) {
86
+ case "working": return {
87
+ label: provider.check ? `Working · tested ${ago(provider.check.at, now)}` : "Working",
88
+ tone: "success"
89
+ };
90
+ case "failing": {
91
+ const kind = provider.check?.failure?.kind ?? "other";
92
+ const label = kind === "credentials" && provider.connect === "signin" ? "Sign-in rejected" : FAILURE_LABEL[kind];
93
+ return {
94
+ label: provider.check ? `${label} · tried ${ago(provider.check.at, now)}` : label,
95
+ tone: "warning"
96
+ };
97
+ }
98
+ case "incomplete": return {
99
+ label: provider.connect === "signin" ? "Not signed in" : provider.fields.some((field) => field.kind === "secret") ? "Needs a key" : "Needs credentials",
100
+ tone: "warning"
101
+ };
102
+ case "off": return {
103
+ label: provider.models.length === 0 ? "Saved, not in use" : "Turned off",
104
+ tone: "neutral"
105
+ };
106
+ default: return {
107
+ label: "Not tested yet",
108
+ tone: "neutral"
109
+ };
110
+ }
111
+ }
112
+ /** How a provider is connected, in a few words, for its row. */
113
+ function credentialLine(provider) {
114
+ if (provider.connect === "signin") return provider.configured ? "Signed in with your ChatGPT account" : "Not signed in";
115
+ if (provider.connect === "local") return provider.address ?? "A model server on this network";
116
+ const key = provider.fields.find((field) => field.kind === "secret" && field.set);
117
+ if (key) return `${key.label} ${key.preview ?? "saved"}`;
118
+ if (provider.configured) return "Credentials from the daemon’s environment";
119
+ return "No credentials saved";
120
+ }
121
+ /** The models to ask first: suggested ones, then the ones already in use. */
122
+ function initialPicks(models) {
123
+ const selected = models.filter((model) => model.selected).map((model) => model.id);
124
+ if (selected.length > 0) return selected;
125
+ return models.filter((model) => model.suggested).map((model) => model.id);
126
+ }
127
+ /** The cheapest of the given models by list price; unpriced ones come last, in order. */
128
+ function cheapest(models) {
129
+ const cost = (model) => model.price ? model.price.input + model.price.output : Number.POSITIVE_INFINITY;
130
+ return models.map((model, index) => ({
131
+ model,
132
+ index
133
+ })).sort((a, b) => cost(a.model) - cost(b.model) || a.index - b.index)[0]?.model;
134
+ }
135
+ //#endregion
136
+ export { initialPicks as a, menuGroups as c, providerStatus as d, usedByLine as f, factsLine as i, modelName as l, cheapest as n, matchesModel as o, credentialLine as r, menuFacts as s, ago as t, priceLine as u };
@@ -0,0 +1,190 @@
1
+ import { t as cn } from "./utils-C_uf36nf.js";
2
+ import { d as providerStatus, i as factsLine, l as modelName, u as priceLine } from "./model-facts-mrfrWQne.js";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ import { AlertTriangle, Search } from "lucide-react";
5
+ //#region src/components/setup/parts.tsx
6
+ /** A provider's initial on a tile: no logos, they are other companies' marks. */
7
+ function ProviderAvatar({ name, tone = "neutral", className }) {
8
+ return /* @__PURE__ */ jsx("span", {
9
+ "aria-hidden": "true",
10
+ className: cn("flex size-9 shrink-0 items-center justify-center rounded-xl text-[0.95rem] font-bold", tone === "success" && "bg-success/10 text-success", tone === "warning" && "bg-warning/10 text-warning", tone === "accent" && "bg-accent text-accent-foreground", tone === "neutral" && "bg-muted text-muted-foreground", className),
11
+ children: name.replace(/[^\p{L}\p{N}]/gu, "").slice(0, 1) || "?"
12
+ });
13
+ }
14
+ var CHIP = {
15
+ success: "bg-success/10 text-success",
16
+ warning: "bg-warning/10 text-warning",
17
+ neutral: "bg-muted text-muted-foreground"
18
+ };
19
+ function Chip({ tone, children }) {
20
+ return /* @__PURE__ */ jsxs("span", {
21
+ className: cn("inline-flex min-h-7 items-center gap-1.5 rounded-full px-3 text-xs font-semibold", CHIP[tone]),
22
+ children: [/* @__PURE__ */ jsx("span", {
23
+ "aria-hidden": "true",
24
+ className: "size-1.5 shrink-0 rounded-full bg-current"
25
+ }), children]
26
+ });
27
+ }
28
+ /** What a provider is doing for Agents, as a chip. */
29
+ function StateChip({ provider, now }) {
30
+ const status = providerStatus(provider, now);
31
+ return /* @__PURE__ */ jsx(Chip, {
32
+ tone: status.tone,
33
+ children: status.label
34
+ });
35
+ }
36
+ /** A failed test: what happened, what to do, and the provider's own words one click away. */
37
+ function FailureBox({ failure, children }) {
38
+ return /* @__PURE__ */ jsxs("div", {
39
+ role: "alert",
40
+ className: "rounded-2xl border border-warning/35 bg-warning/10 p-4 text-sm",
41
+ children: [/* @__PURE__ */ jsxs("div", {
42
+ className: "flex items-start gap-3",
43
+ children: [/* @__PURE__ */ jsx(AlertTriangle, {
44
+ className: "mt-0.5 size-5 shrink-0 text-warning",
45
+ "aria-hidden": "true"
46
+ }), /* @__PURE__ */ jsxs("div", {
47
+ className: "min-w-0 flex-1",
48
+ children: [
49
+ /* @__PURE__ */ jsx("div", {
50
+ className: "font-semibold text-foreground",
51
+ children: failure.title
52
+ }),
53
+ /* @__PURE__ */ jsx("div", {
54
+ className: "mt-0.5 text-muted-foreground",
55
+ children: failure.hint
56
+ }),
57
+ failure.detail && /* @__PURE__ */ jsxs("details", {
58
+ className: "mt-2 text-xs text-muted-foreground",
59
+ children: [/* @__PURE__ */ jsx("summary", {
60
+ className: "cursor-pointer font-semibold",
61
+ children: "Details"
62
+ }), /* @__PURE__ */ jsx("div", {
63
+ className: "mt-1 break-words font-mono",
64
+ children: failure.detail
65
+ })]
66
+ })
67
+ ]
68
+ })]
69
+ }), children && /* @__PURE__ */ jsx("div", {
70
+ className: "mt-3 flex flex-wrap justify-end gap-2",
71
+ children
72
+ })]
73
+ });
74
+ }
75
+ /** A search box: the magnifier and the input are one field, with one focus ring. */
76
+ function SearchField({ label, placeholder, value, onChange, className }) {
77
+ return /* @__PURE__ */ jsxs("label", {
78
+ className: cn("m-0 flex min-w-0 items-center gap-2 rounded-xl border border-border bg-muted/40 px-3 transition-shadow focus-within:border-primary focus-within:bg-card focus-within:shadow-[0_0_0_3px_var(--color-sapphire-glow)]", className),
79
+ children: [/* @__PURE__ */ jsx(Search, {
80
+ className: "size-4 shrink-0 text-muted-foreground",
81
+ "aria-hidden": "true"
82
+ }), /* @__PURE__ */ jsx("input", {
83
+ type: "search",
84
+ "aria-label": label,
85
+ placeholder,
86
+ value,
87
+ onChange: (event) => onChange(event.target.value),
88
+ className: "min-h-10 border-0 bg-transparent px-0 shadow-none focus:bg-transparent focus:shadow-none",
89
+ style: { outline: "none" }
90
+ })]
91
+ });
92
+ }
93
+ /**
94
+ * One model in a list to tick: its name and id, what it can do, what it costs. On a narrow screen
95
+ * the facts sit under the name instead of beside it.
96
+ */
97
+ function ModelRow({ model, connect, checked, disabled, onToggle, className }) {
98
+ return /* @__PURE__ */ jsxs("label", {
99
+ className: cn("m-0 grid cursor-pointer grid-cols-[auto_minmax(0,1fr)] items-center gap-x-3 gap-y-0.5 border-b border-border py-2.5 sm:grid-cols-[auto_minmax(0,1.5fr)_minmax(0,1.2fr)_9.5rem]", className),
100
+ children: [
101
+ /* @__PURE__ */ jsx("input", {
102
+ type: "checkbox",
103
+ checked,
104
+ disabled,
105
+ onChange: onToggle,
106
+ className: "m-0 size-[18px]"
107
+ }),
108
+ /* @__PURE__ */ jsxs("span", {
109
+ className: "min-w-0",
110
+ children: [
111
+ /* @__PURE__ */ jsx("span", {
112
+ className: "text-sm font-semibold text-foreground",
113
+ children: modelName(model)
114
+ }),
115
+ model.suggested && /* @__PURE__ */ jsx("span", {
116
+ className: "ml-2 rounded-full bg-accent px-2 py-0.5 text-[0.7rem] font-semibold text-accent-foreground",
117
+ children: "Suggested"
118
+ }),
119
+ model.name && /* @__PURE__ */ jsx("span", {
120
+ className: "block break-all font-mono text-[0.72rem] text-muted-foreground",
121
+ children: model.id
122
+ })
123
+ ]
124
+ }),
125
+ /* @__PURE__ */ jsx("span", {
126
+ className: "col-start-2 text-xs text-muted-foreground sm:col-start-auto",
127
+ children: factsLine(model, connect)
128
+ }),
129
+ /* @__PURE__ */ jsx("span", {
130
+ className: "col-start-2 text-xs text-foreground sm:col-start-auto sm:text-right",
131
+ children: priceLine(model, connect)
132
+ })
133
+ ]
134
+ });
135
+ }
136
+ /** A yes/no setting. */
137
+ function Switch({ checked, label, disabled = false, onChange }) {
138
+ return /* @__PURE__ */ jsx("button", {
139
+ type: "button",
140
+ role: "switch",
141
+ "aria-checked": checked,
142
+ "aria-label": label,
143
+ disabled,
144
+ onClick: () => onChange(!checked),
145
+ className: cn("relative h-7 w-[46px] shrink-0 rounded-full transition-colors disabled:opacity-50", checked ? "bg-primary" : "bg-fawn"),
146
+ children: /* @__PURE__ */ jsx("span", { className: cn("absolute top-[3px] size-[22px] rounded-full bg-white shadow transition-[left]", checked ? "left-[21px]" : "left-[3px]") })
147
+ });
148
+ }
149
+ /** Something is being waited for. */
150
+ function Waiting({ children }) {
151
+ return /* @__PURE__ */ jsxs("div", {
152
+ role: "status",
153
+ className: "flex items-center gap-3 text-sm font-semibold text-foreground",
154
+ children: [/* @__PURE__ */ jsx("span", {
155
+ "aria-hidden": "true",
156
+ className: "flex size-5 shrink-0 items-center justify-center",
157
+ children: /* @__PURE__ */ jsx("span", { className: "size-2.5 animate-pulse rounded-full bg-primary" })
158
+ }), /* @__PURE__ */ jsx("span", { children })]
159
+ });
160
+ }
161
+ /** A card of the Models page: an icon, what it holds, an action, then its rows. */
162
+ function SetupCard({ icon, title, description, action, labelledBy, children }) {
163
+ return /* @__PURE__ */ jsxs("section", {
164
+ "aria-labelledby": labelledBy,
165
+ className: "min-w-0 overflow-hidden rounded-2xl border border-border bg-card shadow-baziu-sm",
166
+ children: [/* @__PURE__ */ jsxs("div", {
167
+ className: "flex flex-wrap items-center gap-x-4 gap-y-3 px-4 py-4 sm:px-5",
168
+ children: [/* @__PURE__ */ jsxs("div", {
169
+ className: "flex min-w-0 flex-1 basis-64 items-center gap-4",
170
+ children: [/* @__PURE__ */ jsx("span", {
171
+ "aria-hidden": "true",
172
+ className: "flex size-10 shrink-0 items-center justify-center rounded-xl bg-accent text-accent-foreground",
173
+ children: icon
174
+ }), /* @__PURE__ */ jsxs("div", {
175
+ className: "min-w-0",
176
+ children: [/* @__PURE__ */ jsx("h2", {
177
+ id: labelledBy,
178
+ className: "m-0 font-body text-[1.05rem] font-semibold text-foreground",
179
+ children: title
180
+ }), /* @__PURE__ */ jsx("div", {
181
+ className: "text-sm text-muted-foreground",
182
+ children: description
183
+ })]
184
+ })]
185
+ }), action]
186
+ }), children]
187
+ });
188
+ }
189
+ //#endregion
190
+ export { SearchField as a, Switch as c, ProviderAvatar as i, Waiting as l, FailureBox as n, SetupCard as o, ModelRow as r, StateChip as s, Chip as t };