bazilion 0.53.0 → 0.54.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 (177) hide show
  1. package/dist/cli.js +3 -3
  2. package/dist/cli.js.map +1 -1
  3. package/dist/daemon.js +296 -232
  4. package/dist/daemon.js.map +1 -1
  5. package/dist/web/client/assets/AddProviderDialog-CkwSq3C7.js +1 -0
  6. package/dist/web/client/assets/AgentTemplateParts-CEn_4qVs.js +1 -0
  7. package/dist/web/client/assets/Button-UiegBKOK.js +1 -0
  8. package/dist/web/client/assets/{ConfigPage-DiQiJXP6.js → ConfigPage-CUbHBhzx.js} +1 -1
  9. package/dist/web/client/assets/ConfirmDialog-VqBOFZEp.js +1 -0
  10. package/dist/web/client/assets/ConnectionsView-ByARMcWP.js +1 -0
  11. package/dist/web/client/assets/{ManagePage-xlePXXx5.js → ManagePage-BJWZd1ts.js} +1 -1
  12. package/dist/web/client/assets/{SectionTabs-BMiRKFfb.js → SectionTabs-ViZKm3-B.js} +1 -1
  13. package/dist/web/client/assets/{Segmented-Co4n2C5X.js → Segmented-MYKKTuZO.js} +1 -1
  14. package/dist/web/client/assets/SkillsParts-UvNK5SYP.js +1 -0
  15. package/dist/web/client/assets/SpawnTeamModal-DG5UbJNK.js +1 -0
  16. package/dist/web/client/assets/TeamForm-DGlxWv4e.js +1 -0
  17. package/dist/web/client/assets/TeamThread-mkwODO0S.js +1 -0
  18. package/dist/web/client/assets/{UnsavedChangesGuard-DmT4nBQU.js → UnsavedChangesGuard-BmdwLH99.js} +1 -1
  19. package/dist/web/client/assets/_id-CvcxNmBH.js +1 -0
  20. package/dist/web/client/assets/_id-UyBk7gRl.js +1 -0
  21. package/dist/web/client/assets/access-C8d8vaQ6.js +1 -0
  22. package/dist/web/client/assets/agent-actions-BgE9fKHH.js +1 -0
  23. package/dist/web/client/assets/agents-CgtzqBpD.js +1 -0
  24. package/dist/web/client/assets/agents-D7W4BT8r.js +1 -0
  25. package/dist/web/client/assets/arrow-right-D0HKRb7U.js +1 -0
  26. package/dist/web/client/assets/attention-D9mQWoKt.js +1 -0
  27. package/dist/web/client/assets/bot-Bb--PFVU.js +1 -0
  28. package/dist/web/client/assets/chevron-right-bs0TUSl2.js +1 -0
  29. package/dist/web/client/assets/config-Dw6GWf38.js +1 -0
  30. package/dist/web/client/assets/createLucideIcon-DkniuEtD.js +1 -0
  31. package/dist/web/client/assets/{download-Dj-1ltZb.js → download-C4t9l5wR.js} +1 -1
  32. package/dist/web/client/assets/{file-text-DiP-LaEg.js → file-text-DzbjpYrV.js} +1 -1
  33. package/dist/web/client/assets/{images-BKjyhYUc.js → images-DSYgPKM7.js} +1 -1
  34. package/dist/web/client/assets/index-YW0gXPfk.js +14 -0
  35. package/dist/web/client/assets/{key-round-QpqZklz6.js → key-round-BpK4-E3T.js} +1 -1
  36. package/dist/web/client/assets/{list-checks-BeyG5SVQ.js → list-checks-JNXcmws9.js} +1 -1
  37. package/dist/web/client/assets/login-DcQJk5-U.js +1 -0
  38. package/dist/web/client/assets/manage-SRGSx8n2.js +1 -0
  39. package/dist/web/client/assets/mcp-BUWu4TvS.js +1 -0
  40. package/dist/web/client/assets/{message-square-DnpSOYv4.js → message-square-DM2MP9vF.js} +1 -1
  41. package/dist/web/client/assets/{network-BC7rNaOC.js → network-BJ4iPjQO.js} +1 -1
  42. package/dist/web/client/assets/parts-LZxl9Gvc.js +41 -0
  43. package/dist/web/client/assets/plus-CLGNN5QX.js +1 -0
  44. package/dist/web/client/assets/routes-BxIIyGho.js +85 -0
  45. package/dist/web/client/assets/skills-C7DzIwFJ.js +1 -0
  46. package/dist/web/client/assets/{square-terminal-hQZ6pexU.js → square-terminal-Dmm6cV-G.js} +1 -1
  47. package/dist/web/client/assets/style-CA2GAk9b.js +7 -0
  48. package/dist/web/client/assets/styles-C3CDSGAr.css +2 -0
  49. package/dist/web/client/assets/system-zQ0NnQML.js +1 -0
  50. package/dist/web/client/assets/teams-BEIJHObN.js +1 -0
  51. package/dist/web/client/assets/teams-DlOc7Ods.js +1 -0
  52. package/dist/web/client/assets/telegram-DKHq5DpE.js +1 -0
  53. package/dist/web/client/assets/tools-BKIpLaiC.js +1 -0
  54. package/dist/web/client/assets/use-resource-CQaIZbpy.js +1 -0
  55. package/dist/web/client/assets/users-round-BJrym3FG.js +1 -0
  56. package/dist/web/client/assets/welcome-CyS4Hrd-.js +1 -0
  57. package/dist/web/client/assets/wrench-GbE1M1RJ.js +1 -0
  58. package/dist/web/server/assets/{AddProviderDialog-Di5crZUB.js → AddProviderDialog-Nc5mc_P6.js} +7 -10
  59. package/dist/web/server/assets/{AgentTemplateParts-Cqy7kSzx.js → AgentTemplateParts-DZK_r3nQ.js} +3 -6
  60. package/dist/web/server/assets/{ConfigPage-oXM3wyOU.js → ConfigPage-CxzL-gTm.js} +1 -1
  61. package/dist/web/server/assets/{ConfirmDialog-DfaJ--A6.js → ConfirmDialog-4xeCXKHe.js} +1 -2
  62. package/dist/web/server/assets/{ConnectionsView-DZrLoNoW.js → ConnectionsView-B02FjNsM.js} +9 -9
  63. package/dist/web/server/assets/{ManagePage-0LKHEcT_.js → ManagePage-BfCWE8Lj.js} +1 -1
  64. package/dist/web/server/assets/ModelMenu-D-hTgYOO.js +278 -0
  65. package/dist/web/server/assets/{Rail-7JU6ly2O.js → Rail-3gbidhyv.js} +9 -12
  66. package/dist/web/server/assets/SkillsParts-D58l8voo.js +199 -0
  67. package/dist/web/server/assets/SpawnDialog-MJWwppgC.js +1648 -0
  68. package/dist/web/server/assets/{SpawnTeamModal-CCe6P82H.js → SpawnTeamModal-RjzAeX_Q.js} +3 -6
  69. package/dist/web/server/assets/{TeamForm-BzQmdhVi.js → TeamForm-DdOgIMiV.js} +2 -5
  70. package/dist/web/server/assets/{TeamThread-SyQpUvz5.js → TeamThread-D-PvO3fu.js} +9 -9
  71. package/dist/web/server/assets/{UnsavedChangesGuard-DrOvPV14.js → UnsavedChangesGuard-Bb5frygQ.js} +1 -1
  72. package/dist/web/server/assets/{_id-AcyGvFrE.js → _id-BPjVkcNb.js} +10 -14
  73. package/dist/web/server/assets/{_id-DXm9W55C.js → _id-BUfy-GwH.js} +2 -2
  74. package/dist/web/server/assets/{_id-DPGzfmjG.js → _id-C1_l6oSR.js} +9 -11
  75. package/dist/web/server/assets/{_id-BGTgqsWm.js → _id-CHvYQhWt.js} +2 -2
  76. package/dist/web/server/assets/{_id-DojvxRZn.js → _id-De3Bm0SG.js} +1 -1
  77. package/dist/web/server/assets/_tanstack-start-manifest_v-CR3jm1nY.js +256 -0
  78. package/dist/web/server/assets/{access-CKSW7MFH.js → access-CNfvQ3NB.js} +4 -6
  79. package/dist/web/server/assets/{access-BJe-NduL.js → access-Cm_izIIC.js} +2 -2
  80. package/dist/web/server/assets/{agent-actions-CUDMCG0F.js → agent-actions-COnfW5AU.js} +1 -1
  81. package/dist/web/server/assets/{agents-DUI4Yjtg.js → agents-C7UmTjfO.js} +2 -2
  82. package/dist/web/server/assets/{agents-6d9WxbYF.js → agents-CRtMfKqX.js} +1 -1
  83. package/dist/web/server/assets/{agents-DtLDoZ_u.js → agents-D0hfGIMK.js} +6 -8
  84. package/dist/web/server/assets/{agents-DKVGUwD1.js → agents-DQowl6Ly.js} +1 -1
  85. package/dist/web/server/assets/{agents-1sjSvp5p.js → agents-DzpqlIuJ.js} +2 -2
  86. package/dist/web/server/assets/{agents-DsHeRaLq.js → agents-NOkh61dV.js} +6 -10
  87. package/dist/web/server/assets/{attention-johfkM0_.js → attention-CRvxt22X.js} +40 -11
  88. package/dist/web/server/assets/{attention-B6sSDR_4.js → attention-CgWhXjX7.js} +2 -0
  89. package/dist/web/server/assets/{attention-DefKwvgm.js → attention-Cx9ZWPOO.js} +4 -2
  90. package/dist/web/server/assets/{config-DYAaaE9Z.js → config-B5CS8juO.js} +2 -2
  91. package/dist/web/server/assets/{config-Clz57LuN.js → config-D117117T.js} +24 -26
  92. package/dist/web/server/assets/{createSsrRpc-BijMHgqE.js → createSsrRpc-CwTd0zrB.js} +4 -57
  93. package/dist/web/server/assets/{login-VV10kZBl.js → login-IF0Gbsuq.js} +36 -2
  94. package/dist/web/server/assets/{login-JoIjlcmu.js → login-va4EtvA8.js} +34 -45
  95. package/dist/web/server/assets/{manage-Ppyi3Y5y.js → manage-Ce6cI4eW.js} +14 -4
  96. package/dist/web/server/assets/{mcp-DB38leWS.js → mcp-Bm9U6x7N.js} +2 -2
  97. package/dist/web/server/assets/{mcp-Ce6O8Qs2.js → mcp-C96PBxpb.js} +4 -6
  98. package/dist/web/server/assets/page-title-CwcbXMhx.js +95 -0
  99. package/dist/web/server/assets/{router-C97bwlXi.js → router-8Iq19GOz.js} +354 -196
  100. package/dist/web/server/assets/{routes-C4aGqXfr.js → routes-BLo-fWbQ.js} +2680 -1710
  101. package/dist/web/server/assets/{routes-DuOShl4q.js → routes-BXvYYFrN.js} +2 -2
  102. package/dist/web/server/assets/routes-Kwam6JmS.js +89 -0
  103. package/dist/web/server/assets/{skills-B7sg0QKS.js → skills-BqCnA-74.js} +2 -2
  104. package/dist/web/server/assets/skills-DSezIdDc.js +157 -0
  105. package/dist/web/server/assets/{style-BR7ufS6Z.js → style-C2hIPY_Y.js} +1 -1
  106. package/dist/web/server/assets/{system-DaP0ol67.js → system-CcLCmkIC.js} +2 -2
  107. package/dist/web/server/assets/{system-CNQpt3JB.js → system-E0VePdzO.js} +4 -4
  108. package/dist/web/server/assets/{teams-C3xwTz8-.js → teams-CQVV18D3.js} +6 -9
  109. package/dist/web/server/assets/{teams-BKHe67f3.js → teams-CdCmBJIj.js} +7 -9
  110. package/dist/web/server/assets/{teams-CuKE5iAK.js → teams-DScFp8mK.js} +2 -2
  111. package/dist/web/server/assets/{teams-4cEZ4_rw.js → teams-DxA-vnzY.js} +2 -2
  112. package/dist/web/server/assets/{telegram-BpmK-HHV.js → telegram-DJ8s_91Y.js} +7 -9
  113. package/dist/web/server/assets/{telegram-BnQADwnj.js → telegram-DR7xijeS.js} +2 -2
  114. package/dist/web/server/assets/{tools-BQeWn7Tj.js → tools-CsH9DI-4.js} +2 -2
  115. package/dist/web/server/assets/{tools-CURTfG2q.js → tools-V6kezUpL.js} +4 -6
  116. package/dist/web/server/assets/{use-resource-DVzK0toP.js → use-resource-CjcJwn7F.js} +1 -1
  117. package/dist/web/server/assets/{welcome-SNsE49JO.js → welcome-BpmcD-ia.js} +2 -2
  118. package/dist/web/server/assets/{welcome-OiZCAIHZ.js → welcome-Ya8TkL4v.js} +10 -9
  119. package/dist/web/server/server.js +8 -8
  120. package/dist/worker.js +17 -0
  121. package/dist/worker.js.map +1 -1
  122. package/package.json +1 -1
  123. package/dist/web/client/assets/AddProviderDialog-CO_uijWF.js +0 -1
  124. package/dist/web/client/assets/AgentTemplateParts-Dl35c-Ux.js +0 -1
  125. package/dist/web/client/assets/ConfirmDialog-BVytx3kN.js +0 -1
  126. package/dist/web/client/assets/ConnectionsView-DDrBaiLg.js +0 -1
  127. package/dist/web/client/assets/Dialog-BTDzv3J5.js +0 -1
  128. package/dist/web/client/assets/SpawnDialog-ejwXnyxy.js +0 -1
  129. package/dist/web/client/assets/SpawnTeamModal-Cp-nAvIC.js +0 -1
  130. package/dist/web/client/assets/TeamForm-Cz9uDVvb.js +0 -1
  131. package/dist/web/client/assets/TeamThread-D8xqE_gb.js +0 -1
  132. package/dist/web/client/assets/_id-DEQxwq2v.js +0 -1
  133. package/dist/web/client/assets/_id-DSRgpxEc.js +0 -1
  134. package/dist/web/client/assets/access-34_ShgHU.js +0 -1
  135. package/dist/web/client/assets/agent-actions--EO4yJ4Q.js +0 -1
  136. package/dist/web/client/assets/agents-C87yBHaR.js +0 -1
  137. package/dist/web/client/assets/agents-DvCSl1Ro.js +0 -1
  138. package/dist/web/client/assets/api-CoLs57oO.js +0 -1
  139. package/dist/web/client/assets/arrow-right-BhTWtC9z.js +0 -1
  140. package/dist/web/client/assets/attention-CteEeRvX.js +0 -1
  141. package/dist/web/client/assets/chevron-right-BqOIX9UM.js +0 -1
  142. package/dist/web/client/assets/config-XJuQeEP4.js +0 -1
  143. package/dist/web/client/assets/createLucideIcon-dN8ooBD1.js +0 -1
  144. package/dist/web/client/assets/entities-xVoB-p2j.js +0 -1
  145. package/dist/web/client/assets/form-Bvr_f9lR.js +0 -1
  146. package/dist/web/client/assets/index-J_Uqj4md.js +0 -54
  147. package/dist/web/client/assets/login-076Bc601.js +0 -1
  148. package/dist/web/client/assets/manage-CsrV2hhK.js +0 -1
  149. package/dist/web/client/assets/mcp-8N0BqZ0G.js +0 -1
  150. package/dist/web/client/assets/model-facts-DoB6QD5y.js +0 -1
  151. package/dist/web/client/assets/parts-B0JBolvG.js +0 -1
  152. package/dist/web/client/assets/plus-DZ3KVo7E.js +0 -1
  153. package/dist/web/client/assets/routes-3HkZZOOe.js +0 -76
  154. package/dist/web/client/assets/skills-DiaqZRXT.js +0 -1
  155. package/dist/web/client/assets/style-BtcFIkOS.js +0 -7
  156. package/dist/web/client/assets/styles-C7Ztw15K.css +0 -2
  157. package/dist/web/client/assets/system-YWlJ8ogO.js +0 -1
  158. package/dist/web/client/assets/teams-DQwceMvk.js +0 -1
  159. package/dist/web/client/assets/teams-DTC3plIH.js +0 -1
  160. package/dist/web/client/assets/telegram-D4wINntt.js +0 -1
  161. package/dist/web/client/assets/tools-CZeQ9pDx.js +0 -1
  162. package/dist/web/client/assets/use-resource-BaTkTGvG.js +0 -1
  163. package/dist/web/client/assets/welcome-CnxP_RCk.js +0 -1
  164. package/dist/web/client/assets/wrench-BrwBswfo.js +0 -1
  165. package/dist/web/server/assets/Dialog-aup_yJv5.js +0 -85
  166. package/dist/web/server/assets/ModelMenu-BAZeARx6.js +0 -138
  167. package/dist/web/server/assets/SpawnDialog-CYkwzETs.js +0 -124
  168. package/dist/web/server/assets/_tanstack-start-manifest_v-D7RvKGRH.js +0 -285
  169. package/dist/web/server/assets/entities-Dn2xzKIw.js +0 -16
  170. package/dist/web/server/assets/form-BRQAsKKq.js +0 -319
  171. package/dist/web/server/assets/model-facts-mrfrWQne.js +0 -136
  172. package/dist/web/server/assets/parts-mabERIJZ.js +0 -380
  173. package/dist/web/server/assets/routes-IHMVKpDK.js +0 -16
  174. package/dist/web/server/assets/skills-hfTSwqsG.js +0 -353
  175. package/dist/web/server/assets/utils-C_uf36nf.js +0 -8
  176. package/dist/web/server/assets/workspace-DaitCM0t.js +0 -651
  177. /package/dist/web/server/assets/{telegram-CGol0CKX.js → telegram-CGol0CKX2.js} +0 -0
@@ -1,319 +0,0 @@
1
- import { u as Button } from "./workspace-DaitCM0t.js";
2
- import { t as cn } from "./utils-C_uf36nf.js";
3
- import { b as Switch } from "./parts-mabERIJZ.js";
4
- import { useId, useState } from "react";
5
- import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
6
- //#region src/components/ui/form.tsx
7
- var LABEL = "m-0 text-sm font-semibold text-foreground";
8
- var HINT = "mt-1 block text-xs text-muted-foreground";
9
- /** What is wrong with a value, said under its field. */
10
- function Problem({ children }) {
11
- return /* @__PURE__ */ jsx("span", {
12
- role: "alert",
13
- className: "mt-1 block text-xs font-semibold text-warning",
14
- children
15
- });
16
- }
17
- /** A line of text to type: an address, an id, a name. Or a time of day. */
18
- function TextField({ label, value, onChange, type = "text", placeholder, hint, problem, notes, invalid, disabled, required, mono = false, inputMode, className }) {
19
- const id = useId();
20
- return /* @__PURE__ */ jsxs("div", { children: [
21
- /* @__PURE__ */ jsx("label", {
22
- htmlFor: id,
23
- className: LABEL,
24
- children: label
25
- }),
26
- /* @__PURE__ */ jsx("input", {
27
- id,
28
- type,
29
- value,
30
- disabled,
31
- required,
32
- inputMode,
33
- autoComplete: "off",
34
- spellCheck: false,
35
- placeholder: placeholder ?? "",
36
- "aria-invalid": problem || invalid ? true : void 0,
37
- onChange: (event) => onChange(event.target.value),
38
- className: cn("mt-1.5 max-w-xl", mono && "font-mono", className)
39
- }),
40
- hint && /* @__PURE__ */ jsx("span", {
41
- className: HINT,
42
- children: hint
43
- }),
44
- notes,
45
- problem && /* @__PURE__ */ jsx(Problem, { children: problem })
46
- ] });
47
- }
48
- /** A choice between a few options that each need a sentence: radio cards, two abreast. */
49
- function ChoiceCards({ legend, name, value, options, onChange, disabled = false, notes, columns = 2 }) {
50
- const id = useId();
51
- return /* @__PURE__ */ jsxs("fieldset", {
52
- className: "m-0 min-w-0 border-0 p-0",
53
- disabled,
54
- children: [
55
- /* @__PURE__ */ jsx("legend", {
56
- className: "mb-2 p-0 text-sm font-semibold text-foreground",
57
- children: legend
58
- }),
59
- /* @__PURE__ */ jsx("div", {
60
- className: cn("grid gap-2", columns === 3 ? "md:grid-cols-3" : "md:grid-cols-2"),
61
- children: options.map((option, index) => {
62
- const selected = option.value === value;
63
- const titleId = `${id}-${index}`;
64
- return /* @__PURE__ */ jsxs("label", {
65
- className: cn("m-0 flex items-start gap-3 rounded-xl border px-3.5 py-3 transition-colors", disabled ? "cursor-default opacity-70" : "cursor-pointer", selected ? "border-primary/50 bg-accent/40" : "border-border bg-card hover:bg-muted/40"),
66
- children: [/* @__PURE__ */ jsx("input", {
67
- type: "radio",
68
- name,
69
- value: option.value,
70
- checked: selected,
71
- onChange: () => onChange(option.value),
72
- "aria-labelledby": titleId,
73
- "aria-describedby": `${titleId}-about`,
74
- className: "mt-[3px] size-[18px] shrink-0 accent-[var(--color-sapphire)]"
75
- }), /* @__PURE__ */ jsxs("span", {
76
- className: "min-w-0",
77
- children: [/* @__PURE__ */ jsx("span", {
78
- id: titleId,
79
- className: "block text-sm font-semibold text-foreground",
80
- children: option.label
81
- }), /* @__PURE__ */ jsxs("span", {
82
- id: `${titleId}-about`,
83
- className: "block",
84
- children: [option.hint && /* @__PURE__ */ jsx("span", {
85
- className: "block break-words text-sm text-muted-foreground",
86
- children: option.hint
87
- }), selected && option.note && /* @__PURE__ */ jsx("span", {
88
- className: cn("mt-1 block break-words text-sm font-medium", option.note.tone === "ok" ? "text-success" : "text-warning"),
89
- children: option.note.text
90
- })]
91
- })]
92
- })]
93
- }, option.value);
94
- })
95
- }),
96
- notes
97
- ]
98
- });
99
- }
100
- /** One of a few fixed choices, where a line of radio cards would be too much. */
101
- function SelectField({ label, value, options, onChange, hint, disabled, className }) {
102
- const id = useId();
103
- return /* @__PURE__ */ jsxs("div", { children: [
104
- /* @__PURE__ */ jsx("label", {
105
- htmlFor: id,
106
- className: LABEL,
107
- children: label
108
- }),
109
- /* @__PURE__ */ jsx("select", {
110
- id,
111
- value,
112
- disabled,
113
- onChange: (event) => onChange(event.target.value),
114
- className: cn("mt-1.5 max-w-xl", className),
115
- children: options.map((option) => /* @__PURE__ */ jsx("option", {
116
- value: option.value,
117
- children: option.label
118
- }, option.value))
119
- }),
120
- hint && /* @__PURE__ */ jsx("span", {
121
- className: HINT,
122
- children: hint
123
- })
124
- ] });
125
- }
126
- /** A filter in a card's toolbar: a small select named by its label, which is read, not shown. */
127
- function FilterSelect({ label, value, options, onChange }) {
128
- return /* @__PURE__ */ jsx("select", {
129
- "aria-label": label,
130
- value,
131
- onChange: (event) => onChange(event.target.value),
132
- className: "min-h-9 w-auto max-w-full rounded-[12px] py-1 pl-2.5 pr-8 text-xs font-semibold",
133
- children: options.map((option) => /* @__PURE__ */ jsx("option", {
134
- value: option.value,
135
- children: option.label
136
- }, option.value))
137
- });
138
- }
139
- /**
140
- * A key or token. A saved one is never shown or put back into a field: the row says that it is
141
- * saved, and it is replaced or removed from there. Both wait for the form's Save.
142
- */
143
- function SecretField({ label, saved, preview, value, onChange, removed = false, onRemove, open = false, placeholder, hint, notes, disabled }) {
144
- const id = useId();
145
- const [replacing, setReplacing] = useState(false);
146
- const [kept, setKept] = useState(false);
147
- const [moved, setMoved] = useState(null);
148
- const typing = !saved || replacing || open;
149
- return /* @__PURE__ */ jsxs("div", { children: [
150
- /* @__PURE__ */ jsx("label", {
151
- id: `${id}-label`,
152
- htmlFor: typing ? id : void 0,
153
- className: LABEL,
154
- children: label
155
- }),
156
- typing ? /* @__PURE__ */ jsxs("div", {
157
- className: "mt-1.5 flex max-w-xl flex-wrap items-center gap-2",
158
- children: [/* @__PURE__ */ jsx("input", {
159
- id,
160
- type: "password",
161
- value,
162
- disabled,
163
- autoComplete: "off",
164
- spellCheck: false,
165
- placeholder: placeholder ?? "",
166
- autoFocus: replacing,
167
- onChange: (event) => onChange(event.target.value),
168
- className: "min-w-0 flex-1 basis-56 font-mono"
169
- }), saved && !open && /* @__PURE__ */ jsx(Button, {
170
- variant: "ghost",
171
- disabled,
172
- onClick: () => {
173
- onChange("");
174
- setReplacing(false);
175
- setKept(true);
176
- },
177
- children: "Keep the saved one"
178
- })]
179
- }) : /* @__PURE__ */ jsxs("div", {
180
- role: "group",
181
- "aria-labelledby": `${id}-label`,
182
- className: "mt-1.5 flex min-h-[2.65rem] max-w-xl flex-wrap items-center gap-x-3 gap-y-2 rounded-xl border border-border bg-muted/40 px-3.5 py-1.5 text-sm",
183
- children: [/* @__PURE__ */ jsx("span", {
184
- className: "min-w-0 flex-1 basis-40 text-foreground",
185
- children: removed ? "Will be removed when you save." : /* @__PURE__ */ jsxs(Fragment$1, { children: [
186
- "Saved: ",
187
- /* @__PURE__ */ jsx("span", {
188
- className: "font-mono",
189
- children: preview || "•••"
190
- }),
191
- ", stored encrypted"
192
- ] })
193
- }), removed ? /* @__PURE__ */ jsx(Button, {
194
- variant: "ghost",
195
- disabled,
196
- autoFocus: moved === "keep",
197
- onClick: () => {
198
- setMoved("remove");
199
- onRemove?.(false);
200
- },
201
- children: "Keep it"
202
- }) : /* @__PURE__ */ jsxs("span", {
203
- className: "flex gap-2",
204
- children: [/* @__PURE__ */ jsx(Button, {
205
- variant: "ghost",
206
- disabled,
207
- autoFocus: kept,
208
- onClick: () => setReplacing(true),
209
- children: "Replace"
210
- }), onRemove && /* @__PURE__ */ jsx(Button, {
211
- variant: "ghost",
212
- disabled,
213
- autoFocus: moved === "remove",
214
- onClick: () => {
215
- setMoved("keep");
216
- onRemove(true);
217
- },
218
- children: "Remove"
219
- })]
220
- })]
221
- }),
222
- hint && /* @__PURE__ */ jsx("span", {
223
- className: HINT,
224
- children: hint
225
- }),
226
- notes
227
- ] });
228
- }
229
- /** A yes/no setting: what it is on the left, the switch on the right. */
230
- function SwitchRow({ label, description, notes, checked, disabled, onChange }) {
231
- return /* @__PURE__ */ jsxs("div", {
232
- className: "flex items-start justify-between gap-4",
233
- children: [/* @__PURE__ */ jsxs("div", {
234
- className: "min-w-0",
235
- children: [
236
- /* @__PURE__ */ jsx("div", {
237
- className: "text-sm font-semibold text-foreground",
238
- children: label
239
- }),
240
- description && /* @__PURE__ */ jsx("div", {
241
- className: "text-sm text-muted-foreground",
242
- children: description
243
- }),
244
- notes
245
- ]
246
- }), /* @__PURE__ */ jsx(Switch, {
247
- label,
248
- checked,
249
- disabled,
250
- onChange
251
- })]
252
- });
253
- }
254
- /** One of several things to tick. */
255
- function CheckboxRow({ label, checked, disabled, onChange }) {
256
- return /* @__PURE__ */ jsxs("label", {
257
- className: "m-0 flex items-center gap-2.5 text-sm text-foreground",
258
- children: [/* @__PURE__ */ jsx("input", {
259
- type: "checkbox",
260
- checked,
261
- disabled,
262
- onChange: (event) => onChange(event.target.checked),
263
- className: "m-0 size-[18px] shrink-0"
264
- }), label]
265
- });
266
- }
267
- /**
268
- * Where a form stands, in the words every Setup form uses: what was refused, what is not saved
269
- * yet, what was just saved, or else what to know about saving it.
270
- */
271
- function saveStatus({ refused = false, error, dirty, saved, savedText = "Saved.", footnote = "" }) {
272
- if (refused) return {
273
- text: "Nothing was saved: see above.",
274
- tone: "warning"
275
- };
276
- if (error) return {
277
- text: `Nothing was saved: ${error}`,
278
- tone: "warning"
279
- };
280
- if (dirty) return {
281
- text: "Not saved yet.",
282
- tone: "warning"
283
- };
284
- if (saved) return {
285
- text: savedText,
286
- tone: "success"
287
- };
288
- return {
289
- text: footnote,
290
- tone: "neutral"
291
- };
292
- }
293
- var STATUS = {
294
- success: "text-success",
295
- warning: "text-warning",
296
- neutral: "text-muted-foreground"
297
- };
298
- /** A form's last line: Save, and where things stand. */
299
- function SaveBar({ busy, disabled, status, label = "Save", busyLabel = "Saving…", extra }) {
300
- return /* @__PURE__ */ jsxs("div", {
301
- className: "flex flex-wrap items-center gap-x-4 gap-y-2",
302
- children: [
303
- /* @__PURE__ */ jsx(Button, {
304
- variant: "primary",
305
- type: "submit",
306
- disabled: disabled || busy,
307
- children: busy ? busyLabel : label
308
- }),
309
- extra,
310
- /* @__PURE__ */ jsx("p", {
311
- role: "status",
312
- className: cn("m-0 min-w-0 flex-1 basis-56 text-sm font-medium", STATUS[status.tone]),
313
- children: status.text
314
- })
315
- ]
316
- });
317
- }
318
- //#endregion
319
- export { SaveBar as a, SwitchRow as c, Problem as i, TextField as l, ChoiceCards as n, SecretField as o, FilterSelect as r, SelectField as s, CheckboxRow as t, saveStatus as u };
@@ -1,136 +0,0 @@
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 };