bazilion 0.50.0 → 0.51.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 (153) hide show
  1. package/dist/cli.js +245 -65
  2. package/dist/cli.js.map +1 -1
  3. package/dist/daemon.js +863 -209
  4. package/dist/daemon.js.map +1 -1
  5. package/dist/web/client/assets/AddProviderDialog-Diic36c_.js +1 -0
  6. package/dist/web/client/assets/ConfigPage-pupvtSCX.js +1 -0
  7. package/dist/web/client/assets/ConfirmDialog-GFDcHI1L.js +1 -0
  8. package/dist/web/client/assets/ConnectionsView-y1CeY-6U.js +1 -0
  9. package/dist/web/client/assets/Dialog-bg86_x4v.js +1 -0
  10. package/dist/web/client/assets/FieldRow-B8eIni5r.js +1 -0
  11. package/dist/web/client/assets/ModelSelect-DvCLUmkW.js +1 -0
  12. package/dist/web/client/assets/SectionTabs-D4ezA6U4.js +1 -0
  13. package/dist/web/client/assets/Segmented-Dh77vmpp.js +1 -0
  14. package/dist/web/client/assets/SkillFindings-BzLO1lNA.js +1 -0
  15. package/dist/web/client/assets/SkillsPicker-hI3YXvib.js +1 -0
  16. package/dist/web/client/assets/SpawnDialog-YJX6UMBC.js +1 -0
  17. package/dist/web/client/assets/Tabs-f6bHvCGn.js +1 -0
  18. package/dist/web/client/assets/TeamForm-kda1HYZG.js +1 -0
  19. package/dist/web/client/assets/TeamThread-DFvbakHo.js +1 -0
  20. package/dist/web/client/assets/UnsavedChangesGuard-DBJikVgc.js +1 -0
  21. package/dist/web/client/assets/_id-BjNtLwak.js +1 -0
  22. package/dist/web/client/assets/_id-BklaQf3z.js +1 -0
  23. package/dist/web/client/assets/agents-D9cUF2d9.js +1 -0
  24. package/dist/web/client/assets/agents-wuBlzx4e.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-8ZkSLl2e.js +1 -0
  28. package/dist/web/client/assets/check-BjgKoGvU.js +1 -0
  29. package/dist/web/client/assets/config-Con_BbSh.js +1 -0
  30. package/dist/web/client/assets/createLucideIcon-C6gOo8sD.js +1 -0
  31. package/dist/web/client/assets/index-Br9qkGM-.js +54 -0
  32. package/dist/web/client/assets/link-Cbztlp_R.js +1 -0
  33. package/dist/web/client/assets/login-llnOKSJc.js +1 -0
  34. package/dist/web/client/assets/mcp-zIUguMSI.js +1 -0
  35. package/dist/web/client/assets/plus-CWrKMtvA.js +1 -0
  36. package/dist/web/client/assets/routes-BY5uqJ2n.js +76 -0
  37. package/dist/web/client/assets/save-f9O-CQia.js +1 -0
  38. package/dist/web/client/assets/services-esLrcTwe.js +1 -0
  39. package/dist/web/client/assets/skills-DzYXksM0.js +1 -0
  40. package/dist/web/client/assets/style-Cdzqt_TJ.js +7 -0
  41. package/dist/web/client/assets/styles-BRSS6yrm.css +2 -0
  42. package/dist/web/client/assets/system-CsI66nyZ.js +1 -0
  43. package/dist/web/client/assets/teams-CHE_zpxS.js +1 -0
  44. package/dist/web/client/assets/teams-dxG9OESG.js +1 -0
  45. package/dist/web/client/assets/telegram-C3dGndJV.js +1 -0
  46. package/dist/web/client/assets/tokens-CNNH-Wr9.js +1 -0
  47. package/dist/web/client/assets/use-resource-BjnxgGvh.js +1 -0
  48. package/dist/web/client/assets/welcome-C8EOtc8P.js +1 -0
  49. package/dist/web/server/assets/AddProviderDialog-CR6TRYdZ.js +910 -0
  50. package/dist/web/server/assets/{ConfigPage-DSLM5CLw.js → ConfigPage-CIh3ohea.js} +4 -4
  51. package/dist/web/server/assets/ConfirmDialog-B79K2KEW.js +52 -0
  52. package/dist/web/server/assets/{ConnectionsView-DVLNH81Y.js → ConnectionsView-BIMYdp9C.js} +6 -4
  53. package/dist/web/server/assets/{ConfirmDialog-CvLZgbfY.js → Dialog-CVqpXxuN.js} +3 -50
  54. package/dist/web/server/assets/{FieldRow-DQBzMtcR.js → FieldRow-CHVhX2rS.js} +1 -1
  55. package/dist/web/server/assets/{ModelSelect-Vwro6OkL.js → ModelSelect-DrZrdndo.js} +7 -7
  56. package/dist/web/server/assets/{Rail-D8LhjS38.js → Rail-Cg-efcpA.js} +6 -64
  57. package/dist/web/server/assets/{SectionTabs-CNcvxbR8.js → SectionTabs-DrcgVeZd.js} +3 -2
  58. package/dist/web/server/assets/Segmented-3ZLdqa5U.js +18 -0
  59. package/dist/web/server/assets/{SkillFindings-DX8lCMG7.js → SkillFindings-DSDiL6hn.js} +1 -1
  60. package/dist/web/server/assets/{SpawnDialog-Brmkl_ll.js → SpawnDialog-BUUlLxE9.js} +2 -2
  61. package/dist/web/server/assets/{TeamThread-BNJi6gPM.js → TeamThread-5CjVPcDr.js} +3 -18
  62. package/dist/web/server/assets/{UnsavedChangesGuard-B3Lpl08z.js → UnsavedChangesGuard-CyF2Z9p1.js} +1 -1
  63. package/dist/web/server/assets/{_id-BH1631a8.js → _id-0fEWiVZX.js} +5 -5
  64. package/dist/web/server/assets/{_id-DIXUiIaB.js → _id-8bsYEcGg.js} +2 -2
  65. package/dist/web/server/assets/{_id-CA3QO7J5.js → _id-BvAaRSUW.js} +2 -2
  66. package/dist/web/server/assets/{_id-CO1PgvyG.js → _id-Dg6M_qfr.js} +5 -5
  67. package/dist/web/server/assets/{_id-E2N4gZ4O.js → _id-Dji7xr9C.js} +1 -1
  68. package/dist/web/server/assets/_tanstack-start-manifest_v-sxiIH4M7.js +214 -0
  69. package/dist/web/server/assets/{agents-CalSKogx.js → agents-BDA5yYZ2.js} +4 -4
  70. package/dist/web/server/assets/{agents-CdZvooeQ.js → agents-BTDxmp-F.js} +2 -2
  71. package/dist/web/server/assets/{agents-DPZVni4Q.js → agents-DM7guWF2.js} +2 -2
  72. package/dist/web/server/assets/{agents-DrkEwIpR.js → agents-DktqUffG.js} +7 -7
  73. package/dist/web/server/assets/{agents-C63VycUw.js → agents-xgZ9rsac.js} +1 -1
  74. package/dist/web/server/assets/{attention-BbE4yc-V.js → attention-CHQEQiZl.js} +2 -2
  75. package/dist/web/server/assets/{attention-DIyX3VMB.js → attention-De3-ehuf.js} +2 -2
  76. package/dist/web/server/assets/config-DOp28gcy.js +1067 -0
  77. package/dist/web/server/assets/config-DzgkbBoD.js +17 -0
  78. package/dist/web/server/assets/config-X7qWbbpH.js +20 -0
  79. package/dist/web/server/assets/{Page-KIL1CsME.js → createSsrRpc-CcLbajrF.js} +16 -1
  80. package/dist/web/server/assets/{mcp-Cf7KzOJ9.js → mcp-CO_tycXU.js} +4 -4
  81. package/dist/web/server/assets/{mcp-DE14q5c0.js → mcp-D3OCoHtO.js} +2 -2
  82. package/dist/web/server/assets/{router-w2yPgmC1.js → router-Cs2Ak4II.js} +57 -69
  83. package/dist/web/server/assets/{routes-D1NHwz6f.js → routes-BSNOKE-C.js} +13 -10
  84. package/dist/web/server/assets/{routes-1FEodTRm.js → routes-BVwqgZGI.js} +2 -2
  85. package/dist/web/server/assets/{routes-B6AO0LjK.js → routes-CO4l-GJ0.js} +1 -1
  86. package/dist/web/server/assets/{services-Cdk40QHq.js → services-DZLxUSG8.js} +2 -2
  87. package/dist/web/server/assets/{services-BjroGXgC.js → services-DsvpaF3L.js} +4 -4
  88. package/dist/web/server/assets/{skills-CA17GjuZ.js → skills-CggQJk6a.js} +2 -2
  89. package/dist/web/server/assets/{skills-DC1OTc8n.js → skills-DKYV7PTk.js} +4 -4
  90. package/dist/web/server/assets/system-CZ2qzBz3.js +138 -0
  91. package/dist/web/server/assets/system-DsJfpBPl.js +12 -0
  92. package/dist/web/server/assets/system-DtswhLW62.js +18 -0
  93. package/dist/web/server/assets/{teams-Cg-QQWpH.js → teams-B6PzNcoy.js} +3 -3
  94. package/dist/web/server/assets/{teams-Bm63mbTt.js → teams-B6lBhvdL.js} +2 -2
  95. package/dist/web/server/assets/{teams-D6Tx-Jyn.js → teams-Bp2tERZe.js} +2 -2
  96. package/dist/web/server/assets/{teams-OzHTyVi9.js → teams-C-8iz-uV.js} +3 -3
  97. package/dist/web/server/assets/{telegram-BJ4l_TA_.js → telegram-CXrP3hMp.js} +3 -3
  98. package/dist/web/server/assets/{telegram-xU-vXgef.js → telegram-D2RZriz_.js} +2 -2
  99. package/dist/web/server/assets/{tokens-ByPTGFBQ.js → tokens-C-oDTqnp.js} +2 -2
  100. package/dist/web/server/assets/{tokens-CsqoRt5T.js → tokens-DSLwQ1Pw.js} +4 -4
  101. package/dist/web/server/assets/use-resource-ChQozXVI.js +63 -0
  102. package/dist/web/server/assets/welcome-BLw1G6SS.js +318 -0
  103. package/dist/web/server/assets/welcome-ByAkvHSP.js +26 -0
  104. package/dist/web/server/assets/welcome-CxXMI4HI.js +15 -0
  105. package/dist/web/server/server.js +17 -9
  106. package/dist/worker.js +77 -35
  107. package/dist/worker.js.map +1 -1
  108. package/package.json +1 -1
  109. package/dist/web/client/assets/ConfigPage-_FY--9PB.js +0 -1
  110. package/dist/web/client/assets/ConfirmDialog-BblXqMVb.js +0 -1
  111. package/dist/web/client/assets/ConnectionsView-BZHJysCa.js +0 -1
  112. package/dist/web/client/assets/FieldRow-k05wfDy9.js +0 -1
  113. package/dist/web/client/assets/ModelSelect-CvOHjUyB.js +0 -1
  114. package/dist/web/client/assets/SectionTabs-DlfXtepS.js +0 -1
  115. package/dist/web/client/assets/SkillFindings-CHf5ZGY0.js +0 -1
  116. package/dist/web/client/assets/SkillsPicker-Cr87y_W-.js +0 -1
  117. package/dist/web/client/assets/SpawnDialog-C-Ujb4bC.js +0 -1
  118. package/dist/web/client/assets/Tabs-D0LgBNIk.js +0 -1
  119. package/dist/web/client/assets/TeamForm-D6EAAF7m.js +0 -1
  120. package/dist/web/client/assets/TeamThread-DpUOwMoi.js +0 -1
  121. package/dist/web/client/assets/UnsavedChangesGuard-DTUP7hwu.js +0 -1
  122. package/dist/web/client/assets/_id-C94dgBDe.js +0 -1
  123. package/dist/web/client/assets/_id-CxmEfoEp.js +0 -1
  124. package/dist/web/client/assets/agents-C-bJ5R_0.js +0 -1
  125. package/dist/web/client/assets/agents-odqBNx-A.js +0 -1
  126. package/dist/web/client/assets/api-CPzQ_z9m.js +0 -1
  127. package/dist/web/client/assets/arrow-right-Dyta3p06.js +0 -1
  128. package/dist/web/client/assets/attention-D0e7o7fh.js +0 -1
  129. package/dist/web/client/assets/chevron-right-B2YEg9rw.js +0 -1
  130. package/dist/web/client/assets/config-B7Y5MtpM.js +0 -3
  131. package/dist/web/client/assets/createLucideIcon-Cgab8gqu.js +0 -1
  132. package/dist/web/client/assets/index-CNVw44IE.js +0 -54
  133. package/dist/web/client/assets/jsx-runtime-bzQ4Vb5N.js +0 -1
  134. package/dist/web/client/assets/link-ClwtaO_E.js +0 -1
  135. package/dist/web/client/assets/login-Br1F4rQx.js +0 -1
  136. package/dist/web/client/assets/mcp-B8bIAY6k.js +0 -1
  137. package/dist/web/client/assets/routes-BZdlkRdC.js +0 -76
  138. package/dist/web/client/assets/save-ZqeB_I-c.js +0 -1
  139. package/dist/web/client/assets/services-CPJxDrVG.js +0 -1
  140. package/dist/web/client/assets/skills-DE_kQQGj.js +0 -1
  141. package/dist/web/client/assets/style-BWShXY3e.js +0 -7
  142. package/dist/web/client/assets/styles-Tney8jZq.css +0 -2
  143. package/dist/web/client/assets/teams-AcuSLc3I.js +0 -1
  144. package/dist/web/client/assets/teams-tRamPg7O.js +0 -1
  145. package/dist/web/client/assets/telegram-Ku69-GAv.js +0 -1
  146. package/dist/web/client/assets/tokens-DuLNZMgi.js +0 -1
  147. package/dist/web/client/assets/welcome-CrQk6n6I.js +0 -1
  148. package/dist/web/server/assets/_tanstack-start-manifest_v-BVfrV7LQ.js +0 -191
  149. package/dist/web/server/assets/config-3tPtOmPE.js +0 -12
  150. package/dist/web/server/assets/config-DJGZiPBJ.js +0 -798
  151. package/dist/web/server/assets/config-rUqhMjIs.js +0 -25
  152. package/dist/web/server/assets/createSsrRpc-6LHNEsSK.js +0 -16
  153. package/dist/web/server/assets/welcome-O6Rjd7yO.js +0 -93
@@ -1,798 +0,0 @@
1
- import { E as errorMessage, d as Button, w as api } from "./workspace-DeEYMPDX.js";
2
- import { t as ConfirmDialog } from "./ConfirmDialog-CvLZgbfY.js";
3
- import { c as StatusBadge, s as Stat, t as EmptyState } from "./Page-KIL1CsME.js";
4
- import { t as Route } from "./config-3tPtOmPE.js";
5
- import { t as ConfigPage } from "./ConfigPage-DSLM5CLw.js";
6
- import { t as FieldRow } from "./FieldRow-DQBzMtcR.js";
7
- import { useEffect, useMemo, useRef, useState } from "react";
8
- import { useRouter } from "@tanstack/react-router";
9
- import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
10
- import { CheckCircle2, ChevronDown, ChevronRight, Search, Server } from "lucide-react";
11
- //#region src/components/BackupCard.tsx
12
- /** The same archive as `bazilion backup create`, saved by the browser straight from the daemon. */
13
- function BackupCard() {
14
- return /* @__PURE__ */ jsxs("section", {
15
- "aria-label": "Backup",
16
- className: "overflow-hidden rounded-2xl border border-border bg-card shadow-baziu-sm",
17
- children: [/* @__PURE__ */ jsx("header", {
18
- className: "border-b border-border px-4 py-3 sm:px-5",
19
- children: /* @__PURE__ */ jsx("h2", {
20
- className: "text-base font-semibold",
21
- children: "Backup"
22
- })
23
- }), /* @__PURE__ */ jsxs("div", {
24
- className: "flex flex-wrap items-center justify-between gap-3 p-4 text-sm sm:px-5",
25
- children: [/* @__PURE__ */ jsxs("p", {
26
- className: "m-0 max-w-prose text-muted-foreground",
27
- children: [
28
- "A tar.gz of the Bazilion home. It is not encrypted and holds every stored credential; for an encrypted copy run ",
29
- /* @__PURE__ */ jsx("code", { children: "bazilion backup create --recipient <age1…>" }),
30
- ". Restore with ",
31
- /* @__PURE__ */ jsx("code", { children: "bazilion backup restore" }),
32
- " while the daemon is stopped."
33
- ]
34
- }), /* @__PURE__ */ jsx("a", {
35
- href: "/api/backup",
36
- download: true,
37
- className: "btn-primary no-underline",
38
- children: "Download backup"
39
- })]
40
- })]
41
- });
42
- }
43
- //#endregion
44
- //#region src/components/InstallationReadinessCard.tsx
45
- function InstallationReadinessCard({ report }) {
46
- return /* @__PURE__ */ jsxs("section", {
47
- "aria-label": "Installation health",
48
- className: "overflow-hidden rounded-2xl border border-border bg-card shadow-baziu-sm",
49
- children: [/* @__PURE__ */ jsx("header", {
50
- className: "border-b border-border px-4 py-3 sm:px-5",
51
- children: /* @__PURE__ */ jsx("h2", {
52
- className: "text-base font-semibold",
53
- children: "Installation health"
54
- })
55
- }), /* @__PURE__ */ jsxs("dl", {
56
- className: "p-4 sm:px-5",
57
- children: [
58
- /* @__PURE__ */ jsx("dt", {
59
- className: "text-xs text-muted-foreground",
60
- children: "Installation health"
61
- }),
62
- /* @__PURE__ */ jsx("dd", {
63
- className: `mt-1 font-semibold ${report.ok ? "text-success" : "text-warning"}`,
64
- children: report.ok ? "Healthy" : "Issues found"
65
- }),
66
- /* @__PURE__ */ jsx("dd", {
67
- className: "mt-1 text-xs text-muted-foreground",
68
- children: "Run bazilion doctor for the details."
69
- })
70
- ]
71
- })]
72
- });
73
- }
74
- //#endregion
75
- //#region src/components/RuntimeCard.tsx
76
- /** Sandbox and approval apply the same way to every turn: chat, Telegram, schedules and inbox. */
77
- function RuntimeCard({ shell }) {
78
- return /* @__PURE__ */ jsxs("section", {
79
- "aria-label": "Agent runtime",
80
- className: "overflow-hidden rounded-2xl border border-border bg-card shadow-baziu-sm",
81
- children: [/* @__PURE__ */ jsxs("header", {
82
- className: "border-b border-border px-4 py-3 sm:px-5",
83
- children: [/* @__PURE__ */ jsx("h2", {
84
- className: "text-base font-semibold",
85
- children: "Agent runtime"
86
- }), /* @__PURE__ */ jsx("p", {
87
- className: "mt-1 text-xs text-muted-foreground",
88
- children: "Applies to every turn: chat, Telegram, schedules and inbox. Unattended turns auto-deny dangerous commands."
89
- })]
90
- }), shell.ok ? /* @__PURE__ */ jsxs("dl", {
91
- className: "divide-y divide-border px-4 text-sm sm:px-5",
92
- children: [
93
- /* @__PURE__ */ jsx(Row, {
94
- label: "Sandbox",
95
- value: shell.sandboxMode === "docker" ? `Docker (${shell.sandboxImage}) — bash in a network-disabled container` : "Off — bash and file tools run on the host, unisolated"
96
- }),
97
- shell.docker && /* @__PURE__ */ jsx(Row, {
98
- label: "Docker",
99
- value: shell.docker.ready ? "Ready" : `Unavailable — ${shell.docker.reason}`,
100
- ok: shell.docker.ready
101
- }),
102
- shell.docker?.remediation && /* @__PURE__ */ jsx(Row, {
103
- label: "Remediation",
104
- value: shell.docker.remediation
105
- }),
106
- /* @__PURE__ */ jsx(Row, {
107
- label: "Dangerous-command approval",
108
- value: shell.approvalMode === "dangerous" ? "On — chat can allow once; unattended turns auto-deny" : "Off"
109
- })
110
- ]
111
- }) : /* @__PURE__ */ jsxs("p", {
112
- role: "alert",
113
- className: "px-4 py-3 text-sm text-warning sm:px-5",
114
- children: ["Invalid shell-security configuration: ", shell.error]
115
- })]
116
- });
117
- }
118
- function Row({ label, value, ok }) {
119
- return /* @__PURE__ */ jsxs("div", {
120
- className: "grid gap-1 py-3 sm:grid-cols-[14rem_1fr] sm:gap-4",
121
- children: [/* @__PURE__ */ jsx("dt", {
122
- className: "text-muted-foreground",
123
- children: label
124
- }), /* @__PURE__ */ jsx("dd", {
125
- className: ok === void 0 ? "font-medium" : ok ? "text-success" : "text-warning",
126
- children: value
127
- })]
128
- });
129
- }
130
- //#endregion
131
- //#region src/lib/provider-presentation.ts
132
- var RECOMMENDED = new Set([
133
- "openai-codex",
134
- "openai",
135
- "anthropic",
136
- "google"
137
- ]);
138
- var LOCAL = new Set([
139
- "ollama",
140
- "lmstudio",
141
- "llamacpp"
142
- ]);
143
- function providerHasConfiguration(provider) {
144
- return provider.enabled || provider.curated.length > 0 || provider.fields.some((field) => field.set);
145
- }
146
- function providerMatches(provider, query) {
147
- const needle = query.trim().toLocaleLowerCase();
148
- if (!needle) return true;
149
- return [
150
- provider.id,
151
- provider.displayName,
152
- provider.hint ?? "",
153
- ...provider.fields.flatMap((field) => [field.label, field.envVar]),
154
- ...provider.curated,
155
- ...provider.catalog
156
- ].some((value) => value.toLocaleLowerCase().includes(needle));
157
- }
158
- function groupProviders(providers, query = "") {
159
- const visible = providers.filter((provider) => providerMatches(provider, query));
160
- const configured = visible.filter(providerHasConfiguration);
161
- const configuredIds = new Set(configured.map((provider) => provider.id));
162
- const remaining = visible.filter((provider) => !configuredIds.has(provider.id));
163
- return [
164
- {
165
- key: "configured",
166
- title: "Configured",
167
- description: "Providers you enabled, added models to, or saved credentials for.",
168
- providers: configured
169
- },
170
- {
171
- key: "recommended",
172
- title: "Recommended starting points",
173
- description: "The simplest hosted options for a first Bazilion conversation.",
174
- providers: remaining.filter((provider) => RECOMMENDED.has(provider.id))
175
- },
176
- {
177
- key: "local",
178
- title: "Local models",
179
- description: "Use a model server on the same machine without exposing the daemon.",
180
- providers: remaining.filter((provider) => LOCAL.has(provider.id))
181
- },
182
- {
183
- key: "more",
184
- title: "More providers",
185
- description: "Specialist, regional, enterprise, and subscription endpoints.",
186
- providers: remaining.filter((provider) => !RECOMMENDED.has(provider.id) && !LOCAL.has(provider.id))
187
- }
188
- ].filter((section) => section.providers.length > 0);
189
- }
190
- function providerReadiness(provider) {
191
- if (!provider.enabled) return providerHasConfiguration(provider) ? {
192
- label: "Saved, disabled",
193
- tone: "neutral"
194
- } : {
195
- label: "Not configured",
196
- tone: "neutral"
197
- };
198
- if (provider.curated.length === 0) return {
199
- label: "Needs a model",
200
- tone: "warning"
201
- };
202
- return {
203
- label: "Enabled",
204
- tone: "neutral"
205
- };
206
- }
207
- //#endregion
208
- //#region src/routes/config/index.tsx?tsr-split=component
209
- function ProvidersPage() {
210
- const { providers, openaiCodex, runtime, readiness } = Route.useLoaderData();
211
- const setupComplete = providers.some((p) => p.enabled && p.curated.length > 0);
212
- const startedComplete = useRef(setupComplete);
213
- const [showCompletion, setShowCompletion] = useState(false);
214
- const [query, setQuery] = useState("");
215
- const sections = useMemo(() => groupProviders(providers, query), [providers, query]);
216
- const configured = providers.filter(providerHasConfiguration).length;
217
- const enabled = providers.filter((provider) => provider.enabled).length;
218
- useEffect(() => {
219
- if (!startedComplete.current && setupComplete) setShowCompletion(true);
220
- }, [setupComplete]);
221
- return /* @__PURE__ */ jsxs(ConfigPage, {
222
- title: "Providers",
223
- description: /* @__PURE__ */ jsx(Fragment$1, { children: "Connect the model services your agents may use. Credentials stay encrypted; advanced endpoint and environment names remain available inside each provider." }),
224
- children: [
225
- /* @__PURE__ */ jsxs("div", {
226
- className: "grid gap-3 sm:grid-cols-3",
227
- children: [
228
- /* @__PURE__ */ jsx(Stat, {
229
- label: "Configured",
230
- value: configured,
231
- detail: "credentials, models, or toggle"
232
- }),
233
- /* @__PURE__ */ jsx(Stat, {
234
- label: "Enabled",
235
- value: enabled,
236
- detail: "available to agents"
237
- }),
238
- /* @__PURE__ */ jsx(Stat, {
239
- label: "Selected models",
240
- value: providers.reduce((count, provider) => count + (provider.enabled ? provider.curated.length : 0), 0),
241
- detail: "across enabled providers"
242
- })
243
- ]
244
- }),
245
- /* @__PURE__ */ jsx(InstallationReadinessCard, { report: readiness }),
246
- /* @__PURE__ */ jsx(BackupCard, {}),
247
- /* @__PURE__ */ jsx(RuntimeCard, { shell: runtime }),
248
- !setupComplete && /* @__PURE__ */ jsx(SetupBlockerBanner, {
249
- providers,
250
- openaiCodex
251
- }),
252
- showCompletion && /* @__PURE__ */ jsx("section", {
253
- role: "status",
254
- className: "rounded-2xl border border-success/30 bg-success/10 p-5 text-sm",
255
- children: /* @__PURE__ */ jsxs("div", {
256
- className: "flex items-start gap-3",
257
- children: [/* @__PURE__ */ jsx(CheckCircle2, {
258
- className: "mt-0.5 size-5 shrink-0 text-success",
259
- "aria-hidden": "true"
260
- }), /* @__PURE__ */ jsxs("div", {
261
- className: "min-w-0 flex-1",
262
- children: [
263
- /* @__PURE__ */ jsx("h2", {
264
- className: "m-0 font-body text-base font-semibold text-foreground",
265
- children: "Your default workspace is ready"
266
- }),
267
- /* @__PURE__ */ jsx("p", {
268
- className: "mt-1 text-muted-foreground",
269
- children: "Bazilion created the default Agent template and Team. Test the selected model below before relying on it, or continue to spawn your first agent."
270
- }),
271
- /* @__PURE__ */ jsxs("div", {
272
- className: "mt-3 flex flex-wrap gap-2",
273
- children: [/* @__PURE__ */ jsxs("a", {
274
- href: "/agents",
275
- className: "btn-primary no-underline",
276
- children: ["Spawn your first agent", /* @__PURE__ */ jsx(ChevronRight, {
277
- className: "size-4",
278
- "aria-hidden": "true"
279
- })]
280
- }), /* @__PURE__ */ jsx(Button, {
281
- variant: "ghost",
282
- onClick: () => setShowCompletion(false),
283
- children: "Keep configuring"
284
- })]
285
- })
286
- ]
287
- })]
288
- })
289
- }),
290
- /* @__PURE__ */ jsxs("div", {
291
- className: "rounded-2xl border border-border bg-card p-4 shadow-baziu-sm sm:p-5",
292
- children: [
293
- /* @__PURE__ */ jsx("label", {
294
- htmlFor: "provider-search",
295
- className: "m-0 text-sm font-semibold text-foreground",
296
- children: "Find a provider"
297
- }),
298
- /* @__PURE__ */ jsxs("div", {
299
- className: "relative mt-2",
300
- children: [/* @__PURE__ */ jsx(Search, {
301
- className: "pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground",
302
- "aria-hidden": "true"
303
- }), /* @__PURE__ */ jsx("input", {
304
- id: "provider-search",
305
- type: "search",
306
- value: query,
307
- onChange: (event) => setQuery(event.target.value),
308
- placeholder: "Search by service, model, or advanced key",
309
- className: "pl-9"
310
- })]
311
- }),
312
- /* @__PURE__ */ jsx("p", {
313
- className: "mt-2 text-xs leading-5 text-muted-foreground",
314
- children: "Start with one provider. Everything else stays collapsed until you need it."
315
- })
316
- ]
317
- }),
318
- sections.length === 0 ? /* @__PURE__ */ jsx(EmptyState, {
319
- icon: /* @__PURE__ */ jsx(Search, {
320
- className: "size-4",
321
- "aria-hidden": "true"
322
- }),
323
- title: "No providers match",
324
- description: `Try another search instead of “${query}”.`,
325
- actions: /* @__PURE__ */ jsx(Button, {
326
- variant: "ghost",
327
- onClick: () => setQuery(""),
328
- children: "Clear search"
329
- })
330
- }) : /* @__PURE__ */ jsx("div", {
331
- className: "space-y-4",
332
- children: sections.map((section) => /* @__PURE__ */ jsxs("details", {
333
- open: Boolean(query) || section.key === "configured" || !setupComplete && section.key === "recommended",
334
- className: "group/providers overflow-hidden rounded-2xl border border-border bg-card shadow-baziu-sm",
335
- children: [/* @__PURE__ */ jsxs("summary", {
336
- className: "flex cursor-pointer list-none items-center gap-3 px-4 py-4 marker:hidden sm:px-5",
337
- children: [
338
- /* @__PURE__ */ jsx("span", {
339
- className: "flex size-9 shrink-0 items-center justify-center rounded-xl bg-accent text-accent-foreground",
340
- children: /* @__PURE__ */ jsx(Server, {
341
- className: "size-4",
342
- "aria-hidden": "true"
343
- })
344
- }),
345
- /* @__PURE__ */ jsxs("span", {
346
- className: "min-w-0 flex-1",
347
- children: [/* @__PURE__ */ jsx("span", {
348
- className: "block text-sm font-semibold text-foreground",
349
- children: section.title
350
- }), /* @__PURE__ */ jsx("span", {
351
- className: "mt-0.5 block text-xs leading-5 text-muted-foreground",
352
- children: section.description
353
- })]
354
- }),
355
- /* @__PURE__ */ jsx("span", {
356
- className: "rounded-full border border-border bg-muted px-2 py-0.5 text-xs font-semibold text-muted-foreground",
357
- children: section.providers.length
358
- }),
359
- /* @__PURE__ */ jsx(ChevronDown, {
360
- className: "size-4 shrink-0 text-muted-foreground transition-transform group-open/providers:rotate-180",
361
- "aria-hidden": "true"
362
- })
363
- ]
364
- }), /* @__PURE__ */ jsx("div", {
365
- className: "space-y-2 border-t border-border bg-muted/20 p-2 sm:p-3",
366
- children: section.providers.map((provider) => /* @__PURE__ */ jsx(ProviderCard, {
367
- p: provider,
368
- initiallyOpen: provider.enabled || Boolean(query) || !setupComplete && provider.id === "openai-codex",
369
- openaiCodexStatus: provider.id === "openai-codex" ? openaiCodex : void 0
370
- }, provider.id))
371
- })]
372
- }, `${section.key}:${query}`))
373
- })
374
- ]
375
- });
376
- }
377
- function SetupBlockerBanner({ providers, openaiCodex }) {
378
- const issues = [];
379
- for (const p of providers) {
380
- if (!p.enabled) continue;
381
- if (p.id === "openai-codex" && !openaiCodex.connected) issues.push(`${p.id}: enabled but ChatGPT is not connected — click "Connect ChatGPT" below`);
382
- if (p.curated.length === 0) issues.push(`${p.id}: enabled but no curated models — add at least one name in the "curated models" box below and save`);
383
- }
384
- const enabledCount = providers.filter((p) => p.enabled).length;
385
- return /* @__PURE__ */ jsxs("div", {
386
- role: "status",
387
- className: "rounded-2xl border border-warning/30 bg-warning/10 p-5 text-sm",
388
- children: [
389
- /* @__PURE__ */ jsx("div", {
390
- className: "font-semibold text-foreground mb-1",
391
- children: "Finish your first provider"
392
- }),
393
- /* @__PURE__ */ jsx("p", {
394
- className: "text-muted-foreground mb-2",
395
- children: "Enable one provider, save at least one exact model id, then send the small test request. Saving the model creates your default resources; a successful test confirms that the credential and model actually work."
396
- }),
397
- issues.length > 0 ? /* @__PURE__ */ jsx("ul", {
398
- className: "list-disc space-y-1 pl-5 text-warning",
399
- children: issues.map((i) => /* @__PURE__ */ jsx("li", { children: i }, i))
400
- }) : enabledCount === 0 ? /* @__PURE__ */ jsx("p", {
401
- className: "text-warning",
402
- children: "No provider is enabled. Open a recommended option below and follow its steps."
403
- }) : null
404
- ]
405
- });
406
- }
407
- function ProviderCard({ p, openaiCodexStatus, initiallyOpen }) {
408
- const router = useRouter();
409
- const [enabled, setEnabled] = useState(p.enabled);
410
- const [expanded, setExpanded] = useState(initiallyOpen);
411
- const [models, setModels] = useState(p.curated.join("\n"));
412
- const [savingModels, setSavingModels] = useState(false);
413
- const [modelStatus, setModelStatus] = useState(null);
414
- const [toggleError, setToggleError] = useState(null);
415
- const [testModel, setTestModel] = useState(p.curated[0] ?? "");
416
- const [testing, setTesting] = useState(false);
417
- const [testResult, setTestResult] = useState(null);
418
- const readiness = providerReadiness({
419
- ...p,
420
- enabled
421
- });
422
- const providerPath = `/api/config/providers/${encodeURIComponent(p.id)}`;
423
- async function toggle(next) {
424
- setEnabled(next);
425
- setToggleError(null);
426
- try {
427
- await api(`${providerPath}/enabled`, {
428
- method: "PUT",
429
- body: { enabled: next }
430
- });
431
- if (next) setExpanded(true);
432
- await router.invalidate();
433
- } catch (error) {
434
- setEnabled(!next);
435
- setToggleError(errorMessage(error));
436
- }
437
- }
438
- async function saveModels(e) {
439
- e.preventDefault();
440
- setSavingModels(true);
441
- setModelStatus(null);
442
- try {
443
- const list = models.split(/\r?\n/).map((s) => s.trim()).filter(Boolean);
444
- setModelStatus({
445
- kind: "success",
446
- message: ["Models saved.", ...(await api(`${providerPath}/models`, {
447
- method: "PUT",
448
- body: { models: list }
449
- })).movedTemplates.map((t) => `Template ${t.name} now uses ${t.model}.`)].join(" ")
450
- });
451
- setTestModel(list[0] ?? "");
452
- setTestResult(null);
453
- await router.invalidate();
454
- } catch (e) {
455
- setModelStatus({
456
- kind: "error",
457
- message: errorMessage(e)
458
- });
459
- } finally {
460
- setSavingModels(false);
461
- }
462
- }
463
- async function testConnection() {
464
- if (!testModel) return;
465
- setTesting(true);
466
- setTestResult(null);
467
- try {
468
- await api("/api/providers/test", { body: {
469
- model: `${p.id}:${testModel}`,
470
- message: "Reply with exactly: Bazilion connection verified."
471
- } });
472
- setTestResult({
473
- kind: "success",
474
- message: `Verified ${p.displayName} with ${testModel}.`
475
- });
476
- await router.invalidate();
477
- } catch (error) {
478
- setTestResult({
479
- kind: "error",
480
- message: errorMessage(error)
481
- });
482
- } finally {
483
- setTesting(false);
484
- }
485
- }
486
- return /* @__PURE__ */ jsxs("section", {
487
- className: "overflow-hidden rounded-xl border border-border bg-card",
488
- children: [
489
- /* @__PURE__ */ jsxs("header", {
490
- className: "flex min-w-0 flex-wrap items-center gap-2 px-3 py-3 sm:px-4",
491
- children: [
492
- /* @__PURE__ */ jsxs("button", {
493
- type: "button",
494
- className: "unstyled flex min-w-0 flex-1 items-center gap-2 rounded-lg text-left",
495
- "aria-expanded": expanded,
496
- "aria-controls": `provider-${p.id}`,
497
- onClick: () => setExpanded((value) => !value),
498
- children: [/* @__PURE__ */ jsx(ChevronRight, {
499
- className: `size-4 shrink-0 text-muted-foreground transition-transform ${expanded ? "rotate-90" : ""}`,
500
- "aria-hidden": "true"
501
- }), /* @__PURE__ */ jsxs("span", {
502
- className: "min-w-0",
503
- children: [/* @__PURE__ */ jsx("span", {
504
- className: "block truncate text-sm font-semibold text-foreground",
505
- children: p.displayName
506
- }), /* @__PURE__ */ jsx("span", {
507
- className: "block truncate font-mono text-xs text-muted-foreground",
508
- children: p.id
509
- })]
510
- })]
511
- }),
512
- /* @__PURE__ */ jsx(StatusBadge, {
513
- variant: readiness.tone,
514
- children: readiness.label
515
- }),
516
- /* @__PURE__ */ jsxs("label", {
517
- className: "m-0 flex cursor-pointer items-center gap-1.5 rounded-lg px-1 text-xs font-semibold",
518
- children: [/* @__PURE__ */ jsx("input", {
519
- type: "checkbox",
520
- checked: enabled,
521
- onChange: (e) => toggle(e.target.checked),
522
- className: "size-4",
523
- "aria-label": `${enabled ? "Disable" : "Enable"} ${p.displayName}`
524
- }), /* @__PURE__ */ jsx("span", {
525
- className: enabled ? "text-success" : "text-muted-foreground",
526
- children: enabled ? "enabled" : "disabled"
527
- })]
528
- }),
529
- /* @__PURE__ */ jsxs("span", {
530
- className: "w-full pl-6 text-xs text-muted-foreground sm:w-auto sm:pl-0",
531
- children: [
532
- p.curated.length > 0 && /* @__PURE__ */ jsxs("span", { children: [p.curated.length, " curated"] }),
533
- p.catalog.length > 0 && /* @__PURE__ */ jsxs("span", { children: [
534
- " · ",
535
- p.catalog.length,
536
- " catalog"
537
- ] }),
538
- p.live && !p.live.error && /* @__PURE__ */ jsxs("span", { children: [
539
- " · ",
540
- p.live.models.length,
541
- " live"
542
- ] })
543
- ]
544
- })
545
- ]
546
- }),
547
- toggleError && /* @__PURE__ */ jsx("p", {
548
- role: "alert",
549
- className: "mx-4 mb-3 text-sm text-danger",
550
- children: toggleError
551
- }),
552
- expanded && /* @__PURE__ */ jsxs("div", {
553
- id: `provider-${p.id}`,
554
- className: "border-t border-dashed px-3 py-4 sm:px-4",
555
- children: [
556
- p.hint && /* @__PURE__ */ jsx("p", {
557
- className: "text-xs text-muted-foreground mb-2",
558
- children: p.hint
559
- }),
560
- p.id === "openai-codex" && openaiCodexStatus && /* @__PURE__ */ jsx(OpenAICodexCard, { status: openaiCodexStatus }),
561
- p.fields.map((f) => /* @__PURE__ */ jsx(FieldRow, { field: f }, f.envVar)),
562
- /* @__PURE__ */ jsx("h4", {
563
- id: `provider-${p.id}-models-label`,
564
- className: "mt-4 mb-1 font-body text-xs font-semibold uppercase tracking-wide text-muted-foreground",
565
- children: "Models available to agents"
566
- }),
567
- p.curated.length === 0 && /* @__PURE__ */ jsxs("p", {
568
- className: "mb-2 text-xs font-medium text-warning",
569
- children: [
570
- "First-run setup needs at least one model name here — type one (e.g.",
571
- " ",
572
- /* @__PURE__ */ jsx("code", {
573
- className: "font-mono",
574
- children: p.catalog[0] ?? p.live?.models[0] ?? "model-name"
575
- }),
576
- ") and click ",
577
- /* @__PURE__ */ jsx("em", { children: "save models" }),
578
- ". Catalog chips below are the safest source when available."
579
- ]
580
- }),
581
- /* @__PURE__ */ jsxs("form", {
582
- onSubmit: saveModels,
583
- children: [/* @__PURE__ */ jsx("textarea", {
584
- id: `provider-${p.id}-models`,
585
- "aria-labelledby": `provider-${p.id}-models-label`,
586
- value: models,
587
- onChange: (e) => setModels(e.target.value),
588
- rows: Math.max(3, Math.min(8, models.split("\n").length)),
589
- className: "w-full rounded-md border bg-background px-2 py-1.5 font-mono text-sm outline-none focus:ring-2 focus:ring-ring/30",
590
- placeholder: p.catalog.length === 0 && !p.live ? "Type model names one per line, e.g. qwen3-coder-30b" : "Click catalog chips below, or type names one per line"
591
- }), /* @__PURE__ */ jsxs("div", {
592
- className: "flex items-center gap-3 mt-2",
593
- children: [/* @__PURE__ */ jsx("button", {
594
- type: "submit",
595
- disabled: savingModels,
596
- className: "rounded-md bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground disabled:opacity-50",
597
- children: savingModels ? "Saving…" : "Save models"
598
- }), modelStatus && /* @__PURE__ */ jsx("span", {
599
- role: modelStatus.kind === "error" ? "alert" : "status",
600
- className: `text-xs ${modelStatus.kind === "error" ? "text-danger" : "text-success"}`,
601
- children: modelStatus.message
602
- })]
603
- })]
604
- }),
605
- p.catalog.length > 0 && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("h4", {
606
- className: "mt-4 mb-1 text-xs uppercase tracking-wide text-muted-foreground",
607
- children: "catalog"
608
- }), /* @__PURE__ */ jsx(ChipList, {
609
- items: p.catalog,
610
- onPick: (name) => setModels((m) => m.includes(name) ? m : `${m}\n${name}`.trim())
611
- })] }),
612
- p.live && !p.live.error && p.live.models.length > 0 && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("h4", {
613
- className: "mt-4 mb-1 text-xs uppercase tracking-wide text-muted-foreground",
614
- children: "live"
615
- }), /* @__PURE__ */ jsx(ChipList, {
616
- items: p.live.models,
617
- onPick: (name) => setModels((m) => m.includes(name) ? m : `${m}\n${name}`.trim())
618
- })] }),
619
- p.live?.error && /* @__PURE__ */ jsxs("p", {
620
- role: "alert",
621
- className: "text-xs text-danger mt-2",
622
- children: ["Could not fetch live models: ", p.live.error]
623
- }),
624
- enabled && p.curated.length > 0 && /* @__PURE__ */ jsxs("div", {
625
- className: "mt-4 rounded-xl border border-border bg-muted/30 p-3",
626
- children: [
627
- /* @__PURE__ */ jsx("h4", {
628
- className: "m-0 font-body text-sm font-semibold text-foreground",
629
- children: "Test the connection"
630
- }),
631
- /* @__PURE__ */ jsx("p", {
632
- className: "mt-1 text-xs leading-5 text-muted-foreground",
633
- children: "Sends one short real request. Your provider may charge its normal token cost."
634
- }),
635
- /* @__PURE__ */ jsxs("div", {
636
- className: "mt-3 flex flex-col gap-2 sm:flex-row sm:items-end",
637
- children: [/* @__PURE__ */ jsxs("label", {
638
- className: "m-0 min-w-0 flex-1 text-xs font-semibold text-foreground",
639
- children: ["Model", /* @__PURE__ */ jsx("select", {
640
- className: "mt-1",
641
- value: testModel,
642
- onChange: (event) => setTestModel(event.target.value),
643
- children: p.curated.map((model) => /* @__PURE__ */ jsx("option", {
644
- value: model,
645
- children: model
646
- }, model))
647
- })]
648
- }), /* @__PURE__ */ jsx(Button, {
649
- variant: "ghost",
650
- disabled: testing || !testModel,
651
- onClick: () => void testConnection(),
652
- children: testing ? "Testing…" : "Send test request"
653
- })]
654
- }),
655
- testResult && /* @__PURE__ */ jsx("p", {
656
- role: testResult.kind === "error" ? "alert" : "status",
657
- className: `mt-3 rounded-lg px-3 py-2 text-sm ${testResult.kind === "error" ? "bg-danger/10 text-danger" : "bg-success/10 text-success"}`,
658
- children: testResult.message
659
- })
660
- ]
661
- })
662
- ]
663
- })
664
- ]
665
- });
666
- }
667
- function ChipList({ items, onPick }) {
668
- return /* @__PURE__ */ jsx("div", {
669
- className: "flex flex-wrap gap-1.5 max-h-40 overflow-y-auto rounded-md border bg-background p-1.5",
670
- children: items.map((m) => /* @__PURE__ */ jsx("button", {
671
- type: "button",
672
- onClick: () => onPick(m),
673
- "aria-label": `Add ${m} to selected models`,
674
- className: "rounded border bg-card px-2 py-0.5 font-mono text-xs hover:border-primary hover:bg-accent",
675
- children: m
676
- }, m))
677
- });
678
- }
679
- function OpenAICodexCard({ status }) {
680
- const router = useRouter();
681
- const [busy, setBusy] = useState(false);
682
- const [err, setErr] = useState(null);
683
- const [confirmDisconnect, setConfirmDisconnect] = useState(false);
684
- const loginRequest = useRef(null);
685
- useEffect(() => () => {
686
- loginRequest.current?.abort();
687
- }, []);
688
- async function connect() {
689
- loginRequest.current?.abort();
690
- const controller = new AbortController();
691
- loginRequest.current = controller;
692
- setBusy(true);
693
- setErr(null);
694
- try {
695
- await api("/api/auth/openai/login", {
696
- method: "POST",
697
- signal: controller.signal
698
- });
699
- if (controller.signal.aborted) return;
700
- await router.invalidate();
701
- } catch (e) {
702
- if (controller.signal.aborted) return;
703
- setErr(errorMessage(e));
704
- } finally {
705
- if (loginRequest.current === controller) {
706
- loginRequest.current = null;
707
- if (!controller.signal.aborted) setBusy(false);
708
- }
709
- }
710
- }
711
- async function disconnect() {
712
- setBusy(true);
713
- setErr(null);
714
- try {
715
- await api("/api/auth/openai", { method: "DELETE" });
716
- await router.invalidate();
717
- } catch (e) {
718
- setErr(errorMessage(e));
719
- throw e;
720
- } finally {
721
- setBusy(false);
722
- }
723
- }
724
- return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("div", {
725
- className: "rounded-md border bg-muted/30 p-3 mb-3",
726
- children: [status.connected ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("div", {
727
- className: "flex flex-wrap gap-2 items-center mb-2",
728
- children: [
729
- /* @__PURE__ */ jsx("span", {
730
- className: "rounded-full bg-success/10 text-success px-2 py-0.5 text-xs font-semibold uppercase",
731
- children: "connected"
732
- }),
733
- status.accountId && /* @__PURE__ */ jsxs("span", {
734
- className: "text-xs text-muted-foreground",
735
- children: ["account ", /* @__PURE__ */ jsx("code", {
736
- className: "font-mono",
737
- children: status.accountId
738
- })]
739
- }),
740
- status.expiresAt && /* @__PURE__ */ jsxs("span", {
741
- className: "text-xs text-muted-foreground",
742
- children: ["token expires ", new Date(status.expiresAt).toISOString().replace(/\.\d+Z$/, "Z")]
743
- })
744
- ]
745
- }), /* @__PURE__ */ jsx(Button, {
746
- variant: "danger",
747
- onClick: () => setConfirmDisconnect(true),
748
- disabled: busy,
749
- children: "Disconnect ChatGPT"
750
- })] }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("p", {
751
- className: "text-xs text-muted-foreground mb-2",
752
- children: [
753
- "Sign in with your ChatGPT account — the OAuth flow opens a new browser tab. The loopback callback at ",
754
- /* @__PURE__ */ jsx("code", {
755
- className: "font-mono",
756
- children: "localhost:1455"
757
- }),
758
- " only works when you're using the web UI on the same machine as the daemon. For remote setups or callback trouble, run",
759
- " ",
760
- /* @__PURE__ */ jsx("code", {
761
- className: "font-mono",
762
- children: "bazilion auth openai login --device-code"
763
- }),
764
- " on the client. From a source checkout, run",
765
- " ",
766
- /* @__PURE__ */ jsx("code", {
767
- className: "font-mono",
768
- children: "pnpm tsx apps/cli/src/index.ts auth openai login --device-code"
769
- }),
770
- " ",
771
- "from the repository root."
772
- ]
773
- }), /* @__PURE__ */ jsx(Button, {
774
- variant: "primary",
775
- onClick: connect,
776
- disabled: busy,
777
- children: busy ? "opening browser…" : "Connect ChatGPT →"
778
- })] }), err && /* @__PURE__ */ jsx("p", {
779
- role: "alert",
780
- className: "text-sm text-danger mt-2",
781
- children: err
782
- })]
783
- }), /* @__PURE__ */ jsx(ConfirmDialog, {
784
- open: confirmDisconnect,
785
- onOpenChange: setConfirmDisconnect,
786
- title: "Disconnect ChatGPT?",
787
- description: /* @__PURE__ */ jsxs("p", { children: [
788
- "This removes the saved OpenAI Codex OAuth credentials. Agents using an",
789
- " ",
790
- /* @__PURE__ */ jsx("code", { children: "openai-codex" }),
791
- " model will stop working until you connect again."
792
- ] }),
793
- confirmLabel: "Disconnect ChatGPT",
794
- onConfirm: disconnect
795
- })] });
796
- }
797
- //#endregion
798
- export { ProvidersPage as component };