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.
- package/dist/cli.js +3 -3
- package/dist/cli.js.map +1 -1
- package/dist/daemon.js +296 -232
- package/dist/daemon.js.map +1 -1
- package/dist/web/client/assets/AddProviderDialog-CkwSq3C7.js +1 -0
- package/dist/web/client/assets/AgentTemplateParts-CEn_4qVs.js +1 -0
- package/dist/web/client/assets/Button-UiegBKOK.js +1 -0
- package/dist/web/client/assets/{ConfigPage-DiQiJXP6.js → ConfigPage-CUbHBhzx.js} +1 -1
- package/dist/web/client/assets/ConfirmDialog-VqBOFZEp.js +1 -0
- package/dist/web/client/assets/ConnectionsView-ByARMcWP.js +1 -0
- package/dist/web/client/assets/{ManagePage-xlePXXx5.js → ManagePage-BJWZd1ts.js} +1 -1
- package/dist/web/client/assets/{SectionTabs-BMiRKFfb.js → SectionTabs-ViZKm3-B.js} +1 -1
- package/dist/web/client/assets/{Segmented-Co4n2C5X.js → Segmented-MYKKTuZO.js} +1 -1
- package/dist/web/client/assets/SkillsParts-UvNK5SYP.js +1 -0
- package/dist/web/client/assets/SpawnTeamModal-DG5UbJNK.js +1 -0
- package/dist/web/client/assets/TeamForm-DGlxWv4e.js +1 -0
- package/dist/web/client/assets/TeamThread-mkwODO0S.js +1 -0
- package/dist/web/client/assets/{UnsavedChangesGuard-DmT4nBQU.js → UnsavedChangesGuard-BmdwLH99.js} +1 -1
- package/dist/web/client/assets/_id-CvcxNmBH.js +1 -0
- package/dist/web/client/assets/_id-UyBk7gRl.js +1 -0
- package/dist/web/client/assets/access-C8d8vaQ6.js +1 -0
- package/dist/web/client/assets/agent-actions-BgE9fKHH.js +1 -0
- package/dist/web/client/assets/agents-CgtzqBpD.js +1 -0
- package/dist/web/client/assets/agents-D7W4BT8r.js +1 -0
- package/dist/web/client/assets/arrow-right-D0HKRb7U.js +1 -0
- package/dist/web/client/assets/attention-D9mQWoKt.js +1 -0
- package/dist/web/client/assets/bot-Bb--PFVU.js +1 -0
- package/dist/web/client/assets/chevron-right-bs0TUSl2.js +1 -0
- package/dist/web/client/assets/config-Dw6GWf38.js +1 -0
- package/dist/web/client/assets/createLucideIcon-DkniuEtD.js +1 -0
- package/dist/web/client/assets/{download-Dj-1ltZb.js → download-C4t9l5wR.js} +1 -1
- package/dist/web/client/assets/{file-text-DiP-LaEg.js → file-text-DzbjpYrV.js} +1 -1
- package/dist/web/client/assets/{images-BKjyhYUc.js → images-DSYgPKM7.js} +1 -1
- package/dist/web/client/assets/index-YW0gXPfk.js +14 -0
- package/dist/web/client/assets/{key-round-QpqZklz6.js → key-round-BpK4-E3T.js} +1 -1
- package/dist/web/client/assets/{list-checks-BeyG5SVQ.js → list-checks-JNXcmws9.js} +1 -1
- package/dist/web/client/assets/login-DcQJk5-U.js +1 -0
- package/dist/web/client/assets/manage-SRGSx8n2.js +1 -0
- package/dist/web/client/assets/mcp-BUWu4TvS.js +1 -0
- package/dist/web/client/assets/{message-square-DnpSOYv4.js → message-square-DM2MP9vF.js} +1 -1
- package/dist/web/client/assets/{network-BC7rNaOC.js → network-BJ4iPjQO.js} +1 -1
- package/dist/web/client/assets/parts-LZxl9Gvc.js +41 -0
- package/dist/web/client/assets/plus-CLGNN5QX.js +1 -0
- package/dist/web/client/assets/routes-BxIIyGho.js +85 -0
- package/dist/web/client/assets/skills-C7DzIwFJ.js +1 -0
- package/dist/web/client/assets/{square-terminal-hQZ6pexU.js → square-terminal-Dmm6cV-G.js} +1 -1
- package/dist/web/client/assets/style-CA2GAk9b.js +7 -0
- package/dist/web/client/assets/styles-C3CDSGAr.css +2 -0
- package/dist/web/client/assets/system-zQ0NnQML.js +1 -0
- package/dist/web/client/assets/teams-BEIJHObN.js +1 -0
- package/dist/web/client/assets/teams-DlOc7Ods.js +1 -0
- package/dist/web/client/assets/telegram-DKHq5DpE.js +1 -0
- package/dist/web/client/assets/tools-BKIpLaiC.js +1 -0
- package/dist/web/client/assets/use-resource-CQaIZbpy.js +1 -0
- package/dist/web/client/assets/users-round-BJrym3FG.js +1 -0
- package/dist/web/client/assets/welcome-CyS4Hrd-.js +1 -0
- package/dist/web/client/assets/wrench-GbE1M1RJ.js +1 -0
- package/dist/web/server/assets/{AddProviderDialog-Di5crZUB.js → AddProviderDialog-Nc5mc_P6.js} +7 -10
- package/dist/web/server/assets/{AgentTemplateParts-Cqy7kSzx.js → AgentTemplateParts-DZK_r3nQ.js} +3 -6
- package/dist/web/server/assets/{ConfigPage-oXM3wyOU.js → ConfigPage-CxzL-gTm.js} +1 -1
- package/dist/web/server/assets/{ConfirmDialog-DfaJ--A6.js → ConfirmDialog-4xeCXKHe.js} +1 -2
- package/dist/web/server/assets/{ConnectionsView-DZrLoNoW.js → ConnectionsView-B02FjNsM.js} +9 -9
- package/dist/web/server/assets/{ManagePage-0LKHEcT_.js → ManagePage-BfCWE8Lj.js} +1 -1
- package/dist/web/server/assets/ModelMenu-D-hTgYOO.js +278 -0
- package/dist/web/server/assets/{Rail-7JU6ly2O.js → Rail-3gbidhyv.js} +9 -12
- package/dist/web/server/assets/SkillsParts-D58l8voo.js +199 -0
- package/dist/web/server/assets/SpawnDialog-MJWwppgC.js +1648 -0
- package/dist/web/server/assets/{SpawnTeamModal-CCe6P82H.js → SpawnTeamModal-RjzAeX_Q.js} +3 -6
- package/dist/web/server/assets/{TeamForm-BzQmdhVi.js → TeamForm-DdOgIMiV.js} +2 -5
- package/dist/web/server/assets/{TeamThread-SyQpUvz5.js → TeamThread-D-PvO3fu.js} +9 -9
- package/dist/web/server/assets/{UnsavedChangesGuard-DrOvPV14.js → UnsavedChangesGuard-Bb5frygQ.js} +1 -1
- package/dist/web/server/assets/{_id-AcyGvFrE.js → _id-BPjVkcNb.js} +10 -14
- package/dist/web/server/assets/{_id-DXm9W55C.js → _id-BUfy-GwH.js} +2 -2
- package/dist/web/server/assets/{_id-DPGzfmjG.js → _id-C1_l6oSR.js} +9 -11
- package/dist/web/server/assets/{_id-BGTgqsWm.js → _id-CHvYQhWt.js} +2 -2
- package/dist/web/server/assets/{_id-DojvxRZn.js → _id-De3Bm0SG.js} +1 -1
- package/dist/web/server/assets/_tanstack-start-manifest_v-CR3jm1nY.js +256 -0
- package/dist/web/server/assets/{access-CKSW7MFH.js → access-CNfvQ3NB.js} +4 -6
- package/dist/web/server/assets/{access-BJe-NduL.js → access-Cm_izIIC.js} +2 -2
- package/dist/web/server/assets/{agent-actions-CUDMCG0F.js → agent-actions-COnfW5AU.js} +1 -1
- package/dist/web/server/assets/{agents-DUI4Yjtg.js → agents-C7UmTjfO.js} +2 -2
- package/dist/web/server/assets/{agents-6d9WxbYF.js → agents-CRtMfKqX.js} +1 -1
- package/dist/web/server/assets/{agents-DtLDoZ_u.js → agents-D0hfGIMK.js} +6 -8
- package/dist/web/server/assets/{agents-DKVGUwD1.js → agents-DQowl6Ly.js} +1 -1
- package/dist/web/server/assets/{agents-1sjSvp5p.js → agents-DzpqlIuJ.js} +2 -2
- package/dist/web/server/assets/{agents-DsHeRaLq.js → agents-NOkh61dV.js} +6 -10
- package/dist/web/server/assets/{attention-johfkM0_.js → attention-CRvxt22X.js} +40 -11
- package/dist/web/server/assets/{attention-B6sSDR_4.js → attention-CgWhXjX7.js} +2 -0
- package/dist/web/server/assets/{attention-DefKwvgm.js → attention-Cx9ZWPOO.js} +4 -2
- package/dist/web/server/assets/{config-DYAaaE9Z.js → config-B5CS8juO.js} +2 -2
- package/dist/web/server/assets/{config-Clz57LuN.js → config-D117117T.js} +24 -26
- package/dist/web/server/assets/{createSsrRpc-BijMHgqE.js → createSsrRpc-CwTd0zrB.js} +4 -57
- package/dist/web/server/assets/{login-VV10kZBl.js → login-IF0Gbsuq.js} +36 -2
- package/dist/web/server/assets/{login-JoIjlcmu.js → login-va4EtvA8.js} +34 -45
- package/dist/web/server/assets/{manage-Ppyi3Y5y.js → manage-Ce6cI4eW.js} +14 -4
- package/dist/web/server/assets/{mcp-DB38leWS.js → mcp-Bm9U6x7N.js} +2 -2
- package/dist/web/server/assets/{mcp-Ce6O8Qs2.js → mcp-C96PBxpb.js} +4 -6
- package/dist/web/server/assets/page-title-CwcbXMhx.js +95 -0
- package/dist/web/server/assets/{router-C97bwlXi.js → router-8Iq19GOz.js} +354 -196
- package/dist/web/server/assets/{routes-C4aGqXfr.js → routes-BLo-fWbQ.js} +2680 -1710
- package/dist/web/server/assets/{routes-DuOShl4q.js → routes-BXvYYFrN.js} +2 -2
- package/dist/web/server/assets/routes-Kwam6JmS.js +89 -0
- package/dist/web/server/assets/{skills-B7sg0QKS.js → skills-BqCnA-74.js} +2 -2
- package/dist/web/server/assets/skills-DSezIdDc.js +157 -0
- package/dist/web/server/assets/{style-BR7ufS6Z.js → style-C2hIPY_Y.js} +1 -1
- package/dist/web/server/assets/{system-DaP0ol67.js → system-CcLCmkIC.js} +2 -2
- package/dist/web/server/assets/{system-CNQpt3JB.js → system-E0VePdzO.js} +4 -4
- package/dist/web/server/assets/{teams-C3xwTz8-.js → teams-CQVV18D3.js} +6 -9
- package/dist/web/server/assets/{teams-BKHe67f3.js → teams-CdCmBJIj.js} +7 -9
- package/dist/web/server/assets/{teams-CuKE5iAK.js → teams-DScFp8mK.js} +2 -2
- package/dist/web/server/assets/{teams-4cEZ4_rw.js → teams-DxA-vnzY.js} +2 -2
- package/dist/web/server/assets/{telegram-BpmK-HHV.js → telegram-DJ8s_91Y.js} +7 -9
- package/dist/web/server/assets/{telegram-BnQADwnj.js → telegram-DR7xijeS.js} +2 -2
- package/dist/web/server/assets/{tools-BQeWn7Tj.js → tools-CsH9DI-4.js} +2 -2
- package/dist/web/server/assets/{tools-CURTfG2q.js → tools-V6kezUpL.js} +4 -6
- package/dist/web/server/assets/{use-resource-DVzK0toP.js → use-resource-CjcJwn7F.js} +1 -1
- package/dist/web/server/assets/{welcome-SNsE49JO.js → welcome-BpmcD-ia.js} +2 -2
- package/dist/web/server/assets/{welcome-OiZCAIHZ.js → welcome-Ya8TkL4v.js} +10 -9
- package/dist/web/server/server.js +8 -8
- package/dist/worker.js +17 -0
- package/dist/worker.js.map +1 -1
- package/package.json +1 -1
- package/dist/web/client/assets/AddProviderDialog-CO_uijWF.js +0 -1
- package/dist/web/client/assets/AgentTemplateParts-Dl35c-Ux.js +0 -1
- package/dist/web/client/assets/ConfirmDialog-BVytx3kN.js +0 -1
- package/dist/web/client/assets/ConnectionsView-DDrBaiLg.js +0 -1
- package/dist/web/client/assets/Dialog-BTDzv3J5.js +0 -1
- package/dist/web/client/assets/SpawnDialog-ejwXnyxy.js +0 -1
- package/dist/web/client/assets/SpawnTeamModal-Cp-nAvIC.js +0 -1
- package/dist/web/client/assets/TeamForm-Cz9uDVvb.js +0 -1
- package/dist/web/client/assets/TeamThread-D8xqE_gb.js +0 -1
- package/dist/web/client/assets/_id-DEQxwq2v.js +0 -1
- package/dist/web/client/assets/_id-DSRgpxEc.js +0 -1
- package/dist/web/client/assets/access-34_ShgHU.js +0 -1
- package/dist/web/client/assets/agent-actions--EO4yJ4Q.js +0 -1
- package/dist/web/client/assets/agents-C87yBHaR.js +0 -1
- package/dist/web/client/assets/agents-DvCSl1Ro.js +0 -1
- package/dist/web/client/assets/api-CoLs57oO.js +0 -1
- package/dist/web/client/assets/arrow-right-BhTWtC9z.js +0 -1
- package/dist/web/client/assets/attention-CteEeRvX.js +0 -1
- package/dist/web/client/assets/chevron-right-BqOIX9UM.js +0 -1
- package/dist/web/client/assets/config-XJuQeEP4.js +0 -1
- package/dist/web/client/assets/createLucideIcon-dN8ooBD1.js +0 -1
- package/dist/web/client/assets/entities-xVoB-p2j.js +0 -1
- package/dist/web/client/assets/form-Bvr_f9lR.js +0 -1
- package/dist/web/client/assets/index-J_Uqj4md.js +0 -54
- package/dist/web/client/assets/login-076Bc601.js +0 -1
- package/dist/web/client/assets/manage-CsrV2hhK.js +0 -1
- package/dist/web/client/assets/mcp-8N0BqZ0G.js +0 -1
- package/dist/web/client/assets/model-facts-DoB6QD5y.js +0 -1
- package/dist/web/client/assets/parts-B0JBolvG.js +0 -1
- package/dist/web/client/assets/plus-DZ3KVo7E.js +0 -1
- package/dist/web/client/assets/routes-3HkZZOOe.js +0 -76
- package/dist/web/client/assets/skills-DiaqZRXT.js +0 -1
- package/dist/web/client/assets/style-BtcFIkOS.js +0 -7
- package/dist/web/client/assets/styles-C7Ztw15K.css +0 -2
- package/dist/web/client/assets/system-YWlJ8ogO.js +0 -1
- package/dist/web/client/assets/teams-DQwceMvk.js +0 -1
- package/dist/web/client/assets/teams-DTC3plIH.js +0 -1
- package/dist/web/client/assets/telegram-D4wINntt.js +0 -1
- package/dist/web/client/assets/tools-CZeQ9pDx.js +0 -1
- package/dist/web/client/assets/use-resource-BaTkTGvG.js +0 -1
- package/dist/web/client/assets/welcome-CnxP_RCk.js +0 -1
- package/dist/web/client/assets/wrench-BrwBswfo.js +0 -1
- package/dist/web/server/assets/Dialog-aup_yJv5.js +0 -85
- package/dist/web/server/assets/ModelMenu-BAZeARx6.js +0 -138
- package/dist/web/server/assets/SpawnDialog-CYkwzETs.js +0 -124
- package/dist/web/server/assets/_tanstack-start-manifest_v-D7RvKGRH.js +0 -285
- package/dist/web/server/assets/entities-Dn2xzKIw.js +0 -16
- package/dist/web/server/assets/form-BRQAsKKq.js +0 -319
- package/dist/web/server/assets/model-facts-mrfrWQne.js +0 -136
- package/dist/web/server/assets/parts-mabERIJZ.js +0 -380
- package/dist/web/server/assets/routes-IHMVKpDK.js +0 -16
- package/dist/web/server/assets/skills-hfTSwqsG.js +0 -353
- package/dist/web/server/assets/utils-C_uf36nf.js +0 -8
- package/dist/web/server/assets/workspace-DaitCM0t.js +0 -651
- /package/dist/web/server/assets/{telegram-CGol0CKX.js → telegram-CGol0CKX2.js} +0 -0
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
import { r as readCookie } from "./cookies-HnTYjKRp.js";
|
|
2
|
-
import {
|
|
2
|
+
import { $ as agentState, H as parseWorkspaceSearch, K as Button, W as Dialog$1, dt as errorMessage, et as shortTime, lt as api, q as AgentAvatar, t as SpawnDialog } from "./SpawnDialog-MJWwppgC.js";
|
|
3
3
|
import { n as publicOriginConfig } from "./public-origin-BpDkdS5Q.js";
|
|
4
4
|
import { t as DAEMON_BASE_URL } from "./daemon-client-B_ZRIIrT.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { i as
|
|
8
|
-
import { t as Route$
|
|
9
|
-
import { t as Route$
|
|
10
|
-
import { t as Route$
|
|
11
|
-
import { t as Route$
|
|
12
|
-
import { t as Route$
|
|
13
|
-
import { t as Route$
|
|
14
|
-
import { t as Route$
|
|
15
|
-
import { t as Route$
|
|
16
|
-
import { t as Route$
|
|
17
|
-
import { t as Route$
|
|
18
|
-
import { t as Route$
|
|
19
|
-
import { t as Route$
|
|
20
|
-
import { t as Route$
|
|
21
|
-
import { t as Route$
|
|
22
|
-
import { t as Route$
|
|
5
|
+
import { i as useAttentionCount, r as AttentionCountProvider, t as PageTitleProvider } from "./page-title-CwcbXMhx.js";
|
|
6
|
+
import { r as PageShell } from "./createSsrRpc-CwTd0zrB.js";
|
|
7
|
+
import { a as PawIcon, i as useThemeMode, n as THEME_MODES, o as BaziuLogo, r as setThemeMode, t as Route$3 } from "./login-va4EtvA8.js";
|
|
8
|
+
import { i as isTyping, n as NEW_CONVERSATION_EVENT, r as SHORTCUTS, t as Route$4 } from "./routes-Kwam6JmS.js";
|
|
9
|
+
import { i as isSetupOpen, n as PUBLIC_PATHS, r as fetchAuthState, t as Route$5 } from "./welcome-BpmcD-ia.js";
|
|
10
|
+
import { t as Route$6 } from "./teams-DScFp8mK.js";
|
|
11
|
+
import { t as Route$7 } from "./skills-BqCnA-74.js";
|
|
12
|
+
import { t as Route$8 } from "./config-B5CS8juO.js";
|
|
13
|
+
import { t as Route$9 } from "./attention-Cx9ZWPOO.js";
|
|
14
|
+
import { t as Route$10 } from "./agents-DzpqlIuJ.js";
|
|
15
|
+
import { t as Route$11 } from "./tools-CsH9DI-4.js";
|
|
16
|
+
import { t as Route$12 } from "./telegram-DR7xijeS.js";
|
|
17
|
+
import { t as Route$13 } from "./system-CcLCmkIC.js";
|
|
18
|
+
import { t as Route$14 } from "./mcp-Bm9U6x7N.js";
|
|
19
|
+
import { t as Route$15 } from "./access-Cm_izIIC.js";
|
|
20
|
+
import { t as Route$16 } from "./teams-DxA-vnzY.js";
|
|
21
|
+
import { t as Route$17 } from "./agents-C7UmTjfO.js";
|
|
22
|
+
import { t as Route$18 } from "./_id-CHvYQhWt.js";
|
|
23
|
+
import { t as Route$19 } from "./_id-BUfy-GwH.js";
|
|
23
24
|
import { useEffect, useMemo, useState } from "react";
|
|
24
25
|
import { HeadContent, Link, Outlet, Scripts, createFileRoute, createRootRoute, createRouter, redirect, useNavigate, useRouter, useRouterState } from "@tanstack/react-router";
|
|
25
26
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
26
|
-
import { BellRing,
|
|
27
|
+
import { BellRing, Check, Keyboard, LayoutGrid, LogOut, MessageSquarePlus, Monitor, Moon, Search, Settings2, Sun, UserPlus, UserRound } from "lucide-react";
|
|
27
28
|
import { Dialog, DropdownMenu } from "radix-ui";
|
|
28
29
|
//#region src/components/RouteStates.tsx
|
|
29
30
|
/** The router's error view for every route: a loader failed. The top nav stays usable. */
|
|
@@ -130,6 +131,9 @@ var PAGES = [
|
|
|
130
131
|
"/config"
|
|
131
132
|
]
|
|
132
133
|
];
|
|
134
|
+
/** How many Agents' conversations are looked at for "Recent conversations", and how many shown. */
|
|
135
|
+
var RECENT_AGENTS = 3;
|
|
136
|
+
var RECENT_CONVERSATIONS = 5;
|
|
133
137
|
/** Destinations whose label or hint holds every word of the query. */
|
|
134
138
|
function filterDestinations(all, query) {
|
|
135
139
|
const words = query.toLowerCase().split(/\s+/).filter(Boolean);
|
|
@@ -139,44 +143,137 @@ function filterDestinations(all, query) {
|
|
|
139
143
|
return words.every((word) => text.includes(word));
|
|
140
144
|
});
|
|
141
145
|
}
|
|
142
|
-
|
|
146
|
+
/**
|
|
147
|
+
* Agents in the palette's order: those waiting for you, then those working, then the rest by when
|
|
148
|
+
* they were last active, most recent first.
|
|
149
|
+
*/
|
|
150
|
+
function orderAgents(agents, activity) {
|
|
151
|
+
const kind = (agent) => agentState(activity.get(agent.id), void 0).kind;
|
|
152
|
+
const last = (agent) => activity.get(agent.id)?.lastActivityAt ?? 0;
|
|
153
|
+
return {
|
|
154
|
+
waiting: agents.filter((agent) => kind(agent) === "needs"),
|
|
155
|
+
working: agents.filter((agent) => kind(agent) === "working"),
|
|
156
|
+
rest: agents.filter((agent) => kind(agent) !== "needs" && kind(agent) !== "working").toSorted((a, b) => last(b) - last(a))
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
function JumpPalette({ open, onClose, onShowShortcuts }) {
|
|
143
160
|
const navigate = useNavigate();
|
|
144
161
|
const location = useRouterState({ select: (state) => state.location });
|
|
145
162
|
const [query, setQuery] = useState("");
|
|
146
163
|
const [active, setActive] = useState(0);
|
|
147
164
|
const [agents, setAgents] = useState([]);
|
|
148
165
|
const [teams, setTeams] = useState([]);
|
|
166
|
+
const [profiles, setProfiles] = useState([]);
|
|
149
167
|
const [activity, setActivity] = useState([]);
|
|
168
|
+
const [recent, setRecent] = useState([]);
|
|
169
|
+
const [dark, setDark] = useState(false);
|
|
170
|
+
const [spawning, setSpawning] = useState(false);
|
|
150
171
|
useEffect(() => {
|
|
151
172
|
if (!open) return;
|
|
152
173
|
setQuery("");
|
|
153
174
|
setActive(0);
|
|
175
|
+
setDark(document.documentElement.classList.contains("dark"));
|
|
154
176
|
const controller = new AbortController();
|
|
155
177
|
const signal = controller.signal;
|
|
156
178
|
Promise.all([
|
|
157
179
|
api("/api/agents", { signal }),
|
|
158
180
|
api("/api/teams", { signal }),
|
|
159
|
-
api("/api/activity", { signal })
|
|
160
|
-
|
|
181
|
+
api("/api/activity", { signal }),
|
|
182
|
+
api("/api/profiles", { signal })
|
|
183
|
+
]).then(async ([nextAgents, nextTeams, nextActivity, nextProfiles]) => {
|
|
161
184
|
setAgents(nextAgents);
|
|
162
185
|
setTeams(nextTeams);
|
|
163
186
|
setActivity(nextActivity.agents);
|
|
187
|
+
setProfiles(nextProfiles);
|
|
188
|
+
const latest = nextActivity.agents.filter((entry) => entry.lastActivityAt !== null).toSorted((a, b) => (b.lastActivityAt ?? 0) - (a.lastActivityAt ?? 0)).slice(0, RECENT_AGENTS);
|
|
189
|
+
setRecent((await Promise.all(latest.map((entry) => api(`/api/agents/${encodeURIComponent(entry.agentId)}/conversations?limit=3`, { signal }).then((list) => list.conversations.map((conversation) => ({
|
|
190
|
+
id: conversation.id,
|
|
191
|
+
agentId: entry.agentId,
|
|
192
|
+
title: conversation.title,
|
|
193
|
+
updatedAt: conversation.updatedAt,
|
|
194
|
+
selected: conversation.id === list.selectedId
|
|
195
|
+
})))))).flat().toSorted((a, b) => b.updatedAt - a.updatedAt).slice(0, RECENT_CONVERSATIONS));
|
|
164
196
|
}).catch(() => {});
|
|
165
197
|
return () => controller.abort();
|
|
166
198
|
}, [open]);
|
|
167
199
|
const shown = filterDestinations(useMemo(() => {
|
|
168
200
|
const teamName = new Map(teams.map((team) => [team.id, team.name]));
|
|
169
|
-
const
|
|
201
|
+
const byAgent = new Map(activity.map((entry) => [entry.agentId, entry]));
|
|
202
|
+
const agentById = new Map(agents.map((agent) => [agent.id, agent]));
|
|
170
203
|
const here = location.pathname === "/" ? parseWorkspaceSearch(location.search) : void 0;
|
|
171
|
-
const
|
|
172
|
-
const
|
|
204
|
+
const hereAgent = here?.agent ? agentById.get(here.agent) : void 0;
|
|
205
|
+
const hereTeam = here?.team ?? hereAgent?.teamId ?? void 0;
|
|
206
|
+
const agentDestination = (agent, group) => ({
|
|
173
207
|
key: `agent:${agent.id}`,
|
|
174
|
-
group
|
|
208
|
+
group,
|
|
175
209
|
label: agent.name,
|
|
176
|
-
hint: `${teamName.get(agent.teamId) ?? agent.teamId} · ${agentState(
|
|
210
|
+
hint: `${teamName.get(agent.teamId) ?? agent.teamId} · ${agentState(byAgent.get(agent.id), void 0).text}`,
|
|
177
211
|
agent,
|
|
178
212
|
search: { agent: agent.id }
|
|
179
|
-
})
|
|
213
|
+
});
|
|
214
|
+
const ordered = orderAgents(agents, byAgent);
|
|
215
|
+
const list = [...ordered.waiting.map((agent) => agentDestination(agent, "Waiting for you")), ...ordered.working.map((agent) => agentDestination(agent, "Working now"))];
|
|
216
|
+
if (hereAgent && !here?.view) list.push({
|
|
217
|
+
key: "action:new-conversation",
|
|
218
|
+
group: "Actions",
|
|
219
|
+
label: `New conversation with ${hereAgent.name}`,
|
|
220
|
+
hint: "The current one stays in its list",
|
|
221
|
+
icon: /* @__PURE__ */ jsx(MessageSquarePlus, {
|
|
222
|
+
className: "size-4",
|
|
223
|
+
"aria-hidden": "true"
|
|
224
|
+
}),
|
|
225
|
+
run: () => window.dispatchEvent(new CustomEvent(NEW_CONVERSATION_EVENT, { detail: { agentId: hereAgent.id } }))
|
|
226
|
+
});
|
|
227
|
+
list.push({
|
|
228
|
+
key: "action:spawn",
|
|
229
|
+
group: "Actions",
|
|
230
|
+
label: "Add an Agent",
|
|
231
|
+
hint: hereTeam ? `To ${teamName.get(hereTeam) ?? hereTeam}, or another Team` : "To a Team",
|
|
232
|
+
icon: /* @__PURE__ */ jsx(UserPlus, {
|
|
233
|
+
className: "size-4",
|
|
234
|
+
"aria-hidden": "true"
|
|
235
|
+
}),
|
|
236
|
+
run: () => setSpawning(true)
|
|
237
|
+
}, {
|
|
238
|
+
key: "action:theme",
|
|
239
|
+
group: "Actions",
|
|
240
|
+
label: dark ? "Switch to the light theme" : "Switch to the dark theme",
|
|
241
|
+
hint: "For this browser",
|
|
242
|
+
icon: dark ? /* @__PURE__ */ jsx(Sun, {
|
|
243
|
+
className: "size-4",
|
|
244
|
+
"aria-hidden": "true"
|
|
245
|
+
}) : /* @__PURE__ */ jsx(Moon, {
|
|
246
|
+
className: "size-4",
|
|
247
|
+
"aria-hidden": "true"
|
|
248
|
+
}),
|
|
249
|
+
run: () => setThemeMode(dark ? "light" : "dark")
|
|
250
|
+
}, {
|
|
251
|
+
key: "action:shortcuts",
|
|
252
|
+
group: "Actions",
|
|
253
|
+
label: "Keyboard shortcuts",
|
|
254
|
+
hint: "Press ? anywhere",
|
|
255
|
+
icon: /* @__PURE__ */ jsx(Keyboard, {
|
|
256
|
+
className: "size-4",
|
|
257
|
+
"aria-hidden": "true"
|
|
258
|
+
}),
|
|
259
|
+
run: onShowShortcuts
|
|
260
|
+
});
|
|
261
|
+
list.push(...ordered.rest.map((agent) => agentDestination(agent, "Agents")));
|
|
262
|
+
for (const conversation of recent) {
|
|
263
|
+
const agent = agentById.get(conversation.agentId);
|
|
264
|
+
if (!agent) continue;
|
|
265
|
+
list.push({
|
|
266
|
+
key: `conversation:${conversation.id}`,
|
|
267
|
+
group: "Recent conversations",
|
|
268
|
+
label: conversation.title,
|
|
269
|
+
hint: `${agent.name} · ${shortTime(conversation.updatedAt)}`,
|
|
270
|
+
agent,
|
|
271
|
+
search: conversation.selected ? { agent: agent.id } : {
|
|
272
|
+
agent: agent.id,
|
|
273
|
+
conversation: conversation.id
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
}
|
|
180
277
|
for (const team of teams) list.push({
|
|
181
278
|
key: `team:${team.id}`,
|
|
182
279
|
group: "Teams",
|
|
@@ -234,19 +331,24 @@ function JumpPalette({ open, onClose }) {
|
|
|
234
331
|
agents,
|
|
235
332
|
teams,
|
|
236
333
|
activity,
|
|
237
|
-
|
|
334
|
+
recent,
|
|
335
|
+
location,
|
|
336
|
+
dark,
|
|
337
|
+
onShowShortcuts
|
|
238
338
|
]), query);
|
|
239
339
|
const current = Math.min(active, Math.max(shown.length - 1, 0));
|
|
340
|
+
const hereTeam = location.pathname === "/" ? parseWorkspaceSearch(location.search).team ?? agents.find((agent) => agent.id === parseWorkspaceSearch(location.search).agent)?.teamId : void 0;
|
|
240
341
|
function go(destination) {
|
|
241
342
|
if (!destination) return;
|
|
242
343
|
onClose();
|
|
243
|
-
if (destination.
|
|
344
|
+
if (destination.run) destination.run();
|
|
345
|
+
else if (destination.path) navigate({ to: destination.path });
|
|
244
346
|
else navigate({
|
|
245
347
|
to: "/",
|
|
246
348
|
search: destination.search ?? {}
|
|
247
349
|
});
|
|
248
350
|
}
|
|
249
|
-
return /* @__PURE__ */ jsx(Dialog.Root, {
|
|
351
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Dialog.Root, {
|
|
250
352
|
open,
|
|
251
353
|
onOpenChange: (next) => !next && onClose(),
|
|
252
354
|
children: /* @__PURE__ */ jsxs(Dialog.Portal, { children: [/* @__PURE__ */ jsx(Dialog.Overlay, { className: "fixed inset-0 z-50 bg-chocolate/30 data-[state=open]:animate-in data-[state=open]:fade-in-0" }), /* @__PURE__ */ jsxs(Dialog.Content, {
|
|
@@ -255,7 +357,7 @@ function JumpPalette({ open, onClose }) {
|
|
|
255
357
|
children: [
|
|
256
358
|
/* @__PURE__ */ jsx(Dialog.Title, {
|
|
257
359
|
className: "sr-only",
|
|
258
|
-
children: "Jump to"
|
|
360
|
+
children: "Jump to or do anything"
|
|
259
361
|
}),
|
|
260
362
|
/* @__PURE__ */ jsxs("div", {
|
|
261
363
|
className: "flex items-center gap-2.5 border-b border-border px-4 py-3",
|
|
@@ -266,13 +368,13 @@ function JumpPalette({ open, onClose }) {
|
|
|
266
368
|
}),
|
|
267
369
|
/* @__PURE__ */ jsx("input", {
|
|
268
370
|
autoFocus: true,
|
|
269
|
-
"aria-label": "Jump to",
|
|
371
|
+
"aria-label": "Jump to or do anything",
|
|
270
372
|
role: "combobox",
|
|
271
373
|
"aria-expanded": "true",
|
|
272
374
|
"aria-controls": "jump-results",
|
|
273
375
|
"aria-activedescendant": shown[current] ? `jump-${shown[current].key}` : void 0,
|
|
274
376
|
value: query,
|
|
275
|
-
placeholder: "
|
|
377
|
+
placeholder: "An Agent, a Team, a page, or something to do",
|
|
276
378
|
onChange: (event) => {
|
|
277
379
|
setQuery(event.target.value);
|
|
278
380
|
setActive(0);
|
|
@@ -289,10 +391,11 @@ function JumpPalette({ open, onClose }) {
|
|
|
289
391
|
go(shown[current]);
|
|
290
392
|
}
|
|
291
393
|
},
|
|
292
|
-
|
|
394
|
+
style: { outline: "none" },
|
|
395
|
+
className: "min-h-0 min-w-0 flex-1 border-0 bg-transparent p-0 text-base shadow-none focus:bg-transparent focus:shadow-none"
|
|
293
396
|
}),
|
|
294
397
|
/* @__PURE__ */ jsx("kbd", {
|
|
295
|
-
className: "rounded-md border border-border bg-muted px-1.5 py-0.5 font-mono text-
|
|
398
|
+
className: "rounded-md border border-border bg-muted px-1.5 py-0.5 font-mono text-xs text-muted-foreground",
|
|
296
399
|
children: "Esc"
|
|
297
400
|
})
|
|
298
401
|
]
|
|
@@ -300,7 +403,7 @@ function JumpPalette({ open, onClose }) {
|
|
|
300
403
|
/* @__PURE__ */ jsxs("div", {
|
|
301
404
|
id: "jump-results",
|
|
302
405
|
role: "listbox",
|
|
303
|
-
"aria-label": "Destinations",
|
|
406
|
+
"aria-label": "Destinations and actions",
|
|
304
407
|
className: "overflow-y-auto p-1.5",
|
|
305
408
|
children: [shown.length === 0 && /* @__PURE__ */ jsxs("p", {
|
|
306
409
|
className: "px-3 py-6 text-center text-sm text-muted-foreground",
|
|
@@ -310,7 +413,7 @@ function JumpPalette({ open, onClose }) {
|
|
|
310
413
|
"”."
|
|
311
414
|
]
|
|
312
415
|
}), shown.map((destination, index) => /* @__PURE__ */ jsxs("div", { children: [destination.group !== shown[index - 1]?.group && /* @__PURE__ */ jsx("div", {
|
|
313
|
-
className:
|
|
416
|
+
className: `px-2.5 pb-1 pt-2 text-xs font-bold uppercase tracking-[0.08em] ${destination.group === "Waiting for you" ? "text-warning" : "text-muted-foreground"}`,
|
|
314
417
|
children: destination.group
|
|
315
418
|
}), /* @__PURE__ */ jsxs("button", {
|
|
316
419
|
type: "button",
|
|
@@ -321,16 +424,19 @@ function JumpPalette({ open, onClose }) {
|
|
|
321
424
|
onClick: () => go(destination),
|
|
322
425
|
className: `unstyled flex min-h-10 w-full items-center gap-2.5 rounded-lg px-2.5 py-1.5 text-left text-sm ${index === current ? "bg-accent text-accent-foreground" : "text-foreground"}`,
|
|
323
426
|
children: [
|
|
324
|
-
destination.agent
|
|
427
|
+
destination.agent ? /* @__PURE__ */ jsx(AgentAvatar, {
|
|
325
428
|
identity: destination.agent.identity,
|
|
326
429
|
size: 24
|
|
327
|
-
}),
|
|
430
|
+
}) : destination.icon ? /* @__PURE__ */ jsx("span", {
|
|
431
|
+
className: "flex size-6 shrink-0 items-center justify-center text-mocha",
|
|
432
|
+
children: destination.icon
|
|
433
|
+
}) : null,
|
|
328
434
|
/* @__PURE__ */ jsx("span", {
|
|
329
|
-
className: "font-semibold",
|
|
435
|
+
className: "min-w-0 truncate font-semibold",
|
|
330
436
|
children: destination.label
|
|
331
437
|
}),
|
|
332
438
|
/* @__PURE__ */ jsx("span", {
|
|
333
|
-
className: "ml-auto min-w-0 truncate text-xs text-muted-foreground",
|
|
439
|
+
className: "ml-auto min-w-0 shrink truncate pl-3 text-xs text-muted-foreground",
|
|
334
440
|
children: destination.hint
|
|
335
441
|
})
|
|
336
442
|
]
|
|
@@ -338,79 +444,90 @@ function JumpPalette({ open, onClose }) {
|
|
|
338
444
|
})
|
|
339
445
|
]
|
|
340
446
|
})] })
|
|
447
|
+
}), spawning && /* @__PURE__ */ jsx(SpawnDialog, {
|
|
448
|
+
profiles,
|
|
449
|
+
teams,
|
|
450
|
+
teamId: hereTeam,
|
|
451
|
+
onClose: () => setSpawning(false)
|
|
452
|
+
})] });
|
|
453
|
+
}
|
|
454
|
+
//#endregion
|
|
455
|
+
//#region src/components/ShortcutsDialog.tsx
|
|
456
|
+
function ShortcutsDialog({ mac, onClose }) {
|
|
457
|
+
return /* @__PURE__ */ jsx(Dialog$1, {
|
|
458
|
+
title: "Keyboard shortcuts",
|
|
459
|
+
description: "The ones without ⌘ or Ctrl wait while you are typing in a field.",
|
|
460
|
+
onClose,
|
|
461
|
+
className: "max-w-lg",
|
|
462
|
+
children: /* @__PURE__ */ jsx("dl", {
|
|
463
|
+
className: "m-0 divide-y divide-border rounded-xl border border-border text-sm",
|
|
464
|
+
children: SHORTCUTS.map((shortcut) => /* @__PURE__ */ jsxs("div", {
|
|
465
|
+
className: "flex items-center gap-4 px-3.5 py-2.5",
|
|
466
|
+
children: [/* @__PURE__ */ jsx("dt", {
|
|
467
|
+
className: "flex shrink-0 gap-1",
|
|
468
|
+
children: shortcut.keys(mac).map((key) => /* @__PURE__ */ jsx("kbd", {
|
|
469
|
+
className: "min-w-7 rounded-md border border-border bg-muted px-1.5 py-0.5 text-center font-mono text-xs text-foreground",
|
|
470
|
+
children: key
|
|
471
|
+
}, key))
|
|
472
|
+
}), /* @__PURE__ */ jsxs("dd", {
|
|
473
|
+
className: "m-0 min-w-0 flex-1 text-foreground",
|
|
474
|
+
children: [shortcut.does, shortcut.where === "workspace" && /* @__PURE__ */ jsx("span", {
|
|
475
|
+
className: "text-muted-foreground",
|
|
476
|
+
children: " (in the workspace)"
|
|
477
|
+
})]
|
|
478
|
+
})]
|
|
479
|
+
}, shortcut.does))
|
|
480
|
+
})
|
|
341
481
|
});
|
|
342
482
|
}
|
|
343
483
|
//#endregion
|
|
344
484
|
//#region src/components/TopBar.tsx
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
{
|
|
359
|
-
href: "/templates",
|
|
360
|
-
label: "Templates",
|
|
361
|
-
description: "What new Agents start with, and Team rosters.",
|
|
362
|
-
icon: LayoutTemplate
|
|
485
|
+
/** The pages each place covers, for marking it as the current one. */
|
|
486
|
+
var MANAGE_PATHS = [
|
|
487
|
+
"/agents",
|
|
488
|
+
"/teams",
|
|
489
|
+
"/templates",
|
|
490
|
+
"/skills"
|
|
491
|
+
];
|
|
492
|
+
var SETUP_PATHS = ["/config"];
|
|
493
|
+
var under = (pathname, roots) => roots.some((root) => pathname === root || pathname.startsWith(`${root}/`));
|
|
494
|
+
var THEME_LABELS = {
|
|
495
|
+
system: {
|
|
496
|
+
label: "Same as this computer",
|
|
497
|
+
icon: Monitor
|
|
363
498
|
},
|
|
364
|
-
{
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
description: "Import, review and remove prompt skills.",
|
|
368
|
-
icon: Sparkles
|
|
499
|
+
light: {
|
|
500
|
+
label: "Light",
|
|
501
|
+
icon: Sun
|
|
369
502
|
},
|
|
370
|
-
{
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
description: "Models, tools, MCP, Telegram, access, system.",
|
|
374
|
-
icon: Settings2
|
|
503
|
+
dark: {
|
|
504
|
+
label: "Dark",
|
|
505
|
+
icon: Moon
|
|
375
506
|
}
|
|
376
|
-
|
|
507
|
+
};
|
|
377
508
|
function TopBar() {
|
|
378
509
|
const pathname = useRouterState({ select: (state) => state.location.pathname });
|
|
379
|
-
const [attention, setAttention] = useState(null);
|
|
380
|
-
const [logoutError, setLogoutError] = useState(null);
|
|
381
510
|
const [paletteOpen, setPaletteOpen] = useState(false);
|
|
511
|
+
const [shortcutsOpen, setShortcutsOpen] = useState(false);
|
|
382
512
|
const [mac, setMac] = useState(false);
|
|
383
513
|
useEffect(() => setMac(/Mac|iPhone|iPad/.test(navigator.userAgent)), []);
|
|
384
514
|
const setupOnly = pathname === "/welcome";
|
|
385
|
-
|
|
386
|
-
if (pathname === "/login" || pathname === "/welcome") return;
|
|
387
|
-
const controller = new AbortController();
|
|
388
|
-
api("/api/attention/summary", { signal: controller.signal }).then(setAttention).catch(() => {});
|
|
389
|
-
return () => controller.abort();
|
|
390
|
-
}, [pathname]);
|
|
515
|
+
const { open: openAttention } = useAttentionCount();
|
|
391
516
|
useEffect(() => {
|
|
392
517
|
if (setupOnly) return;
|
|
393
518
|
const onKey = (event) => {
|
|
394
519
|
if ((event.metaKey || event.ctrlKey) && event.key.toLowerCase() === "k") {
|
|
395
520
|
event.preventDefault();
|
|
396
521
|
setPaletteOpen((open) => !open);
|
|
522
|
+
} else if (!event.defaultPrevented && event.key === "?" && !event.metaKey && !event.ctrlKey && !event.altKey && !isTyping(event.target) && !document.querySelector("[role=\"dialog\"]")) {
|
|
523
|
+
event.preventDefault();
|
|
524
|
+
setShortcutsOpen(true);
|
|
397
525
|
}
|
|
398
526
|
};
|
|
399
527
|
window.addEventListener("keydown", onKey);
|
|
400
528
|
return () => window.removeEventListener("keydown", onKey);
|
|
401
529
|
}, [setupOnly]);
|
|
402
|
-
const attentionActive = pathname
|
|
403
|
-
const openAttention = attention?.openTotal ?? 0;
|
|
404
|
-
const manageActive = MANAGE_LINKS.some((link) => pathname === link.href || pathname.startsWith(`${link.href}/`));
|
|
405
|
-
async function logout() {
|
|
406
|
-
setLogoutError(null);
|
|
407
|
-
try {
|
|
408
|
-
await api("/api/logout", { method: "POST" });
|
|
409
|
-
window.location.assign("/login");
|
|
410
|
-
} catch (error) {
|
|
411
|
-
setLogoutError(errorMessage(error));
|
|
412
|
-
}
|
|
413
|
-
}
|
|
530
|
+
const attentionActive = under(pathname, ["/attention"]);
|
|
414
531
|
return /* @__PURE__ */ jsxs("nav", {
|
|
415
532
|
"aria-label": "Primary navigation",
|
|
416
533
|
className: "relative mx-auto flex w-full max-w-[1800px] shrink-0 flex-wrap items-center gap-x-3 gap-y-2 border-b border-frost py-2.5",
|
|
@@ -427,7 +544,8 @@ function TopBar() {
|
|
|
427
544
|
!setupOnly && /* @__PURE__ */ jsxs("button", {
|
|
428
545
|
type: "button",
|
|
429
546
|
onClick: () => setPaletteOpen(true),
|
|
430
|
-
"aria-label": "Jump to an agent, team or page",
|
|
547
|
+
"aria-label": "Jump to an agent, team or page, or run an action",
|
|
548
|
+
"aria-keyshortcuts": mac ? "Meta+K" : "Control+K",
|
|
431
549
|
className: "unstyled order-last flex h-9 min-w-0 basis-full items-center gap-2 rounded-[10px] border border-border bg-muted px-2.5 text-left text-sm text-mocha transition-colors hover:border-sapphire-light sm:order-none sm:ml-3 sm:max-w-sm sm:flex-1 sm:basis-60",
|
|
432
550
|
children: [
|
|
433
551
|
/* @__PURE__ */ jsx(Search, {
|
|
@@ -436,10 +554,10 @@ function TopBar() {
|
|
|
436
554
|
}),
|
|
437
555
|
/* @__PURE__ */ jsx("span", {
|
|
438
556
|
className: "min-w-0 flex-1 truncate",
|
|
439
|
-
children: "Jump to
|
|
557
|
+
children: "Jump to or do anything"
|
|
440
558
|
}),
|
|
441
559
|
/* @__PURE__ */ jsx("kbd", {
|
|
442
|
-
className: "hidden rounded-md border border-border bg-card px-1.5 py-px font-mono text-
|
|
560
|
+
className: "hidden rounded-md border border-border bg-card px-1.5 py-px font-mono text-xs sm:inline",
|
|
443
561
|
children: mac ? "⌘K" : "Ctrl K"
|
|
444
562
|
})
|
|
445
563
|
]
|
|
@@ -447,7 +565,7 @@ function TopBar() {
|
|
|
447
565
|
/* @__PURE__ */ jsxs("div", {
|
|
448
566
|
className: "ml-auto flex items-center gap-1",
|
|
449
567
|
children: [
|
|
450
|
-
/* @__PURE__ */ jsxs(Link, {
|
|
568
|
+
!setupOnly && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs(Link, {
|
|
451
569
|
to: "/attention",
|
|
452
570
|
"aria-current": attentionActive ? "page" : void 0,
|
|
453
571
|
className: navButtonClass(attentionActive),
|
|
@@ -473,94 +591,131 @@ function TopBar() {
|
|
|
473
591
|
]
|
|
474
592
|
})] })
|
|
475
593
|
]
|
|
594
|
+
}), /* @__PURE__ */ jsx(PlaceLink, {
|
|
595
|
+
to: "/agents",
|
|
596
|
+
label: "Manage",
|
|
597
|
+
icon: LayoutGrid,
|
|
598
|
+
roots: MANAGE_PATHS
|
|
599
|
+
})] }),
|
|
600
|
+
/* @__PURE__ */ jsx(PlaceLink, {
|
|
601
|
+
to: "/config",
|
|
602
|
+
label: "Setup",
|
|
603
|
+
icon: Settings2,
|
|
604
|
+
roots: SETUP_PATHS
|
|
476
605
|
}),
|
|
477
|
-
/* @__PURE__ */
|
|
478
|
-
asChild: true,
|
|
479
|
-
children: /* @__PURE__ */ jsxs("button", {
|
|
480
|
-
type: "button",
|
|
481
|
-
className: navButtonClass(manageActive),
|
|
482
|
-
"aria-label": "Manage menu",
|
|
483
|
-
children: [
|
|
484
|
-
/* @__PURE__ */ jsx(SlidersHorizontal, {
|
|
485
|
-
className: "size-4 shrink-0",
|
|
486
|
-
"aria-hidden": "true"
|
|
487
|
-
}),
|
|
488
|
-
/* @__PURE__ */ jsx("span", {
|
|
489
|
-
className: "hidden sm:inline",
|
|
490
|
-
children: "Manage"
|
|
491
|
-
}),
|
|
492
|
-
/* @__PURE__ */ jsx(ChevronDown, {
|
|
493
|
-
className: "size-3 shrink-0 text-muted-foreground",
|
|
494
|
-
"aria-hidden": "true"
|
|
495
|
-
})
|
|
496
|
-
]
|
|
497
|
-
})
|
|
498
|
-
}), /* @__PURE__ */ jsx(DropdownMenu.Portal, { children: /* @__PURE__ */ jsx(DropdownMenu.Content, {
|
|
499
|
-
align: "end",
|
|
500
|
-
sideOffset: 8,
|
|
501
|
-
collisionPadding: 12,
|
|
502
|
-
className: "z-50 w-[min(21rem,calc(100vw-1.5rem))] rounded-xl border border-border bg-popover p-1.5 text-popover-foreground shadow-baziu-lg outline-none data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
503
|
-
children: MANAGE_LINKS.map((link) => {
|
|
504
|
-
const ItemIcon = link.icon;
|
|
505
|
-
const itemActive = pathname === link.href || pathname.startsWith(`${link.href}/`);
|
|
506
|
-
return /* @__PURE__ */ jsx(DropdownMenu.Item, {
|
|
507
|
-
asChild: true,
|
|
508
|
-
children: /* @__PURE__ */ jsxs("a", {
|
|
509
|
-
href: link.href,
|
|
510
|
-
"aria-current": itemActive ? "page" : void 0,
|
|
511
|
-
className: `flex cursor-pointer items-start gap-3 rounded-lg px-2.5 py-2.5 outline-none transition-colors focus:bg-accent focus:text-accent-foreground ${itemActive ? "bg-accent/70 text-accent-foreground" : "text-foreground"}`,
|
|
512
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
513
|
-
className: "mt-0.5 flex size-7 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground",
|
|
514
|
-
children: /* @__PURE__ */ jsx(ItemIcon, {
|
|
515
|
-
className: "size-3.5",
|
|
516
|
-
"aria-hidden": "true"
|
|
517
|
-
})
|
|
518
|
-
}), /* @__PURE__ */ jsxs("span", {
|
|
519
|
-
className: "min-w-0 flex-1",
|
|
520
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
521
|
-
className: "block text-sm font-semibold",
|
|
522
|
-
children: link.label
|
|
523
|
-
}), /* @__PURE__ */ jsx("span", {
|
|
524
|
-
className: "mt-0.5 block text-xs leading-5 text-muted-foreground",
|
|
525
|
-
children: link.description
|
|
526
|
-
})]
|
|
527
|
-
})]
|
|
528
|
-
})
|
|
529
|
-
}, link.href);
|
|
530
|
-
})
|
|
531
|
-
}) })] }),
|
|
532
|
-
/* @__PURE__ */ jsx(ThemeToggle, {}),
|
|
533
|
-
/* @__PURE__ */ jsx("button", {
|
|
534
|
-
type: "button",
|
|
535
|
-
onClick: () => void logout(),
|
|
536
|
-
"aria-label": "Log out",
|
|
537
|
-
title: "Log out",
|
|
538
|
-
className: "unstyled inline-flex h-9 w-9 items-center justify-center rounded-lg text-mocha hover:bg-ivory hover:text-sapphire",
|
|
539
|
-
children: /* @__PURE__ */ jsx(LogOut, {
|
|
540
|
-
className: "h-4 w-4",
|
|
541
|
-
"aria-hidden": "true"
|
|
542
|
-
})
|
|
543
|
-
})
|
|
606
|
+
/* @__PURE__ */ jsx(SessionMenu, {})
|
|
544
607
|
]
|
|
545
608
|
}),
|
|
546
|
-
logoutError && /* @__PURE__ */ jsx("p", {
|
|
547
|
-
role: "alert",
|
|
548
|
-
className: "m-0 basis-full rounded-lg bg-danger/10 px-3 py-2 text-sm text-danger",
|
|
549
|
-
children: logoutError
|
|
550
|
-
}),
|
|
551
609
|
/* @__PURE__ */ jsx(JumpPalette, {
|
|
552
610
|
open: paletteOpen,
|
|
553
|
-
onClose: () => setPaletteOpen(false)
|
|
611
|
+
onClose: () => setPaletteOpen(false),
|
|
612
|
+
onShowShortcuts: () => setShortcutsOpen(true)
|
|
613
|
+
}),
|
|
614
|
+
shortcutsOpen && /* @__PURE__ */ jsx(ShortcutsDialog, {
|
|
615
|
+
mac,
|
|
616
|
+
onClose: () => setShortcutsOpen(false)
|
|
554
617
|
})
|
|
555
618
|
]
|
|
556
619
|
});
|
|
557
620
|
}
|
|
621
|
+
function PlaceLink({ to, label, icon: Icon, roots }) {
|
|
622
|
+
const active = under(useRouterState({ select: (state) => state.location.pathname }), roots);
|
|
623
|
+
return /* @__PURE__ */ jsxs(Link, {
|
|
624
|
+
to,
|
|
625
|
+
"aria-current": active ? "page" : void 0,
|
|
626
|
+
"aria-label": label,
|
|
627
|
+
className: navButtonClass(active),
|
|
628
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
629
|
+
className: "size-4 shrink-0",
|
|
630
|
+
"aria-hidden": "true"
|
|
631
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
632
|
+
className: "hidden sm:inline",
|
|
633
|
+
children: label
|
|
634
|
+
})]
|
|
635
|
+
});
|
|
636
|
+
}
|
|
637
|
+
/** Theme and Log out: things about this browser's session rather than places to go. */
|
|
638
|
+
function SessionMenu() {
|
|
639
|
+
const mode = useThemeMode();
|
|
640
|
+
const [error, setError] = useState(null);
|
|
641
|
+
async function logout() {
|
|
642
|
+
setError(null);
|
|
643
|
+
try {
|
|
644
|
+
await api("/api/logout", { method: "POST" });
|
|
645
|
+
window.location.assign("/login");
|
|
646
|
+
} catch (cause) {
|
|
647
|
+
setError(errorMessage(cause));
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs(DropdownMenu.Root, { children: [/* @__PURE__ */ jsx(DropdownMenu.Trigger, {
|
|
651
|
+
asChild: true,
|
|
652
|
+
children: /* @__PURE__ */ jsx("button", {
|
|
653
|
+
type: "button",
|
|
654
|
+
"aria-label": "Theme and log out",
|
|
655
|
+
title: "Theme and log out",
|
|
656
|
+
className: "unstyled inline-flex h-9 w-9 items-center justify-center rounded-lg border border-transparent text-mocha transition-colors hover:border-frost hover:bg-ivory hover:text-sapphire data-[state=open]:border-sapphire-light data-[state=open]:bg-sapphire-glow data-[state=open]:text-sapphire",
|
|
657
|
+
children: /* @__PURE__ */ jsx(UserRound, {
|
|
658
|
+
className: "size-4",
|
|
659
|
+
"aria-hidden": "true"
|
|
660
|
+
})
|
|
661
|
+
})
|
|
662
|
+
}), /* @__PURE__ */ jsx(DropdownMenu.Portal, { children: /* @__PURE__ */ jsxs(DropdownMenu.Content, {
|
|
663
|
+
align: "end",
|
|
664
|
+
sideOffset: 8,
|
|
665
|
+
collisionPadding: 12,
|
|
666
|
+
className: "z-50 w-64 rounded-xl border border-border bg-popover p-1.5 text-popover-foreground shadow-baziu-lg outline-none data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
667
|
+
children: [
|
|
668
|
+
/* @__PURE__ */ jsx(DropdownMenu.Label, {
|
|
669
|
+
className: "px-2.5 pt-1.5 pb-1 text-xs font-semibold text-muted-foreground",
|
|
670
|
+
children: "Theme"
|
|
671
|
+
}),
|
|
672
|
+
/* @__PURE__ */ jsx(DropdownMenu.RadioGroup, {
|
|
673
|
+
value: mode,
|
|
674
|
+
onValueChange: (value) => setThemeMode(value),
|
|
675
|
+
children: THEME_MODES.map((option) => {
|
|
676
|
+
const { label, icon: Icon } = THEME_LABELS[option];
|
|
677
|
+
return /* @__PURE__ */ jsxs(DropdownMenu.RadioItem, {
|
|
678
|
+
value: option,
|
|
679
|
+
className: "flex cursor-pointer items-center gap-2.5 rounded-lg px-2.5 py-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground",
|
|
680
|
+
children: [
|
|
681
|
+
/* @__PURE__ */ jsx(Icon, {
|
|
682
|
+
className: "size-4 text-muted-foreground",
|
|
683
|
+
"aria-hidden": "true"
|
|
684
|
+
}),
|
|
685
|
+
/* @__PURE__ */ jsx("span", {
|
|
686
|
+
className: "flex-1",
|
|
687
|
+
children: label
|
|
688
|
+
}),
|
|
689
|
+
/* @__PURE__ */ jsx(DropdownMenu.ItemIndicator, { children: /* @__PURE__ */ jsx(Check, {
|
|
690
|
+
className: "size-4 text-sapphire",
|
|
691
|
+
"aria-hidden": "true"
|
|
692
|
+
}) })
|
|
693
|
+
]
|
|
694
|
+
}, option);
|
|
695
|
+
})
|
|
696
|
+
}),
|
|
697
|
+
/* @__PURE__ */ jsx(DropdownMenu.Separator, { className: "my-1.5 h-px bg-border" }),
|
|
698
|
+
/* @__PURE__ */ jsxs(DropdownMenu.Item, {
|
|
699
|
+
onSelect: () => void logout(),
|
|
700
|
+
className: "flex cursor-pointer items-center gap-2.5 rounded-lg px-2.5 py-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground",
|
|
701
|
+
children: [/* @__PURE__ */ jsx(LogOut, {
|
|
702
|
+
className: "size-4 text-muted-foreground",
|
|
703
|
+
"aria-hidden": "true"
|
|
704
|
+
}), "Log out"]
|
|
705
|
+
})
|
|
706
|
+
]
|
|
707
|
+
}) })] }), error && /* @__PURE__ */ jsxs("p", {
|
|
708
|
+
role: "alert",
|
|
709
|
+
className: "absolute top-full right-0 z-40 m-0 mt-1 rounded-lg bg-danger/10 px-3 py-2 text-sm text-danger",
|
|
710
|
+
children: ["Could not log out: ", error]
|
|
711
|
+
})] });
|
|
712
|
+
}
|
|
558
713
|
function navButtonClass(active) {
|
|
559
714
|
return `unstyled inline-flex h-9 shrink-0 items-center justify-center gap-1.5 rounded-lg border px-2 text-sm font-semibold transition-colors sm:px-2.5 ${active ? "border-sapphire-light bg-sapphire-glow text-sapphire shadow-baziu-sm" : "border-transparent text-mocha hover:border-frost hover:bg-ivory hover:text-sapphire"}`;
|
|
560
715
|
}
|
|
561
716
|
//#endregion
|
|
562
717
|
//#region src/styles.css?url
|
|
563
|
-
var styles_default = "/assets/styles-
|
|
718
|
+
var styles_default = "/assets/styles-C3CDSGAr.css";
|
|
564
719
|
//#endregion
|
|
565
720
|
//#region src/routes/__root.tsx
|
|
566
721
|
var THEME_INIT_SCRIPT = `(function(){try{var t=localStorage.getItem('baziu-theme');var sd=window.matchMedia&&window.matchMedia('(prefers-color-scheme: dark)').matches;var d=t==='dark'||((t===null||t==='system')&&sd);document.documentElement.classList.toggle('dark',d);}catch(e){}})();`;
|
|
@@ -634,35 +789,38 @@ function RootComponent() {
|
|
|
634
789
|
className: "sr-only z-[100] rounded-lg bg-primary px-4 py-2 font-semibold text-primary-foreground focus:not-sr-only focus:fixed focus:left-3 focus:top-3",
|
|
635
790
|
children: "Skip to main content"
|
|
636
791
|
}),
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
children:
|
|
640
|
-
className: "
|
|
641
|
-
children: /* @__PURE__ */ jsx(
|
|
642
|
-
}), /* @__PURE__ */ jsx("main", {
|
|
643
|
-
id: "main-content",
|
|
644
|
-
tabIndex: -1,
|
|
645
|
-
className: "mx-auto min-h-0 w-full max-w-[1600px] flex-1 overflow-clip px-3 pb-3 sm:px-5 sm:pb-5",
|
|
646
|
-
children: /* @__PURE__ */ jsx(Outlet, {})
|
|
647
|
-
})]
|
|
648
|
-
}) : /* @__PURE__ */ jsxs("div", {
|
|
649
|
-
className: "flex min-h-dvh flex-col",
|
|
650
|
-
children: [
|
|
651
|
-
/* @__PURE__ */ jsx("div", {
|
|
792
|
+
/* @__PURE__ */ jsx(AttentionCountProvider, {
|
|
793
|
+
enabled: !isLogin && pathname !== "/welcome",
|
|
794
|
+
children: /* @__PURE__ */ jsx(PageTitleProvider, { children: isLogin ? /* @__PURE__ */ jsx(Outlet, {}) : isWorkspace ? /* @__PURE__ */ jsxs("div", {
|
|
795
|
+
className: "flex h-dvh flex-col",
|
|
796
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
652
797
|
className: "px-3 sm:px-5",
|
|
653
798
|
children: /* @__PURE__ */ jsx(TopBar, {})
|
|
654
|
-
}),
|
|
655
|
-
/* @__PURE__ */ jsx("main", {
|
|
799
|
+
}), /* @__PURE__ */ jsx("main", {
|
|
656
800
|
id: "main-content",
|
|
657
801
|
tabIndex: -1,
|
|
658
|
-
className: "mx-auto w-full max-w-[
|
|
802
|
+
className: "mx-auto min-h-0 w-full max-w-[1600px] flex-1 overflow-clip px-3 pb-3 sm:px-5 sm:pb-5",
|
|
659
803
|
children: /* @__PURE__ */ jsx(Outlet, {})
|
|
660
|
-
})
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
804
|
+
})]
|
|
805
|
+
}) : /* @__PURE__ */ jsxs("div", {
|
|
806
|
+
className: "flex min-h-dvh flex-col",
|
|
807
|
+
children: [
|
|
808
|
+
/* @__PURE__ */ jsx("div", {
|
|
809
|
+
className: "px-3 sm:px-5",
|
|
810
|
+
children: /* @__PURE__ */ jsx(TopBar, {})
|
|
811
|
+
}),
|
|
812
|
+
/* @__PURE__ */ jsx("main", {
|
|
813
|
+
id: "main-content",
|
|
814
|
+
tabIndex: -1,
|
|
815
|
+
className: "mx-auto w-full max-w-[1500px] flex-1 px-4 py-9 sm:px-6 sm:py-12",
|
|
816
|
+
children: /* @__PURE__ */ jsx(Outlet, {})
|
|
817
|
+
}),
|
|
818
|
+
/* @__PURE__ */ jsx("div", {
|
|
819
|
+
className: "px-4 sm:px-6",
|
|
820
|
+
children: /* @__PURE__ */ jsx(Footer, {})
|
|
821
|
+
})
|
|
822
|
+
]
|
|
823
|
+
}) })
|
|
666
824
|
}),
|
|
667
825
|
/* @__PURE__ */ jsx(Scripts, {})
|
|
668
826
|
]
|
|
@@ -766,7 +924,7 @@ var Route = createFileRoute("/api/$")({ server: { handlers: {
|
|
|
766
924
|
} } });
|
|
767
925
|
//#endregion
|
|
768
926
|
//#region src/routeTree.gen.ts
|
|
769
|
-
var WelcomeRoute = Route$
|
|
927
|
+
var WelcomeRoute = Route$5.update({
|
|
770
928
|
id: "/welcome",
|
|
771
929
|
path: "/welcome",
|
|
772
930
|
getParentRoute: () => Route$2
|
|
@@ -776,7 +934,7 @@ var LoginRoute = Route$3.update({
|
|
|
776
934
|
path: "/login",
|
|
777
935
|
getParentRoute: () => Route$2
|
|
778
936
|
});
|
|
779
|
-
var IndexRoute = Route$
|
|
937
|
+
var IndexRoute = Route$4.update({
|
|
780
938
|
id: "/",
|
|
781
939
|
path: "/",
|
|
782
940
|
getParentRoute: () => Route$2
|