bazilion 0.50.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 (170) hide show
  1. package/dist/cli.js +316 -90
  2. package/dist/cli.js.map +1 -1
  3. package/dist/daemon.js +1378 -364
  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-DvBzy2MN.js +1 -0
  7. package/dist/web/client/assets/ConfirmDialog-CiZ5tk9R.js +1 -0
  8. package/dist/web/client/assets/ConnectionsView-Czkpm2JY.js +1 -0
  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-DENNb6Nw.js +1 -0
  12. package/dist/web/client/assets/Segmented-Dh77vmpp.js +1 -0
  13. package/dist/web/client/assets/SkillFindings-Xng11qqx.js +1 -0
  14. package/dist/web/client/assets/SkillsPicker-hI3YXvib.js +1 -0
  15. package/dist/web/client/assets/SpawnDialog-CKWFQ6jk.js +1 -0
  16. package/dist/web/client/assets/Tabs-f6bHvCGn.js +1 -0
  17. package/dist/web/client/assets/TeamForm-kda1HYZG.js +1 -0
  18. package/dist/web/client/assets/TeamThread-2rm1JGSk.js +1 -0
  19. package/dist/web/client/assets/UnsavedChangesGuard-nx6dv2Yw.js +1 -0
  20. package/dist/web/client/assets/_id-B72mIpcE.js +1 -0
  21. package/dist/web/client/assets/_id-Bzavnza1.js +1 -0
  22. package/dist/web/client/assets/access-Yw9jODuk.js +1 -0
  23. package/dist/web/client/assets/agents-C9xoyL7o.js +1 -0
  24. package/dist/web/client/assets/agents-TviG16wx.js +1 -0
  25. package/dist/web/client/assets/api-HC_YzjBy.js +1 -0
  26. package/dist/web/client/assets/arrow-right-Gm_FDWJ_.js +1 -0
  27. package/dist/web/client/assets/attention-DmURtlJm.js +1 -0
  28. package/dist/web/client/assets/check-BjgKoGvU.js +1 -0
  29. package/dist/web/client/assets/chevron-right-CUZiA2aG.js +1 -0
  30. package/dist/web/client/assets/config-UZz_mjO5.js +1 -0
  31. package/dist/web/client/assets/createLucideIcon-C6gOo8sD.js +1 -0
  32. package/dist/web/client/assets/dist-BWppw70N.js +41 -0
  33. package/dist/web/client/assets/dist-D2dwY7MR.js +1 -0
  34. package/dist/web/client/assets/index-Df1oUtAP.js +14 -0
  35. package/dist/web/client/assets/link-Cbztlp_R.js +1 -0
  36. package/dist/web/client/assets/login-CPfdaqsV.js +1 -0
  37. package/dist/web/client/assets/mcp-FlYnNon0.js +1 -0
  38. package/dist/web/client/assets/model-facts-DoB6QD5y.js +1 -0
  39. package/dist/web/client/assets/parts-tIDBNsYA.js +1 -0
  40. package/dist/web/client/assets/plus-CWrKMtvA.js +1 -0
  41. package/dist/web/client/assets/routes-BZaWCoQj.js +76 -0
  42. package/dist/web/client/assets/save-f9O-CQia.js +1 -0
  43. package/dist/web/client/assets/skills-C7yDPC8s.js +1 -0
  44. package/dist/web/client/assets/style-DDuTFJUu.js +7 -0
  45. package/dist/web/client/assets/styles-BviXU81u.css +2 -0
  46. package/dist/web/client/assets/system-CL3Kz36L.js +1 -0
  47. package/dist/web/client/assets/teams-CQTEF5gV.js +1 -0
  48. package/dist/web/client/assets/teams-DQ7SqVyF.js +1 -0
  49. package/dist/web/client/assets/telegram-BLgxtGhZ.js +1 -0
  50. package/dist/web/client/assets/tools-pOQyGVYo.js +1 -0
  51. package/dist/web/client/assets/use-resource-C3MBZJop.js +1 -0
  52. package/dist/web/client/assets/welcome-Hr6JpMef.js +1 -0
  53. package/dist/web/client/assets/wrench-6BEIqKDn.js +1 -0
  54. package/dist/web/server/assets/AddProviderDialog-Tn4AskPm.js +613 -0
  55. package/dist/web/server/assets/{ConfigPage-DSLM5CLw.js → ConfigPage-DqDUujmt.js} +4 -4
  56. package/dist/web/server/assets/ConfirmDialog-DfaJ--A6.js +52 -0
  57. package/dist/web/server/assets/{ConnectionsView-DVLNH81Y.js → ConnectionsView-DAG-zNBz.js} +7 -5
  58. package/dist/web/server/assets/{ConfirmDialog-CvLZgbfY.js → Dialog-aup_yJv5.js} +3 -50
  59. package/dist/web/server/assets/ModelMenu-DUY9aHkE.js +138 -0
  60. package/dist/web/server/assets/{Rail-D8LhjS38.js → Rail-BIC_4ptO.js} +8 -66
  61. package/dist/web/server/assets/{SectionTabs-CNcvxbR8.js → SectionTabs-BGsrf-UQ.js} +5 -4
  62. package/dist/web/server/assets/Segmented-3ZLdqa5U.js +18 -0
  63. package/dist/web/server/assets/{SkillFindings-DX8lCMG7.js → SkillFindings-BdATze1A.js} +1 -1
  64. package/dist/web/server/assets/{SpawnDialog-Brmkl_ll.js → SpawnDialog-D_SMPCG_.js} +11 -8
  65. package/dist/web/server/assets/{TeamForm-CvQAs2FA.js → TeamForm-ilBaeLI4.js} +1 -1
  66. package/dist/web/server/assets/{TeamThread-BNJi6gPM.js → TeamThread-DuLlGDcw.js} +4 -19
  67. package/dist/web/server/assets/{UnsavedChangesGuard-B3Lpl08z.js → UnsavedChangesGuard-DrOvPV14.js} +1 -1
  68. package/dist/web/server/assets/{_id-CO1PgvyG.js → _id-BsZcsabI.js} +11 -11
  69. package/dist/web/server/assets/{_id-CA3QO7J5.js → _id-D8Kj0F30.js} +2 -2
  70. package/dist/web/server/assets/{_id-DIXUiIaB.js → _id-DJnYgisy.js} +2 -2
  71. package/dist/web/server/assets/{_id-E2N4gZ4O.js → _id-QYifTM9w.js} +3 -3
  72. package/dist/web/server/assets/{_id-BH1631a8.js → _id-yN0z7VqE.js} +6 -6
  73. package/dist/web/server/assets/_tanstack-start-manifest_v-D6zrzUC7.js +223 -0
  74. package/dist/web/server/assets/{tokens-CEdl8puR.js → access-C_pupPks.js} +3 -3
  75. package/dist/web/server/assets/{tokens-CsqoRt5T.js → access-DKOpcHIJ.js} +10 -10
  76. package/dist/web/server/assets/{tokens-ByPTGFBQ.js → access-GMGed5O8.js} +5 -5
  77. package/dist/web/server/assets/{agents-DrkEwIpR.js → agents-B6OR3x99.js} +14 -14
  78. package/dist/web/server/assets/{agents-CalSKogx.js → agents-B7642eRO.js} +5 -5
  79. package/dist/web/server/assets/{agents-DPZVni4Q.js → agents-BJ-_oC2e.js} +2 -2
  80. package/dist/web/server/assets/{agents-CdZvooeQ.js → agents-CjV0w-Zy.js} +2 -2
  81. package/dist/web/server/assets/{agents-C63VycUw.js → agents-Dy_Q-9lG.js} +3 -3
  82. package/dist/web/server/assets/{attention-DIyX3VMB.js → attention-CLP4HYBz.js} +3 -3
  83. package/dist/web/server/assets/{attention-BbE4yc-V.js → attention-DS3O9UmJ.js} +2 -2
  84. package/dist/web/server/assets/config-DjTGA4iZ.js +17 -0
  85. package/dist/web/server/assets/config-Q7livfa3.js +1215 -0
  86. package/dist/web/server/assets/config-X7qWbbpH.js +20 -0
  87. package/dist/web/server/assets/{Page-KIL1CsME.js → createSsrRpc-GCCF14VW.js} +17 -2
  88. package/dist/web/server/assets/{mcp-Cf7KzOJ9.js → mcp-BI-FD-JI.js} +5 -5
  89. package/dist/web/server/assets/{mcp-DE14q5c0.js → mcp-ZARSOxZW.js} +2 -2
  90. package/dist/web/server/assets/model-facts-mrfrWQne.js +136 -0
  91. package/dist/web/server/assets/parts-B31PJkhi.js +190 -0
  92. package/dist/web/server/assets/{router-w2yPgmC1.js → router-Dh2-IvLL.js} +69 -81
  93. package/dist/web/server/assets/{routes-1FEodTRm.js → routes-BJIJWCIE.js} +3 -3
  94. package/dist/web/server/assets/{routes-D1NHwz6f.js → routes-C9NawqcV.js} +22 -15
  95. package/dist/web/server/assets/{routes-B6AO0LjK.js → routes-CDskMy5C.js} +2 -2
  96. package/dist/web/server/assets/{skills-DC1OTc8n.js → skills-BqLq3ZXq.js} +5 -5
  97. package/dist/web/server/assets/{skills-CA17GjuZ.js → skills-StN15QhC.js} +2 -2
  98. package/dist/web/server/assets/system-BtRA2HUs.js +138 -0
  99. package/dist/web/server/assets/system-Dl-1RhoP.js +12 -0
  100. package/dist/web/server/assets/system-DtswhLW6.js +18 -0
  101. package/dist/web/server/assets/{teams-D6Tx-Jyn.js → teams-5PMGvHuM.js} +2 -2
  102. package/dist/web/server/assets/{teams-OzHTyVi9.js → teams-COaU0wN9.js} +4 -4
  103. package/dist/web/server/assets/{teams-Cg-QQWpH.js → teams-Ca8W4mvl.js} +5 -5
  104. package/dist/web/server/assets/{teams-Bm63mbTt.js → teams-CbIPKf99.js} +2 -2
  105. package/dist/web/server/assets/{telegram-Gy7_9yih.js → telegram-CGol0CKX2.js} +3 -3
  106. package/dist/web/server/assets/{telegram-xU-vXgef.js → telegram-Cv0D4gyz.js} +5 -5
  107. package/dist/web/server/assets/{telegram-BJ4l_TA_.js → telegram-Yx8nm6Ei.js} +5 -5
  108. package/dist/web/server/assets/tools-C-wwWjLI.js +12 -0
  109. package/dist/web/server/assets/tools-OfD22R-C.js +502 -0
  110. package/dist/web/server/assets/tools-ioJcPzMW.js +12 -0
  111. package/dist/web/server/assets/use-resource-DVzK0toP.js +63 -0
  112. package/dist/web/server/assets/utils-C_uf36nf.js +8 -0
  113. package/dist/web/server/assets/welcome-CxXMI4HI.js +15 -0
  114. package/dist/web/server/assets/welcome-FFEbrNT1.js +319 -0
  115. package/dist/web/server/assets/welcome-jxmpE_Jb.js +26 -0
  116. package/dist/web/server/assets/{workspace-DeEYMPDX.js → workspace-DaitCM0t.js} +1 -8
  117. package/dist/web/server/server.js +27 -19
  118. package/dist/worker.js +277 -153
  119. package/dist/worker.js.map +1 -1
  120. package/package.json +1 -1
  121. package/dist/web/client/assets/ConfigPage-_FY--9PB.js +0 -1
  122. package/dist/web/client/assets/ConfirmDialog-BblXqMVb.js +0 -1
  123. package/dist/web/client/assets/ConnectionsView-BZHJysCa.js +0 -1
  124. package/dist/web/client/assets/FieldRow-k05wfDy9.js +0 -1
  125. package/dist/web/client/assets/ModelSelect-CvOHjUyB.js +0 -1
  126. package/dist/web/client/assets/SectionTabs-DlfXtepS.js +0 -1
  127. package/dist/web/client/assets/SkillFindings-CHf5ZGY0.js +0 -1
  128. package/dist/web/client/assets/SkillsPicker-Cr87y_W-.js +0 -1
  129. package/dist/web/client/assets/SpawnDialog-C-Ujb4bC.js +0 -1
  130. package/dist/web/client/assets/Tabs-D0LgBNIk.js +0 -1
  131. package/dist/web/client/assets/TeamForm-D6EAAF7m.js +0 -1
  132. package/dist/web/client/assets/TeamThread-DpUOwMoi.js +0 -1
  133. package/dist/web/client/assets/UnsavedChangesGuard-DTUP7hwu.js +0 -1
  134. package/dist/web/client/assets/_id-C94dgBDe.js +0 -1
  135. package/dist/web/client/assets/_id-CxmEfoEp.js +0 -1
  136. package/dist/web/client/assets/agents-C-bJ5R_0.js +0 -1
  137. package/dist/web/client/assets/agents-odqBNx-A.js +0 -1
  138. package/dist/web/client/assets/api-CPzQ_z9m.js +0 -1
  139. package/dist/web/client/assets/arrow-right-Dyta3p06.js +0 -1
  140. package/dist/web/client/assets/attention-D0e7o7fh.js +0 -1
  141. package/dist/web/client/assets/chevron-right-B2YEg9rw.js +0 -1
  142. package/dist/web/client/assets/config-B7Y5MtpM.js +0 -3
  143. package/dist/web/client/assets/createLucideIcon-Cgab8gqu.js +0 -1
  144. package/dist/web/client/assets/index-CNVw44IE.js +0 -54
  145. package/dist/web/client/assets/jsx-runtime-bzQ4Vb5N.js +0 -1
  146. package/dist/web/client/assets/link-ClwtaO_E.js +0 -1
  147. package/dist/web/client/assets/login-Br1F4rQx.js +0 -1
  148. package/dist/web/client/assets/mcp-B8bIAY6k.js +0 -1
  149. package/dist/web/client/assets/routes-BZdlkRdC.js +0 -76
  150. package/dist/web/client/assets/save-ZqeB_I-c.js +0 -1
  151. package/dist/web/client/assets/services-CPJxDrVG.js +0 -1
  152. package/dist/web/client/assets/skills-DE_kQQGj.js +0 -1
  153. package/dist/web/client/assets/style-BWShXY3e.js +0 -7
  154. package/dist/web/client/assets/styles-Tney8jZq.css +0 -2
  155. package/dist/web/client/assets/teams-AcuSLc3I.js +0 -1
  156. package/dist/web/client/assets/teams-tRamPg7O.js +0 -1
  157. package/dist/web/client/assets/telegram-Ku69-GAv.js +0 -1
  158. package/dist/web/client/assets/tokens-DuLNZMgi.js +0 -1
  159. package/dist/web/client/assets/welcome-CrQk6n6I.js +0 -1
  160. package/dist/web/server/assets/FieldRow-DQBzMtcR.js +0 -173
  161. package/dist/web/server/assets/ModelSelect-Vwro6OkL.js +0 -43
  162. package/dist/web/server/assets/_tanstack-start-manifest_v-BVfrV7LQ.js +0 -191
  163. package/dist/web/server/assets/config-3tPtOmPE.js +0 -12
  164. package/dist/web/server/assets/config-DJGZiPBJ.js +0 -798
  165. package/dist/web/server/assets/config-rUqhMjIs.js +0 -25
  166. package/dist/web/server/assets/createSsrRpc-6LHNEsSK.js +0 -16
  167. package/dist/web/server/assets/services-BjroGXgC.js +0 -74
  168. package/dist/web/server/assets/services-Cdk40QHq.js +0 -13
  169. package/dist/web/server/assets/services-DsHRLL8q.js +0 -12
  170. package/dist/web/server/assets/welcome-O6Rjd7yO.js +0 -93
@@ -0,0 +1,613 @@
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 { n as DialogActions, t as Dialog } from "./Dialog-aup_yJv5.js";
4
+ import { a as initialPicks, d as providerStatus, l as modelName, n as cheapest, o as matchesModel } from "./model-facts-mrfrWQne.js";
5
+ import { a as SearchField, i as ProviderAvatar, l as Waiting, n as FailureBox, r as ModelRow } from "./parts-B31PJkhi.js";
6
+ import { useEffect, useMemo, useRef, useState } from "react";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ import { ArrowLeft, Check, ChevronRight, Images, X } from "lucide-react";
9
+ //#region src/components/setup/ProviderConnect.tsx
10
+ /** Rows of a long catalog shown at once; typing narrows it down. */
11
+ var MAX_ROWS = 60;
12
+ function initialValues(provider) {
13
+ const values = {};
14
+ for (const field of provider.fields) values[field.envVar] = field.kind === "config" ? field.value ?? "" : "";
15
+ const address = provider.fields.find((field) => field.kind === "config" && !field.advanced);
16
+ if (provider.connect === "local" && address && !address.set) values[address.envVar] = provider.address ?? "";
17
+ return values;
18
+ }
19
+ /** The fields whose value is not what is stored: only those are sent. */
20
+ function changedFields(provider, values) {
21
+ const changed = {};
22
+ for (const field of provider.fields) {
23
+ const value = (values[field.envVar] ?? "").trim();
24
+ if (field.kind === "secret") {
25
+ if (value) changed[field.envVar] = value;
26
+ } else if (value !== (field.value ?? "")) {
27
+ if (!field.set && provider.connect === "local" && value === provider.address) continue;
28
+ changed[field.envVar] = value;
29
+ }
30
+ }
31
+ return changed;
32
+ }
33
+ /**
34
+ * Connect a provider in one step: its key, sign-in or address, the models Agents may use, and one
35
+ * button that tests before anything is saved. Used by "Add a provider" and by the first run.
36
+ */
37
+ function ProviderConnect({ provider, imageRoutes = [], onConnected }) {
38
+ const [values, setValues] = useState(() => initialValues(provider));
39
+ const [lookup, setLookup] = useState(() => changedLookup(provider, initialValues(provider)));
40
+ const [picked, setPicked] = useState(null);
41
+ const [extra, setExtra] = useState([]);
42
+ const [typedModel, setTypedModel] = useState("");
43
+ const [showAll, setShowAll] = useState(null);
44
+ const [showMore, setShowMore] = useState(false);
45
+ const [query, setQuery] = useState("");
46
+ const [phase, setPhase] = useState("idle");
47
+ const [signedIn, setSignedIn] = useState(provider.configured);
48
+ const [failure, setFailure] = useState(null);
49
+ const [error, setError] = useState(null);
50
+ const request = useRef(null);
51
+ useEffect(() => () => request.current?.abort(), []);
52
+ const outcome = useRef(null);
53
+ useEffect(() => {
54
+ if (failure || error) outcome.current?.scrollIntoView({
55
+ block: "nearest",
56
+ behavior: "smooth"
57
+ });
58
+ }, [failure, error]);
59
+ const catalog = useResource((signal) => api(`/api/config/providers/${encodeURIComponent(provider.id)}/catalog`, {
60
+ body: { fields: lookup },
61
+ signal
62
+ }), [provider.id, JSON.stringify(lookup)]);
63
+ const models = useMemo(() => {
64
+ const rank = (model) => {
65
+ const at = provider.suggested.indexOf(model.id);
66
+ return at === -1 ? provider.suggested.length : at;
67
+ };
68
+ const listed = [...catalog.data?.models ?? []].sort((a, b) => rank(a) - rank(b));
69
+ const known = new Set(listed.map((model) => model.id));
70
+ return [...listed, ...extra.filter((id) => !known.has(id)).map((id) => ({
71
+ id,
72
+ selected: false,
73
+ suggested: false
74
+ }))];
75
+ }, [
76
+ catalog.data,
77
+ extra,
78
+ provider.suggested
79
+ ]);
80
+ useEffect(() => {
81
+ const listed = catalog.data?.models;
82
+ if (!listed) return;
83
+ setPicked((current) => {
84
+ if (current && [...current].some((id) => listed.some((model) => model.id === id))) return current;
85
+ return new Set(initialPicks(listed));
86
+ });
87
+ setShowAll((current) => current ?? (listed.length <= 6 || initialPicks(listed).length === 0));
88
+ }, [catalog.data]);
89
+ const picks = picked ?? /* @__PURE__ */ new Set();
90
+ const chosen = models.filter((model) => picks.has(model.id));
91
+ const asked = cheapest(chosen);
92
+ const busy = phase !== "idle";
93
+ const local = provider.connect === "local";
94
+ const signin = provider.connect === "signin";
95
+ const mainFields = provider.fields.filter((field) => !field.advanced);
96
+ const advancedFields = provider.fields.filter((field) => field.advanced);
97
+ const credentialsReady = signin || provider.configured || mainFields.every((field) => field.set || (values[field.envVar] ?? "").trim().length > 0);
98
+ const shortlist = models.filter((model) => model.suggested || model.selected || picks.has(model.id));
99
+ const browsing = showAll === true;
100
+ const matching = browsing ? models.filter((model) => query ? matchesModel(model, query) : !model.dated || picks.has(model.id)) : shortlist;
101
+ const rows = matching.slice(0, MAX_ROWS);
102
+ function toggle(id) {
103
+ setPicked((current) => {
104
+ const next = new Set(current);
105
+ if (next.has(id)) next.delete(id);
106
+ else next.add(id);
107
+ return next;
108
+ });
109
+ }
110
+ function addTyped() {
111
+ const id = typedModel.trim();
112
+ if (!id) return;
113
+ setExtra((current) => current.includes(id) ? current : [...current, id]);
114
+ setPicked((current) => new Set(current).add(id));
115
+ setTypedModel("");
116
+ }
117
+ async function submit(test) {
118
+ request.current?.abort();
119
+ const controller = new AbortController();
120
+ request.current = controller;
121
+ setFailure(null);
122
+ setError(null);
123
+ try {
124
+ if (signin && !signedIn) {
125
+ setPhase("signin");
126
+ await api("/api/auth/openai/login", {
127
+ method: "POST",
128
+ signal: controller.signal
129
+ });
130
+ setSignedIn(true);
131
+ }
132
+ setPhase("connecting");
133
+ const body = {
134
+ fields: changedFields(provider, values),
135
+ models: chosen.map((model) => model.id),
136
+ ...test && chosen.length > 0 ? {} : { test: false }
137
+ };
138
+ const result = await api(`/api/config/providers/${encodeURIComponent(provider.id)}/connect`, {
139
+ body,
140
+ signal: controller.signal
141
+ });
142
+ if (controller.signal.aborted) return;
143
+ if (result.connected) await onConnected(result);
144
+ else setFailure(result.failure);
145
+ } catch (cause) {
146
+ if (!controller.signal.aborted) setError(errorMessage(cause));
147
+ } finally {
148
+ if (request.current === controller) setPhase("idle");
149
+ }
150
+ }
151
+ let testNote = "No chat model is ticked, so nothing is tested.";
152
+ if (chosen.length > 0) {
153
+ const target = asked ? modelName(asked) : "a model";
154
+ const rank = asked?.price ? "cheapest" : "first";
155
+ const which = chosen.length > 1 ? `${target}, the ${rank} one ticked` : target;
156
+ testNote = signin && !signedIn ? `After the sign-in, one short message goes to ${which}.` : `The test sends one short message to ${which}.`;
157
+ if (asked?.price && !signin) testNote += " It costs a fraction of a cent.";
158
+ }
159
+ return /* @__PURE__ */ jsxs("form", {
160
+ onSubmit: (event) => {
161
+ event.preventDefault();
162
+ submit(true);
163
+ },
164
+ className: "grid gap-4",
165
+ children: [
166
+ provider.hint && /* @__PURE__ */ jsx("p", {
167
+ className: "m-0 text-sm text-muted-foreground",
168
+ children: provider.hint
169
+ }),
170
+ signin && /* @__PURE__ */ jsx("p", {
171
+ className: "m-0 rounded-xl border border-border bg-muted/40 p-3 text-sm text-muted-foreground",
172
+ children: signedIn ? "You are signed in with ChatGPT. Bazilion renews the sign-in by itself." : "A browser tab opens on the machine Bazilion runs on, and you sign in with your ChatGPT account there. On another machine, run bazilion auth openai login --device-code on it instead."
173
+ }),
174
+ mainFields.map((field, index) => /* @__PURE__ */ jsx(FieldInput, {
175
+ field,
176
+ value: values[field.envVar] ?? "",
177
+ disabled: busy,
178
+ autoFocus: index === 0 && !local,
179
+ onChange: (value) => setValues((current) => ({
180
+ ...current,
181
+ [field.envVar]: value
182
+ })),
183
+ onCommit: local ? () => setLookup(changedLookup(provider, values)) : void 0
184
+ }, field.envVar)),
185
+ advancedFields.length > 0 && /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsxs("button", {
186
+ type: "button",
187
+ "aria-expanded": showMore,
188
+ onClick: () => setShowMore((open) => !open),
189
+ className: "flex items-center gap-1.5 text-sm font-semibold text-foreground",
190
+ children: [/* @__PURE__ */ jsx(ChevronRight, {
191
+ className: `size-4 text-muted-foreground transition-transform ${showMore ? "rotate-90" : ""}`,
192
+ "aria-hidden": "true"
193
+ }), "More settings"]
194
+ }), showMore && /* @__PURE__ */ jsx("div", {
195
+ className: "mt-2 grid gap-3 rounded-xl border border-border bg-muted/40 p-3",
196
+ children: advancedFields.map((field) => /* @__PURE__ */ jsx(FieldInput, {
197
+ field,
198
+ value: values[field.envVar] ?? "",
199
+ disabled: busy,
200
+ onChange: (value) => setValues((current) => ({
201
+ ...current,
202
+ [field.envVar]: value
203
+ }))
204
+ }, field.envVar))
205
+ })] }),
206
+ /* @__PURE__ */ jsxs("fieldset", {
207
+ className: "m-0 min-w-0 border-0 p-0",
208
+ children: [
209
+ /* @__PURE__ */ jsxs("legend", {
210
+ className: "mb-2 flex w-full flex-wrap items-baseline gap-x-2 p-0",
211
+ children: [/* @__PURE__ */ jsx("span", {
212
+ className: "text-sm font-semibold text-foreground",
213
+ children: "Models your Agents can use"
214
+ }), /* @__PURE__ */ jsx("span", {
215
+ className: "text-xs text-muted-foreground",
216
+ children: local ? "What the server reports. You can change this later." : `${models.length} available. You can change this later.`
217
+ })]
218
+ }),
219
+ local && catalog.data?.listError && /* @__PURE__ */ jsxs("div", {
220
+ className: "mb-2 flex flex-wrap items-center gap-3 rounded-xl border border-warning/35 bg-warning/10 px-3 py-2 text-sm",
221
+ children: [/* @__PURE__ */ jsxs("span", {
222
+ className: "min-w-0 flex-1",
223
+ children: [
224
+ "Nothing answers at ",
225
+ values[mainFields[0]?.envVar ?? ""] || "that address",
226
+ ". Start",
227
+ " ",
228
+ provider.displayName,
229
+ " and switch its server on."
230
+ ]
231
+ }), /* @__PURE__ */ jsx(Button, {
232
+ variant: "ghost",
233
+ disabled: catalog.loading,
234
+ onClick: () => {
235
+ setLookup(changedLookup(provider, values));
236
+ catalog.reload();
237
+ },
238
+ children: catalog.loading ? "Looking…" : "Look again"
239
+ })]
240
+ }),
241
+ browsing && models.length > 8 && /* @__PURE__ */ jsx(SearchField, {
242
+ label: `Search ${provider.displayName} models`,
243
+ placeholder: "Search by name",
244
+ value: query,
245
+ onChange: setQuery,
246
+ className: "mb-2"
247
+ }),
248
+ browsing && models.length > 8 && chosen.length > 0 && /* @__PURE__ */ jsxs("div", {
249
+ className: "mb-2 flex flex-wrap items-center gap-1.5 text-xs",
250
+ children: [/* @__PURE__ */ jsx("span", {
251
+ className: "text-muted-foreground",
252
+ children: "Ticked:"
253
+ }), chosen.map((model) => /* @__PURE__ */ jsxs("button", {
254
+ type: "button",
255
+ disabled: busy,
256
+ onClick: () => toggle(model.id),
257
+ "aria-label": `Untick ${modelName(model)}`,
258
+ className: "inline-flex items-center gap-1 rounded-full bg-accent px-2.5 py-1 font-semibold text-accent-foreground",
259
+ children: [modelName(model), /* @__PURE__ */ jsx(X, {
260
+ className: "size-3",
261
+ "aria-hidden": "true"
262
+ })]
263
+ }, model.id))]
264
+ }),
265
+ /* @__PURE__ */ jsxs("div", {
266
+ className: "max-h-72 overflow-y-auto rounded-xl border border-border",
267
+ children: [
268
+ catalog.loading && !catalog.data && /* @__PURE__ */ jsx("div", {
269
+ className: "p-3 text-sm text-muted-foreground",
270
+ children: "Reading the model list…"
271
+ }),
272
+ catalog.error && /* @__PURE__ */ jsx("div", {
273
+ className: "p-3 text-sm text-danger",
274
+ children: catalog.error
275
+ }),
276
+ catalog.data && rows.length === 0 && /* @__PURE__ */ jsx("div", {
277
+ className: "p-3 text-sm text-muted-foreground",
278
+ children: query ? "No model matches." : local ? "The server lists no model yet." : "No models are listed for this provider. Add one by its id below."
279
+ }),
280
+ rows.map((model) => /* @__PURE__ */ jsx(ModelRow, {
281
+ model,
282
+ connect: provider.connect,
283
+ checked: picks.has(model.id),
284
+ disabled: busy,
285
+ onToggle: () => toggle(model.id),
286
+ className: "px-3 last:border-b-0"
287
+ }, model.id)),
288
+ matching.length > rows.length && /* @__PURE__ */ jsxs("div", {
289
+ className: "p-3 text-xs text-muted-foreground",
290
+ children: [matching.length - rows.length, " more: search to narrow them down."]
291
+ })
292
+ ]
293
+ }),
294
+ /* @__PURE__ */ jsxs("div", {
295
+ className: "mt-2 flex flex-wrap items-center gap-x-4 gap-y-2",
296
+ children: [!browsing && models.length > shortlist.length && /* @__PURE__ */ jsxs("button", {
297
+ type: "button",
298
+ onClick: () => setShowAll(true),
299
+ className: "text-sm font-semibold text-primary",
300
+ children: ["See all ", models.length]
301
+ }), browsing && !local && /* @__PURE__ */ jsxs("span", {
302
+ className: "flex min-w-0 flex-1 basis-64 items-center gap-2",
303
+ children: [/* @__PURE__ */ jsx("input", {
304
+ type: "text",
305
+ "aria-label": "A model id that is not listed",
306
+ placeholder: "A model id that is not listed",
307
+ value: typedModel,
308
+ disabled: busy,
309
+ onChange: (event) => setTypedModel(event.target.value),
310
+ onKeyDown: (event) => {
311
+ if (event.key === "Enter") {
312
+ event.preventDefault();
313
+ addTyped();
314
+ }
315
+ },
316
+ className: "min-h-10 font-mono text-sm"
317
+ }), /* @__PURE__ */ jsx(Button, {
318
+ variant: "ghost",
319
+ disabled: busy || !typedModel.trim(),
320
+ onClick: addTyped,
321
+ children: "Add"
322
+ })]
323
+ })]
324
+ })
325
+ ]
326
+ }),
327
+ imageRoutes.length > 0 && /* @__PURE__ */ jsxs("p", {
328
+ className: "m-0 flex items-start gap-2 text-sm text-muted-foreground",
329
+ children: [/* @__PURE__ */ jsx(Images, {
330
+ className: "mt-0.5 size-4 shrink-0 text-accent-foreground",
331
+ "aria-hidden": "true"
332
+ }), /* @__PURE__ */ jsxs("span", { children: [
333
+ signin ? "The same sign-in" : "The same key",
334
+ " makes",
335
+ " ",
336
+ [...new Set(imageRoutes.map((route) => route.model))].join(" and "),
337
+ " available under Images."
338
+ ] })]
339
+ }),
340
+ /* @__PURE__ */ jsxs("div", {
341
+ ref: outcome,
342
+ className: "grid gap-3 empty:hidden",
343
+ children: [failure && /* @__PURE__ */ jsx(FailureBox, { failure }), error && /* @__PURE__ */ jsx("p", {
344
+ role: "alert",
345
+ className: "m-0 rounded-xl bg-danger/10 px-3 py-2 text-sm text-danger",
346
+ children: error
347
+ })]
348
+ }),
349
+ busy ? /* @__PURE__ */ jsx(Waiting, { children: phase === "signin" ? "Waiting for the ChatGPT sign-in in the browser…" : asked ? `Asking ${modelName(asked)} for a short reply…` : "Saving…" }) : /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsxs("div", {
350
+ className: "flex flex-wrap items-center gap-x-4 gap-y-2",
351
+ children: [/* @__PURE__ */ jsx(Button, {
352
+ variant: "primary",
353
+ type: "submit",
354
+ disabled: !credentialsReady || local && chosen.length === 0,
355
+ children: signin && !signedIn ? "Sign in with ChatGPT" : chosen.length === 0 ? "Connect" : "Connect and test"
356
+ }), chosen.length > 0 && !(signin && !signedIn) && /* @__PURE__ */ jsx("button", {
357
+ type: "button",
358
+ disabled: !credentialsReady,
359
+ onClick: () => void submit(false),
360
+ className: "text-sm font-semibold text-primary disabled:opacity-50",
361
+ children: "Save without testing"
362
+ })]
363
+ }), /* @__PURE__ */ jsx("p", {
364
+ className: "m-0 mt-2 text-xs text-muted-foreground",
365
+ children: testNote
366
+ })] })
367
+ ]
368
+ });
369
+ }
370
+ /** The config fields being typed, for asking a local server at an address that is not saved. */
371
+ function changedLookup(provider, values) {
372
+ if (provider.connect !== "local") return {};
373
+ const changed = changedFields(provider, values);
374
+ return Object.fromEntries(Object.entries(changed).filter(([name]) => provider.fields.some((field) => field.envVar === name && field.kind === "config")));
375
+ }
376
+ function FieldInput({ field, value, disabled, autoFocus = false, onChange, onCommit }) {
377
+ const secret = field.kind === "secret";
378
+ return /* @__PURE__ */ jsxs("label", {
379
+ className: "m-0 text-sm font-semibold text-foreground",
380
+ children: [
381
+ field.label,
382
+ /* @__PURE__ */ jsx("input", {
383
+ type: secret ? "password" : "text",
384
+ value,
385
+ disabled,
386
+ autoFocus,
387
+ autoComplete: "off",
388
+ spellCheck: false,
389
+ placeholder: secret && field.set ? "Saved. Paste another to replace it." : field.placeholder ?? "",
390
+ onChange: (event) => onChange(event.target.value),
391
+ onBlur: onCommit,
392
+ onKeyDown: (event) => {
393
+ if (event.key === "Enter" && onCommit) {
394
+ event.preventDefault();
395
+ onCommit();
396
+ }
397
+ },
398
+ className: "mt-1.5 font-mono font-normal"
399
+ }),
400
+ (field.description || secret) && /* @__PURE__ */ jsx("span", {
401
+ className: "mt-1 block text-xs font-normal text-muted-foreground",
402
+ children: field.description ?? "Stored encrypted on the machine Bazilion runs on. It is never shown again."
403
+ })
404
+ ]
405
+ });
406
+ }
407
+ //#endregion
408
+ //#region src/components/setup/AddProviderDialog.tsx
409
+ /** A local server's address without the scheme and path: what a person recognises. */
410
+ function hostOf(address) {
411
+ try {
412
+ return new URL(address).host;
413
+ } catch {
414
+ return address;
415
+ }
416
+ }
417
+ function localLine(server, looking) {
418
+ if (!server) return looking ? "Looking…" : "A model server on this computer";
419
+ if (!server.found) return `Nothing at ${hostOf(server.address)}`;
420
+ const count = server.models.length;
421
+ return `Running at ${hostOf(server.address)}, ${count === 1 ? "1 model" : `${count} models`}`;
422
+ }
423
+ function matches(provider, query) {
424
+ const needle = query.trim().toLowerCase();
425
+ if (!needle) return true;
426
+ return [
427
+ provider.displayName,
428
+ provider.id,
429
+ provider.hint ?? ""
430
+ ].some((text) => text.toLowerCase().includes(needle));
431
+ }
432
+ /** Every provider, the most used and the local ones first; `onPick` opens the next step. */
433
+ function ProviderChooser({ providers, expanded = false, onPick }) {
434
+ const [query, setQuery] = useState("");
435
+ const [showMore, setShowMore] = useState(expanded);
436
+ const local = useResource((signal) => api("/api/config/providers/local", { signal }), []);
437
+ const now = useMemo(() => Date.now(), []);
438
+ const visible = providers.filter((provider) => matches(provider, query));
439
+ const group = (name) => visible.filter((provider) => provider.group === name);
440
+ const more = group("more");
441
+ const searching = query.trim().length > 0;
442
+ const tile = (provider) => {
443
+ const server = local.data?.servers.find((entry) => entry.id === provider.id);
444
+ const found = provider.group === "local" && server?.found;
445
+ const sub = provider.listed ? providerStatus(provider, now).label : provider.group === "local" ? localLine(server, local.loading) : provider.hint ?? provider.id;
446
+ return /* @__PURE__ */ jsxs("button", {
447
+ type: "button",
448
+ onClick: () => onPick(provider),
449
+ className: "flex min-h-16 min-w-0 items-center gap-3 rounded-2xl border border-border bg-card px-3.5 py-2.5 text-left transition-colors hover:border-primary/40 hover:bg-accent/40",
450
+ children: [
451
+ /* @__PURE__ */ jsx(ProviderAvatar, {
452
+ name: provider.displayName,
453
+ tone: provider.listed || found ? "success" : "neutral"
454
+ }),
455
+ /* @__PURE__ */ jsxs("span", {
456
+ className: "min-w-0 flex-1",
457
+ children: [/* @__PURE__ */ jsx("span", {
458
+ className: "block truncate text-sm font-semibold text-foreground",
459
+ children: provider.displayName
460
+ }), /* @__PURE__ */ jsx("span", {
461
+ className: `line-clamp-2 text-xs leading-snug ${provider.listed || found ? "text-success" : "text-muted-foreground"}`,
462
+ children: sub
463
+ })]
464
+ }),
465
+ provider.listed ? /* @__PURE__ */ jsx(Check, {
466
+ className: "size-4 shrink-0 text-success",
467
+ "aria-hidden": "true"
468
+ }) : /* @__PURE__ */ jsx(ChevronRight, {
469
+ className: "size-4 shrink-0 text-muted-foreground",
470
+ "aria-hidden": "true"
471
+ })
472
+ ]
473
+ }, provider.id);
474
+ };
475
+ const section = (title, entries) => entries.length > 0 && /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h3", {
476
+ className: "m-0 mb-2 font-body text-[0.72rem] font-bold uppercase tracking-[0.08em] text-muted-foreground",
477
+ children: title
478
+ }), /* @__PURE__ */ jsx("div", {
479
+ className: "grid gap-2 sm:grid-cols-2",
480
+ children: entries.map(tile)
481
+ })] });
482
+ return /* @__PURE__ */ jsxs("div", {
483
+ className: "grid gap-4",
484
+ children: [
485
+ /* @__PURE__ */ jsx(SearchField, {
486
+ label: "Search providers",
487
+ placeholder: `Search ${providers.length} providers`,
488
+ value: query,
489
+ onChange: setQuery
490
+ }),
491
+ section("Most used", group("popular")),
492
+ section("On this computer", group("local")),
493
+ (searching || showMore) && section("More", more),
494
+ visible.length === 0 && /* @__PURE__ */ jsxs("p", {
495
+ className: "m-0 text-sm text-muted-foreground",
496
+ children: [
497
+ "No provider matches “",
498
+ query,
499
+ "”."
500
+ ]
501
+ }),
502
+ !searching && !showMore && more.length > 0 && /* @__PURE__ */ jsxs("button", {
503
+ type: "button",
504
+ onClick: () => setShowMore(true),
505
+ className: "justify-self-start text-sm font-semibold text-primary",
506
+ children: [
507
+ "Show ",
508
+ more.length,
509
+ " more:",
510
+ " ",
511
+ more.slice(0, 4).map((provider) => provider.displayName).join(", "),
512
+ "…"
513
+ ]
514
+ })
515
+ ]
516
+ });
517
+ }
518
+ /** What a finished connect says: who answered, what was added, what was left out. */
519
+ function ConnectedSummary({ result, imageRoutes }) {
520
+ const { provider, check, dropped, movedTemplates } = result;
521
+ const count = provider.models.length;
522
+ const images = [...new Set(imageRoutes.map((route) => route.model))];
523
+ return /* @__PURE__ */ jsxs("div", {
524
+ role: "status",
525
+ className: "flex items-start gap-4",
526
+ children: [/* @__PURE__ */ jsx("span", {
527
+ "aria-hidden": "true",
528
+ className: `flex size-11 shrink-0 items-center justify-center rounded-full ${check ? "bg-success/10 text-success" : "bg-muted text-muted-foreground"}`,
529
+ children: /* @__PURE__ */ jsx(Check, { className: "size-6" })
530
+ }), /* @__PURE__ */ jsxs("div", {
531
+ className: "min-w-0 flex-1 text-sm",
532
+ children: [/* @__PURE__ */ jsx("div", {
533
+ className: "text-base font-semibold text-foreground",
534
+ children: check ? `${provider.displayName} is connected` : `${provider.displayName} is saved, not tested`
535
+ }), /* @__PURE__ */ jsxs("ul", {
536
+ className: "m-0 mt-1 list-none space-y-0.5 p-0 text-muted-foreground",
537
+ children: [
538
+ check && /* @__PURE__ */ jsxs("li", { children: [
539
+ check.modelName ?? check.model,
540
+ " answered in ",
541
+ ((check.ms ?? 0) / 1e3).toFixed(1),
542
+ " s."
543
+ ] }),
544
+ /* @__PURE__ */ jsxs("li", { children: [count === 0 ? "No chat model is in use from it." : count === 1 ? "1 model is in Chat." : `${count} models are in Chat.`, !check && count > 0 && " Test it from its row before you rely on it."] }),
545
+ dropped.map((entry) => /* @__PURE__ */ jsxs("li", {
546
+ className: "text-warning",
547
+ children: [entry.model, " was left out: this account cannot use it."]
548
+ }, entry.model)),
549
+ images.length > 0 && /* @__PURE__ */ jsxs("li", { children: [images.join(" and "), " can now be chosen under Images."] }),
550
+ movedTemplates.map((template) => /* @__PURE__ */ jsxs("li", { children: [
551
+ "The ",
552
+ template.name,
553
+ " template now uses ",
554
+ template.model,
555
+ "."
556
+ ] }, template.id))
557
+ ]
558
+ })]
559
+ })]
560
+ });
561
+ }
562
+ /** "Add a provider": choose one, connect it, see that it answered. */
563
+ function AddProviderDialog({ providers, imageRoutes, start, onClose, onConnected, onOpenProvider }) {
564
+ const [chosen, setChosen] = useState(start && providers.some((provider) => provider.id === start) ? start : null);
565
+ const [done, setDone] = useState(null);
566
+ const provider = providers.find((entry) => entry.id === chosen) ?? null;
567
+ const routesOf = (id) => imageRoutes.filter((route) => route.provider === id);
568
+ if (done) return /* @__PURE__ */ jsxs(Dialog, {
569
+ title: done.provider.displayName,
570
+ onClose,
571
+ className: "max-w-xl",
572
+ children: [/* @__PURE__ */ jsx(ConnectedSummary, {
573
+ result: done,
574
+ imageRoutes: routesOf(done.provider.id)
575
+ }), /* @__PURE__ */ jsx(DialogActions, { children: /* @__PURE__ */ jsx(Button, {
576
+ variant: "primary",
577
+ onClick: onClose,
578
+ children: "Done"
579
+ }) })]
580
+ });
581
+ if (provider) return /* @__PURE__ */ jsxs(Dialog, {
582
+ title: `Connect ${provider.displayName}`,
583
+ onClose,
584
+ className: "top-[6dvh] max-h-[88dvh] max-w-2xl translate-y-0 content-start",
585
+ children: [!start && /* @__PURE__ */ jsxs("button", {
586
+ type: "button",
587
+ onClick: () => setChosen(null),
588
+ className: "-mt-1 flex items-center gap-1 justify-self-start text-sm font-semibold text-primary",
589
+ children: [/* @__PURE__ */ jsx(ArrowLeft, {
590
+ className: "size-4",
591
+ "aria-hidden": "true"
592
+ }), "All providers"]
593
+ }), /* @__PURE__ */ jsx(ProviderConnect, {
594
+ provider,
595
+ imageRoutes: routesOf(provider.id).filter((route) => !route.ready),
596
+ onConnected: async (result) => {
597
+ await onConnected();
598
+ setDone(result);
599
+ }
600
+ }, provider.id)]
601
+ });
602
+ return /* @__PURE__ */ jsx(Dialog, {
603
+ title: "Add a provider",
604
+ onClose,
605
+ className: "top-[6dvh] max-h-[88dvh] max-w-2xl translate-y-0 content-start",
606
+ children: /* @__PURE__ */ jsx(ProviderChooser, {
607
+ providers,
608
+ onPick: (picked) => picked.listed ? onOpenProvider(picked.id) : setChosen(picked.id)
609
+ })
610
+ });
611
+ }
612
+ //#endregion
613
+ export { ProviderConnect as a, hostOf as i, ConnectedSummary as n, ProviderChooser as r, AddProviderDialog as t };
@@ -1,5 +1,5 @@
1
- import { a as PageShell, i as PageHeader } from "./Page-KIL1CsME.js";
2
- import { n as SectionTabs, t as CONFIG_TABS } from "./SectionTabs-CNcvxbR8.js";
1
+ import { a as PageHeader, o as PageShell } from "./createSsrRpc-GCCF14VW.js";
2
+ import { n as SectionTabs, t as CONFIG_TABS } from "./SectionTabs-BGsrf-UQ.js";
3
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
4
  //#region src/components/ConfigPage.tsx
5
5
  function ConfigPage({ title, description, children, actions, size = "default" }) {
@@ -7,13 +7,13 @@ function ConfigPage({ title, description, children, actions, size = "default" })
7
7
  size,
8
8
  children: [
9
9
  /* @__PURE__ */ jsx(PageHeader, {
10
- eyebrow: "Configuration",
10
+ eyebrow: "Setup",
11
11
  title,
12
12
  description,
13
13
  actions
14
14
  }),
15
15
  /* @__PURE__ */ jsx(SectionTabs, {
16
- label: "Configuration sections",
16
+ label: "Setup sections",
17
17
  base: "/config",
18
18
  tabs: CONFIG_TABS
19
19
  }),
@@ -0,0 +1,52 @@
1
+ import { T as errorMessage, u as Button } from "./workspace-DaitCM0t.js";
2
+ import { n as DialogActions, t as Dialog } from "./Dialog-aup_yJv5.js";
3
+ import { useEffect, useState } from "react";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ //#region src/components/ConfirmDialog.tsx
6
+ /** Ask before a consequential action; `onConfirm` failures stay in the dialog. */
7
+ function ConfirmDialog({ open, title, description, confirmLabel, confirmVariant = "danger", onConfirm, onOpenChange }) {
8
+ const [busy, setBusy] = useState(false);
9
+ const [error, setError] = useState(null);
10
+ useEffect(() => {
11
+ if (!open) {
12
+ setBusy(false);
13
+ setError(null);
14
+ }
15
+ }, [open]);
16
+ async function confirm() {
17
+ setBusy(true);
18
+ setError(null);
19
+ try {
20
+ await onConfirm();
21
+ onOpenChange(false);
22
+ } catch (err) {
23
+ setError(errorMessage(err));
24
+ setBusy(false);
25
+ }
26
+ }
27
+ return /* @__PURE__ */ jsxs(Dialog, {
28
+ open,
29
+ busy,
30
+ onClose: () => onOpenChange(false),
31
+ title,
32
+ description,
33
+ className: "max-w-md",
34
+ children: [error && /* @__PURE__ */ jsx("p", {
35
+ role: "alert",
36
+ className: "rounded-md bg-danger/10 px-3 py-2 text-sm text-danger",
37
+ children: error
38
+ }), /* @__PURE__ */ jsxs(DialogActions, { children: [/* @__PURE__ */ jsx(Button, {
39
+ variant: "ghost",
40
+ disabled: busy,
41
+ onClick: () => onOpenChange(false),
42
+ children: "Cancel"
43
+ }), /* @__PURE__ */ jsx(Button, {
44
+ variant: confirmVariant,
45
+ disabled: busy,
46
+ onClick: () => void confirm(),
47
+ children: busy ? "Working…" : confirmLabel
48
+ })] })]
49
+ });
50
+ }
51
+ //#endregion
52
+ export { ConfirmDialog as t };