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
@@ -0,0 +1,278 @@
1
+ import { useId } from "react";
2
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
3
+ import { Check, ChevronDown } from "lucide-react";
4
+ import { Select } from "radix-ui";
5
+ import { clsx } from "clsx";
6
+ import { twMerge } from "tailwind-merge";
7
+ //#region src/lib/utils.ts
8
+ function cn(...inputs) {
9
+ return twMerge(clsx(inputs));
10
+ }
11
+ //#endregion
12
+ //#region src/lib/model-facts.ts
13
+ function modelName(model) {
14
+ return model.name ?? model.id;
15
+ }
16
+ /** A context window in the units people say: `1M`, `272K`. */
17
+ function formatContext(tokens) {
18
+ if (!tokens || tokens <= 0) return null;
19
+ if (tokens >= 1e6) return `${(tokens / 1e6).toFixed(1).replace(/\.0$/, "")}M`;
20
+ return `${Math.round(tokens / 1e3)}K`;
21
+ }
22
+ /** A dollar amount with cents, and the third decimal only when it carries something. */
23
+ function formatUsd(value) {
24
+ if (Number.isInteger(value)) return `$${value}`;
25
+ const fixed = value.toFixed(3);
26
+ return `$${fixed.endsWith("0") ? fixed.slice(0, -1) : fixed}`;
27
+ }
28
+ /** What a model can do, in one line. A model the catalog does not know has nothing to say. */
29
+ function factsLine(model, connect) {
30
+ const context = formatContext(model.contextWindow);
31
+ if (!model.name && !context) return connect === "local" ? "Loaded on the server" : "Not in the bundled catalog";
32
+ return [
33
+ context ? `${context} context` : null,
34
+ model.images ? "sees images" : "text only",
35
+ model.reasoning ? "reasoning" : null
36
+ ].filter(Boolean).join(" · ");
37
+ }
38
+ /** What a model costs: the list price per million tokens, or who pays instead. */
39
+ function priceLine(model, connect) {
40
+ if (connect === "signin") return "Included in your plan";
41
+ if (connect === "local") return "Runs on your hardware";
42
+ if (!model.price) return "No list price";
43
+ return `${formatUsd(model.price.input)} in · ${formatUsd(model.price.output)} out`;
44
+ }
45
+ function usedByLine(usedBy) {
46
+ const parts = [...usedBy.templates.map((name) => `${name} template`), usedBy.agents === 1 ? "1 Agent" : usedBy.agents > 1 ? `${usedBy.agents} Agents` : null].filter(Boolean);
47
+ return parts.length > 0 ? parts.join(", ") : "Not used yet";
48
+ }
49
+ /** The two facts that matter when choosing a model: how much it reads, whether it sees images. */
50
+ function menuFacts(model) {
51
+ const context = formatContext(model.contextWindow);
52
+ if (!context) return model.providerConnect === "local" ? "on this computer" : "";
53
+ return `${context} · ${model.images ? "sees images" : "text only"}`;
54
+ }
55
+ /** Chat models by provider, in the order the Models page lists them. */
56
+ function menuGroups(models) {
57
+ const groups = /* @__PURE__ */ new Map();
58
+ for (const model of models) {
59
+ const group = groups.get(model.provider) ?? {
60
+ provider: model.provider,
61
+ name: model.providerName,
62
+ trouble: model.providerState === "failing" || model.providerState === "incomplete" ? "not working" : null,
63
+ models: []
64
+ };
65
+ group.models.push(model);
66
+ groups.set(model.provider, group);
67
+ }
68
+ return [...groups.values()];
69
+ }
70
+ /** Whether a model matches what was typed: every word, in its name or id. */
71
+ function matchesModel(model, query) {
72
+ const haystack = `${model.name ?? ""} ${model.id}`.toLowerCase();
73
+ return query.toLowerCase().split(/\s+/).filter(Boolean).every((word) => haystack.includes(word));
74
+ }
75
+ /** "2 minutes ago", for something that happened at `at`. */
76
+ function ago(at, now) {
77
+ const seconds = Math.max(0, Math.round((now - at) / 1e3));
78
+ if (seconds < 45) return "just now";
79
+ const minutes = Math.round(seconds / 60);
80
+ if (minutes < 60) return minutes === 1 ? "1 minute ago" : `${minutes} minutes ago`;
81
+ const hours = Math.round(minutes / 60);
82
+ if (hours < 24) return hours === 1 ? "1 hour ago" : `${hours} hours ago`;
83
+ const days = Math.round(hours / 24);
84
+ if (days < 30) return days === 1 ? "yesterday" : `${days} days ago`;
85
+ return `on ${new Date(at).toISOString().slice(0, 10)}`;
86
+ }
87
+ var FAILURE_LABEL = {
88
+ credentials: "Key rejected",
89
+ unreachable: "Not answering",
90
+ model: "Model unavailable",
91
+ limit: "Limit reached",
92
+ other: "Failing"
93
+ };
94
+ /** A provider's state as a chip: a few words and how loud they are. */
95
+ function providerStatus(provider, now) {
96
+ switch (provider.state) {
97
+ case "working": return {
98
+ label: provider.check ? `Working · tested ${ago(provider.check.at, now)}` : "Working",
99
+ tone: "success"
100
+ };
101
+ case "failing": {
102
+ const kind = provider.check?.failure?.kind ?? "other";
103
+ const label = kind === "credentials" && provider.connect === "signin" ? "Sign-in rejected" : FAILURE_LABEL[kind];
104
+ return {
105
+ label: provider.check ? `${label} · tried ${ago(provider.check.at, now)}` : label,
106
+ tone: "warning"
107
+ };
108
+ }
109
+ case "incomplete": return {
110
+ label: provider.connect === "signin" ? "Not signed in" : provider.fields.some((field) => field.kind === "secret") ? "Needs a key" : "Needs credentials",
111
+ tone: "warning"
112
+ };
113
+ case "off": return {
114
+ label: provider.models.length === 0 ? "Saved, not in use" : "Turned off",
115
+ tone: "neutral"
116
+ };
117
+ default: return {
118
+ label: "Not tested yet",
119
+ tone: "neutral"
120
+ };
121
+ }
122
+ }
123
+ /** How a provider is connected, in a few words, for its row. */
124
+ function credentialLine(provider) {
125
+ if (provider.connect === "signin") return provider.configured ? "Signed in with your ChatGPT account" : "Not signed in";
126
+ if (provider.connect === "local") return provider.address ?? "A model server on this network";
127
+ const key = provider.fields.find((field) => field.kind === "secret" && field.set);
128
+ if (key) return `${key.label} ${key.preview ?? "saved"}`;
129
+ if (provider.configured) return "Credentials from the daemon’s environment";
130
+ return "No credentials saved";
131
+ }
132
+ /** The models to ask first: suggested ones, then the ones already in use. */
133
+ function initialPicks(models) {
134
+ const selected = models.filter((model) => model.selected).map((model) => model.id);
135
+ if (selected.length > 0) return selected;
136
+ return models.filter((model) => model.suggested).map((model) => model.id);
137
+ }
138
+ /** The cheapest of the given models by list price; unpriced ones come last, in order. */
139
+ function cheapest(models) {
140
+ const cost = (model) => model.price ? model.price.input + model.price.output : Number.POSITIVE_INFINITY;
141
+ return models.map((model, index) => ({
142
+ model,
143
+ index
144
+ })).sort((a, b) => cost(a.model) - cost(b.model) || a.index - b.index)[0]?.model;
145
+ }
146
+ //#endregion
147
+ //#region src/components/ModelMenu.tsx
148
+ /** The Models overview, whose `chat` list the menu shows. */
149
+ var MODELS_PATH = "/api/config/models";
150
+ var INHERITED = ":inherited";
151
+ var ITEM = "relative flex cursor-pointer select-none items-baseline gap-x-3 rounded-lg py-2 pl-8 pr-3 text-sm outline-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground";
152
+ function ModelMenu({ label, value, onChange, models, inherited, required, disabled = false, kit = false }) {
153
+ const id = useId();
154
+ const find = (candidate) => models.find((model) => model.value === candidate);
155
+ const named = (candidate) => {
156
+ const model = find(candidate);
157
+ return model ? modelName(model) : candidate;
158
+ };
159
+ const chosen = find(value);
160
+ const unlisted = value !== "" && !chosen;
161
+ const groups = menuGroups(models);
162
+ const empty = models.length === 0 && !inherited;
163
+ return /* @__PURE__ */ jsxs("div", {
164
+ className: kit ? "min-w-0" : "my-[0.6rem]",
165
+ children: [/* @__PURE__ */ jsx("span", {
166
+ id: `${id}-label`,
167
+ className: kit ? "mb-1.5 block text-sm font-semibold text-foreground" : "block text-[0.9em] text-mocha",
168
+ children: label
169
+ }), /* @__PURE__ */ jsxs(Select.Root, {
170
+ value: value === "" ? inherited ? INHERITED : "" : value,
171
+ onValueChange: (next) => onChange(next === INHERITED ? "" : next),
172
+ required,
173
+ disabled: empty || disabled,
174
+ children: [/* @__PURE__ */ jsxs(Select.Trigger, {
175
+ "aria-labelledby": `${id}-label ${id}-value`,
176
+ className: "flex min-h-[2.65rem] w-full items-center justify-between gap-2 rounded-[var(--radius-md)] border border-frost bg-[color-mix(in_srgb,var(--color-snow)_82%,var(--color-ivory))] px-[0.8rem] py-[0.5rem] text-left text-[0.95em] text-chocolate transition-all focus-visible:border-sapphire focus-visible:bg-snow focus-visible:shadow-[0_0_0_3px_var(--color-sapphire-glow)] disabled:opacity-60 data-[state=open]:border-sapphire",
177
+ style: { outline: "none" },
178
+ children: [/* @__PURE__ */ jsx("span", {
179
+ id: `${id}-value`,
180
+ className: "min-w-0 flex-1 truncate",
181
+ children: value === "" ? inherited ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
182
+ inherited.model ? named(inherited.model) : inherited.label,
183
+ " ",
184
+ inherited.model && /* @__PURE__ */ jsx("span", {
185
+ className: "ml-1 text-[0.9em] text-mocha-light",
186
+ children: inherited.label.toLowerCase()
187
+ })
188
+ ] }) : /* @__PURE__ */ jsx("span", {
189
+ className: "text-mocha-light",
190
+ children: empty ? "No chat model yet" : "Pick a model"
191
+ }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [
192
+ named(value),
193
+ " ",
194
+ /* @__PURE__ */ jsx("span", {
195
+ className: "ml-1 text-[0.9em] text-mocha-light",
196
+ children: chosen ? chosen.providerName : "not in Chat"
197
+ })
198
+ ] })
199
+ }), /* @__PURE__ */ jsx(Select.Icon, {
200
+ asChild: true,
201
+ children: /* @__PURE__ */ jsx(ChevronDown, {
202
+ className: "size-4 shrink-0 text-mocha-light",
203
+ "aria-hidden": "true"
204
+ })
205
+ })]
206
+ }), /* @__PURE__ */ jsx(Select.Portal, { children: /* @__PURE__ */ jsxs(Select.Content, {
207
+ position: "popper",
208
+ sideOffset: 6,
209
+ className: "z-50 max-h-[min(26rem,var(--radix-select-content-available-height))] w-[max(var(--radix-select-trigger-width),18rem)] max-w-[calc(100vw-1.5rem)] overflow-hidden rounded-xl border border-border bg-popover text-popover-foreground shadow-baziu-lg",
210
+ children: [/* @__PURE__ */ jsxs(Select.Viewport, {
211
+ className: "p-1.5",
212
+ children: [
213
+ inherited && /* @__PURE__ */ jsx(Option, {
214
+ value: INHERITED,
215
+ name: inherited.label,
216
+ children: inherited.model ? named(inherited.model) : ""
217
+ }),
218
+ unlisted && /* @__PURE__ */ jsx(Option, {
219
+ value,
220
+ name: value,
221
+ mono: true,
222
+ children: "not in Chat"
223
+ }),
224
+ groups.map((group) => /* @__PURE__ */ jsxs(Select.Group, { children: [/* @__PURE__ */ jsxs(Select.Label, {
225
+ className: "flex items-baseline gap-2 px-3 pb-1 pt-2.5 text-xs font-bold uppercase tracking-[0.08em] text-muted-foreground",
226
+ children: [group.name, group.trouble && /* @__PURE__ */ jsx("span", {
227
+ className: "font-semibold normal-case tracking-normal text-warning",
228
+ children: group.trouble
229
+ })]
230
+ }), group.models.map((model) => /* @__PURE__ */ jsx(Option, {
231
+ value: model.value,
232
+ name: modelName(model),
233
+ mono: !model.name,
234
+ children: menuFacts(model)
235
+ }, model.value))] }, group.provider)),
236
+ models.length === 0 && /* @__PURE__ */ jsx("p", {
237
+ className: "m-0 px-3 py-2 text-sm text-muted-foreground",
238
+ children: "No chat model is in use yet."
239
+ })
240
+ ]
241
+ }), /* @__PURE__ */ jsx("a", {
242
+ href: "/config?pick=true",
243
+ className: "block border-t border-border px-4 py-2.5 text-sm font-semibold text-primary hover:bg-muted/50",
244
+ children: "Add models in Setup"
245
+ })]
246
+ }) })]
247
+ })]
248
+ });
249
+ }
250
+ function Option({ value, name, mono = false, children }) {
251
+ return /* @__PURE__ */ jsxs(Select.Item, {
252
+ value,
253
+ className: ITEM,
254
+ style: { outline: "none" },
255
+ children: [
256
+ /* @__PURE__ */ jsx(Select.ItemIndicator, {
257
+ className: "absolute left-2.5 top-1/2 -translate-y-1/2",
258
+ children: /* @__PURE__ */ jsx(Check, {
259
+ className: "size-4 text-primary",
260
+ "aria-hidden": "true"
261
+ })
262
+ }),
263
+ /* @__PURE__ */ jsx(Select.ItemText, {
264
+ asChild: true,
265
+ children: /* @__PURE__ */ jsx("span", {
266
+ className: cn("min-w-0 flex-1 break-words", mono ? "font-mono text-[0.85em] font-medium" : "font-semibold"),
267
+ children: name
268
+ })
269
+ }),
270
+ children && /* @__PURE__ */ jsx("span", {
271
+ className: "shrink-0 text-xs text-muted-foreground",
272
+ children
273
+ })
274
+ ]
275
+ });
276
+ }
277
+ //#endregion
278
+ export { credentialLine as a, matchesModel as c, providerStatus as d, usedByLine as f, cheapest as i, modelName as l, ModelMenu as n, factsLine as o, cn as p, ago as r, initialPicks as s, MODELS_PATH as t, priceLine as u };
@@ -1,12 +1,9 @@
1
- import { T as errorMessage, d as AgentAvatar, g as useActivity, h as teamSummary, m as shortTime, u as Button } from "./workspace-DaitCM0t.js";
2
- import { n as DEFAULT_TEAM_ID, t as DEFAULT_PROFILE_ID } from "./entities-Dn2xzKIw.js";
3
- import { t as useHydrated } from "./use-resource-DVzK0toP.js";
4
- import { n as DialogActions, t as Dialog$1 } from "./Dialog-aup_yJv5.js";
5
- import { t as ConfirmDialog } from "./ConfirmDialog-DfaJ--A6.js";
6
- import { r as renameAgent, t as archiveAgent } from "./agent-actions-CUDMCG0F.js";
7
- import { t as SpawnDialog } from "./SpawnDialog-CYkwzETs.js";
8
- import { t as SpawnTeamModal } from "./SpawnTeamModal-CCe6P82H.js";
9
- import { t as TeamForm } from "./TeamForm-BzQmdhVi.js";
1
+ import { G as DialogActions, J as DEFAULT_PROFILE_ID, K as Button, W as Dialog$1, Y as DEFAULT_TEAM_ID, dt as errorMessage, et as shortTime, nt as useActivity, q as AgentAvatar, t as SpawnDialog, tt as teamSummary } from "./SpawnDialog-MJWwppgC.js";
2
+ import { t as useHydrated } from "./use-resource-CjcJwn7F.js";
3
+ import { t as ConfirmDialog } from "./ConfirmDialog-4xeCXKHe.js";
4
+ import { r as renameAgent, t as archiveAgent } from "./agent-actions-COnfW5AU.js";
5
+ import { t as SpawnTeamModal } from "./SpawnTeamModal-RjzAeX_Q.js";
6
+ import { t as TeamForm } from "./TeamForm-DdOgIMiV.js";
10
7
  import { createContext, useContext, useMemo, useRef, useState } from "react";
11
8
  import { Link, useRouter } from "@tanstack/react-router";
12
9
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -421,7 +418,7 @@ function AgentRow({ agent, selected, state, lastActivityAt, panel, onRename, onA
421
418
  }),
422
419
  hydrated && lastActivityAt !== null && /* @__PURE__ */ jsx("time", {
423
420
  dateTime: new Date(lastActivityAt).toISOString(),
424
- className: "ml-auto shrink-0 text-[0.7rem] font-normal text-muted-foreground",
421
+ className: "ml-auto shrink-0 text-xs font-normal text-muted-foreground",
425
422
  children: shortTime(lastActivityAt)
426
423
  })
427
424
  ]
@@ -519,7 +516,7 @@ function SlimRail() {
519
516
  children: [
520
517
  /* @__PURE__ */ jsx("div", { className: "h-px w-8 bg-border" }),
521
518
  /* @__PURE__ */ jsx("span", {
522
- className: `max-w-14 truncate text-[0.65rem] font-bold uppercase tracking-[0.06em] ${team.id === inView?.id ? "text-accent-foreground" : "text-muted-foreground"}`,
519
+ className: `max-w-14 truncate text-xs font-bold uppercase tracking-[0.06em] ${team.id === inView?.id ? "text-accent-foreground" : "text-muted-foreground"}`,
523
520
  title: team.name,
524
521
  children: team.name
525
522
  }),
@@ -605,4 +602,4 @@ function RenameAgentDialog({ agent, onClose, onRenamed }) {
605
602
  });
606
603
  }
607
604
  //#endregion
608
- export { SlimRail as a, useWorkspaceOptional as c, STATE_DOT as i, RenameAgentDialog as n, WorkspaceProvider as o, SIDEBAR_OPEN_GROUPS_COOKIE as r, useWorkspace as s, Rail as t };
605
+ export { STATE_TEXT as a, useWorkspace as c, STATE_DOT as i, useWorkspaceOptional as l, RenameAgentDialog as n, SlimRail as o, SIDEBAR_OPEN_GROUPS_COOKIE as r, WorkspaceProvider as s, Rail as t };
@@ -0,0 +1,199 @@
1
+ import { G as DialogActions, K as Button, W as Dialog, ct as ApiError, dt as errorMessage, f as TextField, k as Notice, lt as api, n as CheckboxRow, r as ChoiceCards } from "./SpawnDialog-MJWwppgC.js";
2
+ import { p as cn } from "./ModelMenu-D-hTgYOO.js";
3
+ import { s as count } from "./manage-Ce6cI4eW.js";
4
+ import { useState } from "react";
5
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
6
+ //#region src/components/manage/SkillsParts.tsx
7
+ /** A scan's findings, one to a line: what it found, and where. */
8
+ function FindingLines({ findings }) {
9
+ return /* @__PURE__ */ jsx("ul", {
10
+ className: "m-0 mt-1 grid list-none gap-1 p-0",
11
+ children: findings.map((finding, index) => /* @__PURE__ */ jsxs("li", {
12
+ className: "min-w-0",
13
+ children: [
14
+ /* @__PURE__ */ jsxs("span", {
15
+ className: finding.severity === "danger" ? "font-semibold" : "",
16
+ children: [finding.severity === "danger" ? "Risky" : "Check", ":"]
17
+ }),
18
+ " ",
19
+ finding.message,
20
+ " ",
21
+ /* @__PURE__ */ jsxs("span", {
22
+ className: "text-muted-foreground",
23
+ children: [
24
+ "(",
25
+ finding.code,
26
+ finding.line ? `, line ${finding.line}` : "",
27
+ ")"
28
+ ]
29
+ })
30
+ ]
31
+ }, index))
32
+ });
33
+ }
34
+ /** What the scan found in one skill, or in what was imported. */
35
+ function FindingsNotice({ findings, title }) {
36
+ const danger = findings.some((finding) => finding.severity === "danger");
37
+ return /* @__PURE__ */ jsx(Notice, {
38
+ tone: danger ? "warning" : "neutral",
39
+ title: title ?? (danger ? "Read it before an Agent uses it: its text goes into the system prompt." : "Worth a look."),
40
+ children: /* @__PURE__ */ jsx(FindingLines, { findings })
41
+ });
42
+ }
43
+ var SOURCES = [
44
+ {
45
+ value: "openclaw",
46
+ label: "OpenClaw",
47
+ hint: "Every skill in ~/.openclaw/skills on the computer Bazilion runs on."
48
+ },
49
+ {
50
+ value: "path",
51
+ label: "A folder",
52
+ hint: "One skill folder with a SKILL.md, or a folder of them, on that computer."
53
+ },
54
+ {
55
+ value: "zip",
56
+ label: "A ZIP file",
57
+ hint: "Uploaded from here: one folder per skill at its top level."
58
+ }
59
+ ];
60
+ /** Import skills from OpenClaw, a folder or a ZIP file; the scan's findings are shown here. */
61
+ function ImportSkillsDialog({ onClose, onImported }) {
62
+ const [source, setSource] = useState("openclaw");
63
+ const [path, setPath] = useState("");
64
+ const [zip, setZip] = useState(null);
65
+ const [dragOver, setDragOver] = useState(false);
66
+ const [force, setForce] = useState(false);
67
+ const [busy, setBusy] = useState(false);
68
+ const [error, setError] = useState(null);
69
+ const [findings, setFindings] = useState([]);
70
+ const pathProblem = source === "path" && path.trim() && !path.trim().startsWith("/") ? "The full path of the folder, starting with /." : void 0;
71
+ const ready = source === "openclaw" || source === "path" && path.trim() !== "" && !pathProblem || source === "zip" && zip !== null;
72
+ function chooseZip(file) {
73
+ if (!file) return;
74
+ setError(null);
75
+ if (!/\.zip$/i.test(file.name)) {
76
+ setError("Only ZIP archives can be imported.");
77
+ return;
78
+ }
79
+ setZip(file);
80
+ }
81
+ async function submit(event) {
82
+ event.preventDefault();
83
+ if (!ready || busy) return;
84
+ setBusy(true);
85
+ setError(null);
86
+ setFindings([]);
87
+ let body;
88
+ if (source === "zip" && zip) {
89
+ const form = new FormData();
90
+ form.set("file", zip);
91
+ if (force) form.set("force", "true");
92
+ body = form;
93
+ } else body = {
94
+ source: source === "openclaw" ? "openclaw" : path.trim(),
95
+ force
96
+ };
97
+ try {
98
+ await onImported(await api("/api/skills/import", { body }));
99
+ } catch (cause) {
100
+ if (cause instanceof ApiError) setFindings(cause.body?.findings ?? []);
101
+ setError(errorMessage(cause));
102
+ setBusy(false);
103
+ }
104
+ }
105
+ return /* @__PURE__ */ jsx(Dialog, {
106
+ title: "Import skills",
107
+ description: "A skill's SKILL.md is added to the system prompt of every Agent it is attached to. Each one is scanned before it is installed.",
108
+ busy,
109
+ onClose,
110
+ className: "max-w-2xl",
111
+ children: /* @__PURE__ */ jsxs("form", {
112
+ onSubmit: (event) => void submit(event),
113
+ className: "grid gap-4",
114
+ children: [
115
+ /* @__PURE__ */ jsx(ChoiceCards, {
116
+ legend: "From",
117
+ name: "skills-source",
118
+ value: source,
119
+ options: SOURCES,
120
+ columns: 3,
121
+ disabled: busy,
122
+ onChange: (next) => {
123
+ setSource(next);
124
+ setError(null);
125
+ setFindings([]);
126
+ }
127
+ }),
128
+ source === "path" && /* @__PURE__ */ jsx(TextField, {
129
+ label: "Folder",
130
+ value: path,
131
+ disabled: busy,
132
+ placeholder: "/home/you/my-skills",
133
+ mono: true,
134
+ className: "max-w-none",
135
+ problem: pathProblem,
136
+ onChange: setPath
137
+ }),
138
+ source === "zip" && /* @__PURE__ */ jsxs("label", {
139
+ onDragOver: (event) => {
140
+ event.preventDefault();
141
+ setDragOver(true);
142
+ },
143
+ onDragLeave: () => setDragOver(false),
144
+ onDrop: (event) => {
145
+ event.preventDefault();
146
+ setDragOver(false);
147
+ chooseZip(event.dataTransfer.files[0]);
148
+ },
149
+ className: cn("relative m-0 block cursor-pointer rounded-xl border-2 border-dashed px-6 py-7 text-center text-sm transition-colors", dragOver ? "border-primary bg-accent text-accent-foreground" : zip ? "border-solid border-primary/40 bg-card text-foreground" : "border-border bg-muted/30 text-muted-foreground hover:border-primary hover:bg-accent/60"),
150
+ children: [/* @__PURE__ */ jsx("input", {
151
+ type: "file",
152
+ accept: ".zip,application/zip",
153
+ disabled: busy,
154
+ onChange: (event) => chooseZip(event.target.files?.[0]),
155
+ className: "absolute h-px w-px overflow-hidden opacity-0"
156
+ }), zip ? /* @__PURE__ */ jsx("span", {
157
+ className: "block break-all font-mono text-foreground",
158
+ children: zip.name
159
+ }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
160
+ className: "block font-semibold text-foreground",
161
+ children: "Choose a ZIP file"
162
+ }), /* @__PURE__ */ jsx("span", {
163
+ className: "text-xs",
164
+ children: "or drop it here"
165
+ })] })]
166
+ }),
167
+ /* @__PURE__ */ jsx(CheckboxRow, {
168
+ checked: force,
169
+ disabled: busy,
170
+ label: "Replace skills that are already installed, and import despite scan findings",
171
+ onChange: setForce
172
+ }),
173
+ findings.length > 0 && /* @__PURE__ */ jsx(FindingsNotice, {
174
+ findings,
175
+ title: `The scan found ${count(findings.length, "thing")} to check. Read them; to import anyway, tick the box above.`
176
+ }),
177
+ error && findings.length === 0 && /* @__PURE__ */ jsx(Notice, {
178
+ tone: "warning",
179
+ role: "alert",
180
+ title: "Nothing was imported.",
181
+ children: error
182
+ }),
183
+ /* @__PURE__ */ jsxs(DialogActions, { children: [/* @__PURE__ */ jsx(Button, {
184
+ variant: "ghost",
185
+ disabled: busy,
186
+ onClick: onClose,
187
+ children: "Cancel"
188
+ }), /* @__PURE__ */ jsx(Button, {
189
+ variant: "primary",
190
+ type: "submit",
191
+ disabled: busy || !ready,
192
+ children: busy ? "Importing…" : source === "openclaw" ? "Import from OpenClaw" : source === "zip" ? "Upload and import" : "Import"
193
+ })] })
194
+ ]
195
+ })
196
+ });
197
+ }
198
+ //#endregion
199
+ export { FindingsNotice as n, ImportSkillsDialog as r, FindingLines as t };