bazilion 0.54.0 → 0.56.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 +201 -41
- package/dist/cli.js.map +1 -1
- package/dist/daemon.js +1561 -522
- package/dist/daemon.js.map +1 -1
- package/dist/web/client/assets/AddProviderDialog-DZ9mXFdq.js +1 -0
- package/dist/web/client/assets/AgentTemplateParts-BfG3a-ri.js +1 -0
- package/dist/web/client/assets/{Button-UiegBKOK.js → Button-CoKQRO-s.js} +1 -1
- package/dist/web/client/assets/ConfigPage-Ch-DSJUO.js +1 -0
- package/dist/web/client/assets/ConfirmDialog-B_jXAPmh.js +1 -0
- package/dist/web/client/assets/ConnectionsView-D1Liebtf.js +1 -0
- package/dist/web/client/assets/ManagePage-kd7iWYEL.js +1 -0
- package/dist/web/client/assets/SectionTabs-Dc0bNn-J.js +1 -0
- package/dist/web/client/assets/{Segmented-MYKKTuZO.js → Segmented-iylzLwE6.js} +1 -1
- package/dist/web/client/assets/SkillsParts-C5T7sYDA.js +1 -0
- package/dist/web/client/assets/{SpawnTeamModal-DG5UbJNK.js → SpawnTeamModal-DatFF4f_.js} +1 -1
- package/dist/web/client/assets/{TeamForm-DGlxWv4e.js → TeamForm-l-N_PYeE.js} +1 -1
- package/dist/web/client/assets/TeamThread-BWmIQiAh.js +1 -0
- package/dist/web/client/assets/{UnsavedChangesGuard-BmdwLH99.js → UnsavedChangesGuard-vQBdMl8h.js} +1 -1
- package/dist/web/client/assets/_id-C6SADaiD.js +1 -0
- package/dist/web/client/assets/_id-CC9r0qsr.js +1 -0
- package/dist/web/client/assets/{access-C8d8vaQ6.js → access-BbQFbTPh.js} +1 -1
- package/dist/web/client/assets/{agent-actions-BgE9fKHH.js → agent-actions-B-9KIwn6.js} +1 -1
- package/dist/web/client/assets/agents-BXwzmHu8.js +1 -0
- package/dist/web/client/assets/agents-BtETzVIY.js +1 -0
- package/dist/web/client/assets/arrow-right-BqqfPqVi.js +1 -0
- package/dist/web/client/assets/attention-BMrZJ9ui.js +1 -0
- package/dist/web/client/assets/{bot-Bb--PFVU.js → bot-BHky7KAX.js} +1 -1
- package/dist/web/client/assets/chart-column-DTsDbzL0.js +1 -0
- package/dist/web/client/assets/chevron-right-D1shxvdo.js +1 -0
- package/dist/web/client/assets/config-B2ZDYo52.js +1 -0
- package/dist/web/client/assets/createLucideIcon-CZHSSDYA.js +1 -0
- package/dist/web/client/assets/{download-C4t9l5wR.js → download-Dr0PgyMr.js} +1 -1
- package/dist/web/client/assets/es2015-D1pnOGPG.js +41 -0
- package/dist/web/client/assets/{file-text-DzbjpYrV.js → file-text-D6OTHixJ.js} +1 -1
- package/dist/web/client/assets/{images-DSYgPKM7.js → images-BULrW-FC.js} +1 -1
- package/dist/web/client/assets/index-B-N6NIX4.js +14 -0
- package/dist/web/client/assets/{key-round-BpK4-E3T.js → key-round-DmSZN0Kq.js} +1 -1
- package/dist/web/client/assets/{list-checks-JNXcmws9.js → list-checks-DdTdAQXS.js} +1 -1
- package/dist/web/client/assets/login-DM3q-V4R.js +1 -0
- package/dist/web/client/assets/{manage-SRGSx8n2.js → manage-R57MUzsY.js} +1 -1
- package/dist/web/client/assets/{mcp-BUWu4TvS.js → mcp-CSHrVH1t.js} +1 -1
- package/dist/web/client/assets/{message-square-DM2MP9vF.js → message-square-B_pULba_.js} +1 -1
- package/dist/web/client/assets/{network-BJ4iPjQO.js → network-BqmVqC4_.js} +1 -1
- package/dist/web/client/assets/parts-68zf8Fgw.js +1 -0
- package/dist/web/client/assets/plus-CEKaHPBw.js +1 -0
- package/dist/web/client/assets/preload-helper-CZOd_z6l.js +1 -0
- package/dist/web/client/assets/routes-DOoeKVwr.js +85 -0
- package/dist/web/client/assets/skills-CPZftp9O.js +1 -0
- package/dist/web/client/assets/{square-terminal-Dmm6cV-G.js → square-terminal-CYfGBHPC.js} +1 -1
- package/dist/web/client/assets/{style-CA2GAk9b.js → style-Bm9QsFpy.js} +1 -1
- package/dist/web/client/assets/styles-B-kTTvCo.css +2 -0
- package/dist/web/client/assets/{system-zQ0NnQML.js → system-Dd2P9eqE.js} +1 -1
- package/dist/web/client/assets/teams-7FEpSZg1.js +1 -0
- package/dist/web/client/assets/teams-ClirFbDV.js +1 -0
- package/dist/web/client/assets/telegram-BJnT5THs.js +1 -0
- package/dist/web/client/assets/tools-DqNXLMpc.js +1 -0
- package/dist/web/client/assets/usage-BC_TStVj.js +1 -0
- package/dist/web/client/assets/{use-resource-CQaIZbpy.js → use-resource-Bn0Sx7r6.js} +1 -1
- package/dist/web/client/assets/{users-round-BJrym3FG.js → users-round-cxQ5HF-C.js} +1 -1
- package/dist/web/client/assets/welcome-g8wtn_or.js +1 -0
- package/dist/web/client/assets/{wrench-GbE1M1RJ.js → wrench-BLEJjETg.js} +1 -1
- package/dist/web/server/assets/{AddProviderDialog-Nc5mc_P6.js → AddProviderDialog-DtkjBMv4.js} +5 -2
- package/dist/web/server/assets/AgentAvatar-8gTAy_tP.js +37 -0
- package/dist/web/server/assets/{AgentTemplateParts-DZK_r3nQ.js → AgentTemplateParts-CxWyovvM.js} +6 -2
- package/dist/web/server/assets/Button-Dsnw22OF.js +17 -0
- package/dist/web/server/assets/{ConfigPage-CxzL-gTm.js → ConfigPage-usZi48Zr.js} +2 -2
- package/dist/web/server/assets/{ConfirmDialog-4xeCXKHe.js → ConfirmDialog-DAcSBHkT.js} +3 -1
- package/dist/web/server/assets/{ConnectionsView-B02FjNsM.js → ConnectionsView-Dy6uYSRI.js} +9 -7
- package/dist/web/server/assets/Dialog-DTeF-nOZ.js +85 -0
- package/dist/web/server/assets/{ManagePage-BfCWE8Lj.js → ManagePage-Dy1EdovO.js} +2 -2
- package/dist/web/server/assets/{SectionTabs-CWQ5orUW.js → SectionTabs-BVrMn76H.js} +2 -1
- package/dist/web/server/assets/{SkillsParts-D58l8voo.js → SkillsParts-Cw05b3al.js} +6 -2
- package/dist/web/server/assets/SpawnDialog-BAE8W91z.js +125 -0
- package/dist/web/server/assets/{SpawnTeamModal-RjzAeX_Q.js → SpawnTeamModal-CgBY0HuN.js} +6 -2
- package/dist/web/server/assets/{TeamForm-DdOgIMiV.js → TeamForm-JyO5xJXX.js} +6 -2
- package/dist/web/server/assets/{TeamThread-D-PvO3fu.js → TeamThread-5o48EbXL.js} +52 -4
- package/dist/web/server/assets/{UnsavedChangesGuard-Bb5frygQ.js → UnsavedChangesGuard-CJQGu45L.js} +1 -1
- package/dist/web/server/assets/{_id-C1_l6oSR.js → _id-BE_RSvuN.js} +14 -9
- package/dist/web/server/assets/{_id-CHvYQhWt.js → _id-BNvm89oJ.js} +2 -2
- package/dist/web/server/assets/{_id-De3Bm0SG.js → _id-BW6sVrvw.js} +1 -1
- package/dist/web/server/assets/{_id-BPjVkcNb.js → _id-BfjTS4JO.js} +15 -9
- package/dist/web/server/assets/{_id-BKzOw78O.js → _id-BpumuCYL.js} +1 -1
- package/dist/web/server/assets/{_id-BUfy-GwH.js → _id-C54t_nX6.js} +2 -2
- package/dist/web/server/assets/_tanstack-start-manifest_v-BPwQX_5b.js +275 -0
- package/dist/web/server/assets/{access-CNfvQ3NB.js → access-6FWih7nC.js} +7 -4
- package/dist/web/server/assets/{access-WWspT0v4.js → access-BhAMfi7U.js} +1 -1
- package/dist/web/server/assets/{access-Cm_izIIC.js → access-DEyq3uP_.js} +2 -2
- package/dist/web/server/assets/activity-Czfq-5_F.js +471 -0
- package/dist/web/server/assets/{agent-actions-COnfW5AU.js → agent-actions-ChH7Mne4.js} +1 -1
- package/dist/web/server/assets/{agents-CRtMfKqX.js → agents-3hBjrd8B.js} +1 -1
- package/dist/web/server/assets/{agents-NOkh61dV.js → agents-BXuglv4G.js} +12 -6
- package/dist/web/server/assets/{agents-C7UmTjfO.js → agents-DhenbitX.js} +2 -2
- package/dist/web/server/assets/{agents-D0hfGIMK.js → agents-KJcDMj0Y.js} +9 -6
- package/dist/web/server/assets/{agents-DzpqlIuJ.js → agents-ncyhVx-T.js} +2 -2
- package/dist/web/server/assets/{agents-DQowl6Ly.js → agents-rTDlRZa5.js} +1 -1
- package/dist/web/server/assets/{attention-Cx9ZWPOO.js → attention-CDdOCOio.js} +3 -2
- package/dist/web/server/assets/{attention-CRvxt22X.js → attention-DM__BzWY.js} +24 -9
- package/dist/web/server/assets/{attention-CgWhXjX7.js → attention-X0U6ZmiA.js} +2 -1
- package/dist/web/server/assets/{auth-dJnrFW6y.js → auth-BexhV8Yq.js} +1 -1
- package/dist/web/server/assets/{config-B5CS8juO.js → config-Cld8Q8N7.js} +2 -2
- package/dist/web/server/assets/{config-X7qWbbpH.js → config-Cx5ri2DL2.js} +1 -1
- package/dist/web/server/assets/{config-D117117T.js → config-DpgYAXQ3.js} +9 -6
- package/dist/web/server/assets/createSsrRpc-6LHNEsSK.js +16 -0
- package/dist/web/server/assets/{daemon-client-B_ZRIIrT.js → daemon-client-RxAllljf.js} +1 -1
- package/dist/web/server/assets/form-BEjeiSy3.js +416 -0
- package/dist/web/server/assets/live-DbJeq6KP.js +263 -0
- package/dist/web/server/assets/{login-va4EtvA8.js → login-BJdJ219n.js} +1 -1
- package/dist/web/server/assets/{login-IF0Gbsuq.js → login-C4lL4AxI.js} +2 -2
- package/dist/web/server/assets/{manage-Ce6cI4eW.js → manage-C6ucNYZW.js} +2 -1
- package/dist/web/server/assets/{mcp-C96PBxpb.js → mcp-BXnWQOwM.js} +7 -4
- package/dist/web/server/assets/{mcp-C97uAZe1.js → mcp-C8VLspco.js} +1 -1
- package/dist/web/server/assets/{mcp-Bm9U6x7N.js → mcp-DwCzj7eO.js} +2 -2
- package/dist/web/server/assets/open-groups-BMGYUTtY.js +12 -0
- package/dist/web/server/assets/{page-title-CwcbXMhx.js → page-title-PTpFHXWo.js} +6 -3
- package/dist/web/server/assets/parts-k9M-atPa.js +436 -0
- package/dist/web/server/assets/{router-8Iq19GOz.js → router-BttfLktO.js} +354 -114
- package/dist/web/server/assets/{routes-Kwam6JmS.js → routes-A7UcreVX.js} +9 -6
- package/dist/web/server/assets/{routes-BLo-fWbQ.js → routes-B9jw-MJ8.js} +1286 -331
- package/dist/web/server/assets/{routes-BXvYYFrN.js → routes-BX2FV8rS.js} +3 -3
- package/dist/web/server/assets/{skills-DSezIdDc.js → skills-BVAH93cd.js} +8 -6
- package/dist/web/server/assets/{skills-DWzlT_hC.js → skills-Cd5Cfdaz.js} +1 -1
- package/dist/web/server/assets/{skills-BqCnA-74.js → skills-y3GsyKce.js} +2 -2
- package/dist/web/server/assets/src-vrZVrV9u.js +103 -0
- package/dist/web/server/assets/{start-DhW7sy23.js → start-Dl8gQ-95.js} +1 -1
- package/dist/web/server/assets/{style-C2hIPY_Y.js → style-BQ3H9I7Y.js} +1 -1
- package/dist/web/server/assets/{system-CcLCmkIC.js → system-BJPKqM6b.js} +2 -2
- package/dist/web/server/assets/{system-E0VePdzO.js → system-C7mejQSc.js} +3 -3
- package/dist/web/server/assets/{system-D3th6n2E.js → system-LsLcuVzY.js} +1 -1
- package/dist/web/server/assets/{teams-CdCmBJIj.js → teams-B6gbflsZ.js} +10 -6
- package/dist/web/server/assets/{teams-CQVV18D3.js → teams-C7kXMNgc.js} +10 -6
- package/dist/web/server/assets/{teams-BopOP4x7.js → teams-CPXoTggb.js} +1 -1
- package/dist/web/server/assets/{teams-70u1XQTr.js → teams-CeLLd2Mf.js} +1 -1
- package/dist/web/server/assets/{teams-DScFp8mK.js → teams-CiX8LUQo.js} +2 -2
- package/dist/web/server/assets/{teams-DxA-vnzY.js → teams-D-XdIkCr.js} +2 -2
- package/dist/web/server/assets/{telegram-CGol0CKX2.js → telegram-D7TW3LNZ.js} +1 -1
- package/dist/web/server/assets/{telegram-DJ8s_91Y.js → telegram-D8_V7_sW.js} +286 -272
- package/dist/web/server/assets/{telegram-DR7xijeS.js → telegram-DA2dwLID.js} +2 -2
- package/dist/web/server/assets/{tools-V6kezUpL.js → tools-CckcG9Jl.js} +5 -3
- package/dist/web/server/assets/{tools-CsH9DI-4.js → tools-CluiJywK.js} +2 -2
- package/dist/web/server/assets/{tools-C-wwWjLI.js → tools-D1BBVkRh.js} +1 -1
- package/dist/web/server/assets/usage-CrYyvPgf.js +46 -0
- package/dist/web/server/assets/usage-PNNb3pPj.js +465 -0
- package/dist/web/server/assets/{use-resource-CjcJwn7F.js → use-resource-BUA9qGGY.js} +1 -1
- package/dist/web/server/assets/{welcome-CxXMI4HI.js → welcome-CUTYf8UG.js} +1 -1
- package/dist/web/server/assets/{welcome-Ya8TkL4v.js → welcome-CYhh3iUU.js} +8 -6
- package/dist/web/server/assets/{welcome-BpmcD-ia.js → welcome-CwzLt6Rp.js} +2 -2
- package/dist/web/server/assets/workspace-0XPILV1W.js +82 -0
- package/dist/web/server/server.js +20 -20
- package/dist/web-server.js +4 -0
- package/dist/web-server.js.map +1 -1
- package/dist/worker.js +40 -15
- package/dist/worker.js.map +1 -1
- package/package.json +4 -4
- package/dist/web/client/assets/AddProviderDialog-CkwSq3C7.js +0 -1
- package/dist/web/client/assets/AgentTemplateParts-CEn_4qVs.js +0 -1
- package/dist/web/client/assets/ConfigPage-CUbHBhzx.js +0 -1
- package/dist/web/client/assets/ConfirmDialog-VqBOFZEp.js +0 -1
- package/dist/web/client/assets/ConnectionsView-ByARMcWP.js +0 -1
- package/dist/web/client/assets/ManagePage-BJWZd1ts.js +0 -1
- package/dist/web/client/assets/SectionTabs-ViZKm3-B.js +0 -1
- package/dist/web/client/assets/SkillsParts-UvNK5SYP.js +0 -1
- package/dist/web/client/assets/TeamThread-mkwODO0S.js +0 -1
- package/dist/web/client/assets/_id-CvcxNmBH.js +0 -1
- package/dist/web/client/assets/_id-UyBk7gRl.js +0 -1
- package/dist/web/client/assets/agents-CgtzqBpD.js +0 -1
- package/dist/web/client/assets/agents-D7W4BT8r.js +0 -1
- package/dist/web/client/assets/arrow-right-D0HKRb7U.js +0 -1
- package/dist/web/client/assets/attention-D9mQWoKt.js +0 -1
- package/dist/web/client/assets/chevron-right-bs0TUSl2.js +0 -1
- package/dist/web/client/assets/config-Dw6GWf38.js +0 -1
- package/dist/web/client/assets/createLucideIcon-DkniuEtD.js +0 -1
- package/dist/web/client/assets/index-YW0gXPfk.js +0 -14
- package/dist/web/client/assets/login-DcQJk5-U.js +0 -1
- package/dist/web/client/assets/parts-LZxl9Gvc.js +0 -41
- package/dist/web/client/assets/plus-CLGNN5QX.js +0 -1
- package/dist/web/client/assets/routes-BxIIyGho.js +0 -85
- package/dist/web/client/assets/skills-C7DzIwFJ.js +0 -1
- package/dist/web/client/assets/styles-C3CDSGAr.css +0 -2
- package/dist/web/client/assets/teams-BEIJHObN.js +0 -1
- package/dist/web/client/assets/teams-DlOc7Ods.js +0 -1
- package/dist/web/client/assets/telegram-DKHq5DpE.js +0 -1
- package/dist/web/client/assets/tools-BKIpLaiC.js +0 -1
- package/dist/web/client/assets/welcome-CyS4Hrd-.js +0 -1
- package/dist/web/server/assets/Rail-3gbidhyv.js +0 -605
- package/dist/web/server/assets/SpawnDialog-MJWwppgC.js +0 -1648
- package/dist/web/server/assets/_tanstack-start-manifest_v-CR3jm1nY.js +0 -256
- package/dist/web/server/assets/createSsrRpc-CwTd0zrB.js +0 -72
- package/dist/web/server/assets/public-origin-BpDkdS5Q.js +0 -34
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { n as createServerFn } from "../server.js";
|
|
2
|
-
import { t as createSsrRpc } from "./createSsrRpc-
|
|
2
|
+
import { t as createSsrRpc } from "./createSsrRpc-6LHNEsSK.js";
|
|
3
3
|
import { createFileRoute, lazyRouteComponent } from "@tanstack/react-router";
|
|
4
4
|
//#region src/routes/config/tools.tsx
|
|
5
|
-
var $$splitComponentImporter = () => import("./tools-
|
|
5
|
+
var $$splitComponentImporter = () => import("./tools-CckcG9Jl.js");
|
|
6
6
|
var fetchTools = createServerFn({ method: "GET" }).handler(createSsrRpc("946c6cbff3f55931c3fb28c971d20b18b4b8a9f25417a5d1afc0550d7afa393b"));
|
|
7
7
|
var Route = createFileRoute("/config/tools")({
|
|
8
8
|
loader: () => fetchTools(),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as createServerFn } from "../server.js";
|
|
2
2
|
import { t as createServerRpc } from "./createServerRpc-B7Yr1K8i.js";
|
|
3
|
-
import { n as daemonClient } from "./daemon-client-
|
|
3
|
+
import { n as daemonClient } from "./daemon-client-RxAllljf.js";
|
|
4
4
|
//#region src/routes/config/tools.tsx?tss-serverfn-split
|
|
5
5
|
var fetchTools_createServerFn_handler = createServerRpc({
|
|
6
6
|
id: "946c6cbff3f55931c3fb28c971d20b18b4b8a9f25417a5d1afc0550d7afa393b",
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { createFileRoute, lazyRouteComponent } from "@tanstack/react-router";
|
|
2
|
+
//#region src/routes/usage/index.tsx?tsr-shared=1
|
|
3
|
+
var PERIODS = [
|
|
4
|
+
{
|
|
5
|
+
id: "1",
|
|
6
|
+
label: "Today"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
id: "7",
|
|
10
|
+
label: "7 days"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
id: "30",
|
|
14
|
+
label: "30 days"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
id: "90",
|
|
18
|
+
label: "90 days"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
id: "all",
|
|
22
|
+
label: "Everything"
|
|
23
|
+
}
|
|
24
|
+
];
|
|
25
|
+
/** The address's period: `?days=7` reads as the number 7, `?days=all` as text. */
|
|
26
|
+
function parseDays(value) {
|
|
27
|
+
const period = PERIODS.find((entry) => entry.id === String(value))?.id;
|
|
28
|
+
if (!period) return void 0;
|
|
29
|
+
return period === "all" ? "all" : Number(period);
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/routes/usage/index.tsx
|
|
33
|
+
var $$splitComponentImporter = () => import("./usage-PNNb3pPj.js");
|
|
34
|
+
var text = (value) => typeof value === "string" && value ? value : void 0;
|
|
35
|
+
/** The address's period: `?days=7` reads as the number 7, `?days=all` as text. */
|
|
36
|
+
var Route = createFileRoute("/usage/")({
|
|
37
|
+
validateSearch: (search) => ({
|
|
38
|
+
days: parseDays(search.days),
|
|
39
|
+
agent: text(search.agent),
|
|
40
|
+
team: text(search.team)
|
|
41
|
+
}),
|
|
42
|
+
component: lazyRouteComponent($$splitComponentImporter, "component")
|
|
43
|
+
});
|
|
44
|
+
/** The report, asked for in this browser's time zone (the server does not know it). */
|
|
45
|
+
//#endregion
|
|
46
|
+
export { PERIODS as n, parseDays as r, Route as t };
|
|
@@ -0,0 +1,465 @@
|
|
|
1
|
+
import { i as api } from "./live-DbJeq6KP.js";
|
|
2
|
+
import { n as formatTokens, r as usageSummary, t as formatCost } from "./src-vrZVrV9u.js";
|
|
3
|
+
import { t as Button } from "./Button-Dsnw22OF.js";
|
|
4
|
+
import { t as Segmented } from "./Segmented-3ZLdqa5U.js";
|
|
5
|
+
import { d as Chip, g as Notice, h as ListRow, i as CardEmpty, o as CardList, r as CardBody, t as Banner, y as SetupCard } from "./parts-k9M-atPa.js";
|
|
6
|
+
import { n as PERIODS, r as parseDays, t as Route } from "./usage-CrYyvPgf.js";
|
|
7
|
+
import { t as ManagePage } from "./ManagePage-Dy1EdovO.js";
|
|
8
|
+
import { useEffect, useId, useState } from "react";
|
|
9
|
+
import { Link, useNavigate } from "@tanstack/react-router";
|
|
10
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
import { BarChart3, Bot, Cpu, UsersRound } from "lucide-react";
|
|
12
|
+
//#region src/components/usage/DayChart.tsx
|
|
13
|
+
var HEIGHT = 160;
|
|
14
|
+
/** "Sun 22 Nov": a `YYYY-MM-DD` day in this browser's words. */
|
|
15
|
+
function dayLabel(day, options = {}) {
|
|
16
|
+
return (/* @__PURE__ */ new Date(`${day}T12:00:00Z`)).toLocaleDateString(void 0, {
|
|
17
|
+
weekday: "short",
|
|
18
|
+
day: "numeric",
|
|
19
|
+
month: "short",
|
|
20
|
+
timeZone: "UTC",
|
|
21
|
+
...options
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
var dayValue = (day, metric) => metric === "cost" ? day.cost : day.totalTokens;
|
|
25
|
+
var formatMetric = (value, metric) => metric === "cost" ? formatCost(value) : `${formatTokens(value)} tokens`;
|
|
26
|
+
function DayChart({ days, metric }) {
|
|
27
|
+
const [active, setActive] = useState(null);
|
|
28
|
+
const describedBy = useId();
|
|
29
|
+
const max = Math.max(...days.map((day) => dayValue(day, metric)), 0);
|
|
30
|
+
const shown = active === null ? null : days[active];
|
|
31
|
+
const total = days.reduce((sum, day) => sum + dayValue(day, metric), 0);
|
|
32
|
+
const peak = days.reduce((best, day) => !best || dayValue(day, metric) > dayValue(best, metric) ? day : best, null);
|
|
33
|
+
const first = days[0];
|
|
34
|
+
const last = days.at(-1);
|
|
35
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
36
|
+
className: "grid gap-2",
|
|
37
|
+
children: [
|
|
38
|
+
/* @__PURE__ */ jsxs("div", {
|
|
39
|
+
className: "flex items-baseline justify-between text-xs text-muted-foreground",
|
|
40
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
41
|
+
className: "tabular-nums",
|
|
42
|
+
children: max > 0 ? formatMetric(max, metric) : ""
|
|
43
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
44
|
+
"aria-hidden": "true",
|
|
45
|
+
className: "font-medium text-foreground",
|
|
46
|
+
children: shown ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
47
|
+
/* @__PURE__ */ jsx("strong", {
|
|
48
|
+
className: "font-semibold",
|
|
49
|
+
children: formatMetric(dayValue(shown, metric), metric)
|
|
50
|
+
}),
|
|
51
|
+
" ",
|
|
52
|
+
/* @__PURE__ */ jsx("span", {
|
|
53
|
+
className: "text-muted-foreground",
|
|
54
|
+
children: dayLabel(shown.day)
|
|
55
|
+
})
|
|
56
|
+
] }) : /* @__PURE__ */ jsx("span", {
|
|
57
|
+
className: "text-muted-foreground",
|
|
58
|
+
children: "Point at a day, or use the arrow keys"
|
|
59
|
+
})
|
|
60
|
+
})]
|
|
61
|
+
}),
|
|
62
|
+
/* @__PURE__ */ jsxs("div", {
|
|
63
|
+
role: "slider",
|
|
64
|
+
tabIndex: 0,
|
|
65
|
+
"aria-label": `${metric === "cost" ? "Spent" : "Tokens"} per day, ${formatMetric(total, metric)} in all${peak && dayValue(peak, metric) > 0 ? `; most on ${dayLabel(peak.day)}, ${formatMetric(dayValue(peak, metric), metric)}` : ""}`,
|
|
66
|
+
"aria-describedby": describedBy,
|
|
67
|
+
"aria-valuemin": 0,
|
|
68
|
+
"aria-valuemax": Math.max(days.length - 1, 0),
|
|
69
|
+
"aria-valuenow": active ?? Math.max(days.length - 1, 0),
|
|
70
|
+
"aria-valuetext": (() => {
|
|
71
|
+
const day = days[active ?? days.length - 1];
|
|
72
|
+
return day ? `${dayLabel(day.day)}: ${formatMetric(dayValue(day, metric), metric)}` : "";
|
|
73
|
+
})(),
|
|
74
|
+
onKeyDown: (event) => {
|
|
75
|
+
if (days.length === 0) return;
|
|
76
|
+
const at = active ?? days.length - 1;
|
|
77
|
+
let next = null;
|
|
78
|
+
if (event.key === "ArrowLeft") next = Math.max(at - 1, 0);
|
|
79
|
+
else if (event.key === "ArrowRight") next = Math.min(at + 1, days.length - 1);
|
|
80
|
+
else if (event.key === "Home") next = 0;
|
|
81
|
+
else if (event.key === "End") next = days.length - 1;
|
|
82
|
+
if (next === null) return;
|
|
83
|
+
event.preventDefault();
|
|
84
|
+
setActive(next);
|
|
85
|
+
},
|
|
86
|
+
onFocus: () => setActive((current) => current ?? days.length - 1),
|
|
87
|
+
onBlur: () => setActive(null),
|
|
88
|
+
onPointerLeave: () => setActive(null),
|
|
89
|
+
className: "relative flex items-end gap-0.5 rounded-md border-b border-border outline-offset-4",
|
|
90
|
+
style: { height: HEIGHT },
|
|
91
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
92
|
+
id: describedBy,
|
|
93
|
+
className: "sr-only",
|
|
94
|
+
children: "The table under the chart lists every day."
|
|
95
|
+
}), days.map((day, index) => {
|
|
96
|
+
const value = dayValue(day, metric);
|
|
97
|
+
const height = max > 0 && value > 0 ? Math.max(value / max * HEIGHT, 2) : 0;
|
|
98
|
+
return /* @__PURE__ */ jsx("div", {
|
|
99
|
+
onPointerEnter: () => setActive(index),
|
|
100
|
+
className: "flex h-full min-w-0 flex-1 items-end justify-center",
|
|
101
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
102
|
+
className: `w-full max-w-6 rounded-t-[4px] transition-opacity ${active !== null && active !== index ? "opacity-55" : ""} bg-chart-bar`,
|
|
103
|
+
style: { height }
|
|
104
|
+
})
|
|
105
|
+
}, day.day);
|
|
106
|
+
})]
|
|
107
|
+
}),
|
|
108
|
+
/* @__PURE__ */ jsxs("div", {
|
|
109
|
+
className: "flex justify-between text-xs text-muted-foreground",
|
|
110
|
+
children: [/* @__PURE__ */ jsx("span", { children: first ? dayLabel(first.day) : "" }), /* @__PURE__ */ jsx("span", { children: last && last !== first ? dayLabel(last.day) : "" })]
|
|
111
|
+
})
|
|
112
|
+
]
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
//#endregion
|
|
116
|
+
//#region src/routes/usage/index.tsx?tsr-split=component
|
|
117
|
+
/** The address's period: `?days=7` reads as the number 7, `?days=all` as text. */
|
|
118
|
+
/** The report, asked for in this browser's time zone (the server does not know it). */
|
|
119
|
+
function useUsage(search) {
|
|
120
|
+
const [report, setReport] = useState(null);
|
|
121
|
+
const [error, setError] = useState(null);
|
|
122
|
+
const days = String(search.days ?? 30);
|
|
123
|
+
useEffect(() => {
|
|
124
|
+
const controller = new AbortController();
|
|
125
|
+
const query = new URLSearchParams({
|
|
126
|
+
days,
|
|
127
|
+
tz: Intl.DateTimeFormat().resolvedOptions().timeZone || "UTC"
|
|
128
|
+
});
|
|
129
|
+
if (search.agent) query.set("agent", search.agent);
|
|
130
|
+
if (search.team) query.set("team", search.team);
|
|
131
|
+
setError(null);
|
|
132
|
+
api(`/api/usage?${query}`, { signal: controller.signal }).then(setReport).catch((failure) => {
|
|
133
|
+
if (!controller.signal.aborted) setError(failure instanceof Error ? failure.message : String(failure));
|
|
134
|
+
});
|
|
135
|
+
return () => controller.abort();
|
|
136
|
+
}, [
|
|
137
|
+
days,
|
|
138
|
+
search.agent,
|
|
139
|
+
search.team
|
|
140
|
+
]);
|
|
141
|
+
return {
|
|
142
|
+
report,
|
|
143
|
+
error
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
function UsagePage() {
|
|
147
|
+
const search = Route.useSearch();
|
|
148
|
+
const navigate = useNavigate({ from: "/usage/" });
|
|
149
|
+
const { report, error } = useUsage(search);
|
|
150
|
+
const period = String(search.days ?? 30);
|
|
151
|
+
return /* @__PURE__ */ jsxs(ManagePage, {
|
|
152
|
+
title: "Usage",
|
|
153
|
+
description: "What your Agents' model calls used, read from the saved conversations: the money spent on providers paid per use, and the tokens of subscriptions and of models on this computer.",
|
|
154
|
+
actions: /* @__PURE__ */ jsx(Segmented, {
|
|
155
|
+
label: "Period",
|
|
156
|
+
value: period,
|
|
157
|
+
options: PERIODS,
|
|
158
|
+
onChange: (days) => void navigate({ search: (prev) => ({
|
|
159
|
+
...prev,
|
|
160
|
+
days: parseDays(days)
|
|
161
|
+
}) })
|
|
162
|
+
}),
|
|
163
|
+
children: [
|
|
164
|
+
report?.scope && /* @__PURE__ */ jsxs(Banner, {
|
|
165
|
+
tone: "neutral",
|
|
166
|
+
lead: `Only ${report.scope.name}`,
|
|
167
|
+
action: /* @__PURE__ */ jsx(Button, {
|
|
168
|
+
variant: "ghost",
|
|
169
|
+
onClick: () => void navigate({ search: (prev) => ({ days: prev.days }) }),
|
|
170
|
+
children: "Show every Agent"
|
|
171
|
+
}),
|
|
172
|
+
children: [report.scope.kind === "agent" ? "One Agent" : "The Agents of one Team", ", as Usage counts them below."]
|
|
173
|
+
}),
|
|
174
|
+
error && /* @__PURE__ */ jsx(Notice, {
|
|
175
|
+
tone: "danger",
|
|
176
|
+
title: "Usage could not be read",
|
|
177
|
+
children: error
|
|
178
|
+
}),
|
|
179
|
+
!report && !error && /* @__PURE__ */ jsx("p", {
|
|
180
|
+
className: "text-sm text-muted-foreground",
|
|
181
|
+
children: "Counting…"
|
|
182
|
+
}),
|
|
183
|
+
report && /* @__PURE__ */ jsx(UsageBody, {
|
|
184
|
+
report,
|
|
185
|
+
period
|
|
186
|
+
})
|
|
187
|
+
]
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
function UsageBody({ report, period }) {
|
|
191
|
+
const { totals } = report;
|
|
192
|
+
const [chosen, setMetric] = useState(null);
|
|
193
|
+
const metric = chosen ?? (totals.cost > 0 ? "cost" : "tokens");
|
|
194
|
+
const showDays = report.days !== null && report.days > 1;
|
|
195
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
196
|
+
/* @__PURE__ */ jsx(Totals, { report }),
|
|
197
|
+
report.unreadable > 0 && /* @__PURE__ */ jsxs(Notice, {
|
|
198
|
+
tone: "warning",
|
|
199
|
+
title: "Some conversations are not counted",
|
|
200
|
+
children: [
|
|
201
|
+
report.unreadable,
|
|
202
|
+
" saved conversation",
|
|
203
|
+
report.unreadable === 1 ? "" : "s",
|
|
204
|
+
" could not be read."
|
|
205
|
+
]
|
|
206
|
+
}),
|
|
207
|
+
totals.calls === 0 ? /* @__PURE__ */ jsx(SetupCard, {
|
|
208
|
+
labelledBy: "usage-empty",
|
|
209
|
+
icon: /* @__PURE__ */ jsx(BarChart3, { className: "size-5" }),
|
|
210
|
+
title: "By day",
|
|
211
|
+
description: periodWords(report),
|
|
212
|
+
children: /* @__PURE__ */ jsx(CardEmpty, {
|
|
213
|
+
icon: /* @__PURE__ */ jsx(BarChart3, { className: "size-5" }),
|
|
214
|
+
title: "No model calls in this period",
|
|
215
|
+
children: period === "all" ? "Nothing is counted until an Agent answers in a conversation." : "Pick a longer period to see earlier use."
|
|
216
|
+
})
|
|
217
|
+
}) : /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
218
|
+
showDays && /* @__PURE__ */ jsx(SetupCard, {
|
|
219
|
+
labelledBy: "usage-days",
|
|
220
|
+
icon: /* @__PURE__ */ jsx(BarChart3, { className: "size-5" }),
|
|
221
|
+
title: "By day",
|
|
222
|
+
description: periodWords(report),
|
|
223
|
+
action: /* @__PURE__ */ jsx(Segmented, {
|
|
224
|
+
label: "Show",
|
|
225
|
+
value: metric,
|
|
226
|
+
options: [{
|
|
227
|
+
id: "cost",
|
|
228
|
+
label: "Spent"
|
|
229
|
+
}, {
|
|
230
|
+
id: "tokens",
|
|
231
|
+
label: "Tokens"
|
|
232
|
+
}],
|
|
233
|
+
onChange: setMetric
|
|
234
|
+
}),
|
|
235
|
+
children: /* @__PURE__ */ jsxs(CardBody, { children: [
|
|
236
|
+
/* @__PURE__ */ jsx(DayChart, {
|
|
237
|
+
days: report.byDay,
|
|
238
|
+
metric
|
|
239
|
+
}),
|
|
240
|
+
/* @__PURE__ */ jsxs("details", {
|
|
241
|
+
className: "text-sm",
|
|
242
|
+
children: [/* @__PURE__ */ jsx("summary", {
|
|
243
|
+
className: "cursor-pointer text-muted-foreground",
|
|
244
|
+
children: "The days as a table"
|
|
245
|
+
}), /* @__PURE__ */ jsxs("table", {
|
|
246
|
+
className: "mt-2 w-full text-left tabular-nums",
|
|
247
|
+
children: [/* @__PURE__ */ jsx("thead", {
|
|
248
|
+
className: "text-xs text-muted-foreground",
|
|
249
|
+
children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
250
|
+
/* @__PURE__ */ jsx("th", {
|
|
251
|
+
className: "py-1 font-medium",
|
|
252
|
+
children: "Day"
|
|
253
|
+
}),
|
|
254
|
+
/* @__PURE__ */ jsx("th", {
|
|
255
|
+
className: "py-1 font-medium",
|
|
256
|
+
children: "Spent"
|
|
257
|
+
}),
|
|
258
|
+
/* @__PURE__ */ jsx("th", {
|
|
259
|
+
className: "py-1 font-medium",
|
|
260
|
+
children: "Tokens"
|
|
261
|
+
}),
|
|
262
|
+
/* @__PURE__ */ jsx("th", {
|
|
263
|
+
className: "py-1 font-medium",
|
|
264
|
+
children: "Model calls"
|
|
265
|
+
})
|
|
266
|
+
] })
|
|
267
|
+
}), /* @__PURE__ */ jsx("tbody", { children: report.byDay.toReversed().map((day) => /* @__PURE__ */ jsxs("tr", {
|
|
268
|
+
className: "border-t border-border",
|
|
269
|
+
children: [
|
|
270
|
+
/* @__PURE__ */ jsx("td", {
|
|
271
|
+
className: "py-1",
|
|
272
|
+
children: dayLabel(day.day, { year: "numeric" })
|
|
273
|
+
}),
|
|
274
|
+
/* @__PURE__ */ jsx("td", {
|
|
275
|
+
className: "py-1",
|
|
276
|
+
children: formatCost(day.cost)
|
|
277
|
+
}),
|
|
278
|
+
/* @__PURE__ */ jsx("td", {
|
|
279
|
+
className: "py-1",
|
|
280
|
+
children: formatTokens(day.totalTokens)
|
|
281
|
+
}),
|
|
282
|
+
/* @__PURE__ */ jsx("td", {
|
|
283
|
+
className: "py-1",
|
|
284
|
+
children: day.calls
|
|
285
|
+
})
|
|
286
|
+
]
|
|
287
|
+
}, day.day)) })]
|
|
288
|
+
})]
|
|
289
|
+
}),
|
|
290
|
+
metric === "cost" && peakDay(report, metric)
|
|
291
|
+
] })
|
|
292
|
+
}),
|
|
293
|
+
/* @__PURE__ */ jsx(Breakdown, {
|
|
294
|
+
id: "usage-teams",
|
|
295
|
+
icon: /* @__PURE__ */ jsx(UsersRound, { className: "size-5" }),
|
|
296
|
+
title: "By Team",
|
|
297
|
+
description: "Each Agent's use counts for the Team it is in now.",
|
|
298
|
+
rows: report.byTeam.map((team) => ({
|
|
299
|
+
key: team.teamId,
|
|
300
|
+
title: /* @__PURE__ */ jsx(Link, {
|
|
301
|
+
to: "/usage",
|
|
302
|
+
search: {
|
|
303
|
+
days: parseDays(period),
|
|
304
|
+
team: team.teamId
|
|
305
|
+
},
|
|
306
|
+
children: team.teamName
|
|
307
|
+
}),
|
|
308
|
+
totals: team
|
|
309
|
+
}))
|
|
310
|
+
}),
|
|
311
|
+
/* @__PURE__ */ jsx(Breakdown, {
|
|
312
|
+
id: "usage-agents",
|
|
313
|
+
icon: /* @__PURE__ */ jsx(Bot, { className: "size-5" }),
|
|
314
|
+
title: "By Agent",
|
|
315
|
+
description: "Open one for only its use.",
|
|
316
|
+
rows: report.byAgent.map((agent) => ({
|
|
317
|
+
key: agent.agentId,
|
|
318
|
+
title: /* @__PURE__ */ jsx(Link, {
|
|
319
|
+
to: "/usage",
|
|
320
|
+
search: {
|
|
321
|
+
days: parseDays(period),
|
|
322
|
+
agent: agent.agentId
|
|
323
|
+
},
|
|
324
|
+
children: agent.agentName
|
|
325
|
+
}),
|
|
326
|
+
chip: agent.archived ? /* @__PURE__ */ jsx(Chip, {
|
|
327
|
+
tone: "neutral",
|
|
328
|
+
children: "Archived"
|
|
329
|
+
}) : void 0,
|
|
330
|
+
meta: agent.teamName,
|
|
331
|
+
totals: agent
|
|
332
|
+
}))
|
|
333
|
+
}),
|
|
334
|
+
/* @__PURE__ */ jsx(Breakdown, {
|
|
335
|
+
id: "usage-models",
|
|
336
|
+
icon: /* @__PURE__ */ jsx(Cpu, { className: "size-5" }),
|
|
337
|
+
title: "By model",
|
|
338
|
+
description: "Subscriptions and models on this computer cost nothing per use.",
|
|
339
|
+
rows: report.byModel.map((model) => ({
|
|
340
|
+
key: `${model.provider}/${model.model}`,
|
|
341
|
+
title: /* @__PURE__ */ jsx("span", {
|
|
342
|
+
className: "break-all",
|
|
343
|
+
children: model.model
|
|
344
|
+
}),
|
|
345
|
+
chip: model.billing === "plan" ? /* @__PURE__ */ jsx(Chip, {
|
|
346
|
+
tone: "neutral",
|
|
347
|
+
children: "Subscription"
|
|
348
|
+
}) : model.billing === "local" ? /* @__PURE__ */ jsx(Chip, {
|
|
349
|
+
tone: "neutral",
|
|
350
|
+
children: "This computer"
|
|
351
|
+
}) : void 0,
|
|
352
|
+
meta: model.providerName,
|
|
353
|
+
totals: model
|
|
354
|
+
}))
|
|
355
|
+
})
|
|
356
|
+
] })
|
|
357
|
+
] });
|
|
358
|
+
}
|
|
359
|
+
function periodWords(report) {
|
|
360
|
+
if (report.days === null) return "Everything in the saved conversations.";
|
|
361
|
+
if (report.days === 1) return `Today, ${dayLabel(report.to)}.`;
|
|
362
|
+
return `${report.from ? dayLabel(report.from) : ""} to ${dayLabel(report.to)}, in this browser's time zone.`;
|
|
363
|
+
}
|
|
364
|
+
function peakDay(report, metric) {
|
|
365
|
+
const peak = report.byDay.reduce((best, day) => !best || dayValue(day, metric) > dayValue(best, metric) ? day : best, null);
|
|
366
|
+
if (!peak || dayValue(peak, metric) === 0) return null;
|
|
367
|
+
return /* @__PURE__ */ jsxs("p", {
|
|
368
|
+
className: "m-0 text-sm text-muted-foreground",
|
|
369
|
+
children: [
|
|
370
|
+
"The most was spent on ",
|
|
371
|
+
dayLabel(peak.day),
|
|
372
|
+
": ",
|
|
373
|
+
formatMetric(dayValue(peak, metric), metric),
|
|
374
|
+
"."
|
|
375
|
+
]
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
function Totals({ report }) {
|
|
379
|
+
const { totals } = report;
|
|
380
|
+
return /* @__PURE__ */ jsxs("section", {
|
|
381
|
+
"aria-labelledby": "usage-totals",
|
|
382
|
+
className: "grid gap-4 rounded-2xl border border-border bg-card p-5 shadow-baziu-sm sm:grid-cols-[minmax(0,1.4fr)_minmax(0,2fr)]",
|
|
383
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
384
|
+
className: "min-w-0",
|
|
385
|
+
children: [
|
|
386
|
+
/* @__PURE__ */ jsx("h2", {
|
|
387
|
+
id: "usage-totals",
|
|
388
|
+
className: "m-0 font-body text-sm font-medium text-muted-foreground",
|
|
389
|
+
children: "Spent"
|
|
390
|
+
}),
|
|
391
|
+
/* @__PURE__ */ jsx("p", {
|
|
392
|
+
className: "m-0 font-body text-5xl font-semibold leading-tight text-foreground",
|
|
393
|
+
children: formatCost(totals.cost)
|
|
394
|
+
}),
|
|
395
|
+
/* @__PURE__ */ jsxs("p", {
|
|
396
|
+
className: "m-0 mt-1 text-sm text-muted-foreground",
|
|
397
|
+
children: [totals.cost === 0 ? "On providers paid per use." : totals.estimated ? "Estimated from catalog prices, except what a provider reported it billed." : "As the providers reported it billed.", totals.unpricedTokens > 0 && ` ${formatTokens(totals.unpricedTokens)} tokens on models with no known price are not in it.`]
|
|
398
|
+
})
|
|
399
|
+
]
|
|
400
|
+
}), /* @__PURE__ */ jsxs("dl", {
|
|
401
|
+
className: "m-0 grid grid-cols-2 gap-3 self-start sm:grid-cols-4",
|
|
402
|
+
children: [
|
|
403
|
+
/* @__PURE__ */ jsx(Stat, {
|
|
404
|
+
label: "Tokens",
|
|
405
|
+
value: formatTokens(totals.totalTokens)
|
|
406
|
+
}),
|
|
407
|
+
/* @__PURE__ */ jsx(Stat, {
|
|
408
|
+
label: "On a subscription",
|
|
409
|
+
value: formatTokens(totals.planTokens)
|
|
410
|
+
}),
|
|
411
|
+
/* @__PURE__ */ jsx(Stat, {
|
|
412
|
+
label: "On this computer",
|
|
413
|
+
value: formatTokens(totals.localTokens)
|
|
414
|
+
}),
|
|
415
|
+
/* @__PURE__ */ jsx(Stat, {
|
|
416
|
+
label: "Model calls",
|
|
417
|
+
value: totals.calls.toLocaleString()
|
|
418
|
+
})
|
|
419
|
+
]
|
|
420
|
+
})]
|
|
421
|
+
});
|
|
422
|
+
}
|
|
423
|
+
function Stat({ label, value }) {
|
|
424
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
425
|
+
className: "min-w-0 rounded-xl bg-muted px-3 py-2.5",
|
|
426
|
+
children: [/* @__PURE__ */ jsx("dt", {
|
|
427
|
+
className: "text-xs text-muted-foreground",
|
|
428
|
+
children: label
|
|
429
|
+
}), /* @__PURE__ */ jsx("dd", {
|
|
430
|
+
className: "m-0 text-xl font-semibold text-foreground",
|
|
431
|
+
children: value
|
|
432
|
+
})]
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
function Breakdown({ id, icon, title, description, rows }) {
|
|
436
|
+
if (rows.length === 0) return null;
|
|
437
|
+
return /* @__PURE__ */ jsx(SetupCard, {
|
|
438
|
+
labelledBy: id,
|
|
439
|
+
icon,
|
|
440
|
+
title,
|
|
441
|
+
description,
|
|
442
|
+
children: /* @__PURE__ */ jsx(CardList, { children: rows.map((row) => /* @__PURE__ */ jsx(ListRow, {
|
|
443
|
+
inline: true,
|
|
444
|
+
title: row.title,
|
|
445
|
+
chip: row.chip,
|
|
446
|
+
meta: /* @__PURE__ */ jsxs(Fragment$1, { children: [row.meta && /* @__PURE__ */ jsx("span", { children: row.meta }), /* @__PURE__ */ jsxs("span", { children: [
|
|
447
|
+
formatTokens(row.totals.inputTokens + row.totals.cacheReadTokens),
|
|
448
|
+
" in ·",
|
|
449
|
+
" ",
|
|
450
|
+
formatTokens(row.totals.outputTokens),
|
|
451
|
+
" out · ",
|
|
452
|
+
row.totals.calls.toLocaleString(),
|
|
453
|
+
" ",
|
|
454
|
+
"call",
|
|
455
|
+
row.totals.calls === 1 ? "" : "s"
|
|
456
|
+
] })] }),
|
|
457
|
+
actions: /* @__PURE__ */ jsx("span", {
|
|
458
|
+
className: "text-sm font-semibold tabular-nums text-foreground",
|
|
459
|
+
children: usageSummary(row.totals)
|
|
460
|
+
})
|
|
461
|
+
}, row.key)) })
|
|
462
|
+
});
|
|
463
|
+
}
|
|
464
|
+
//#endregion
|
|
465
|
+
export { UsagePage as component };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as createServerFn } from "../server.js";
|
|
2
2
|
import { t as createServerRpc } from "./createServerRpc-B7Yr1K8i.js";
|
|
3
|
-
import { n as daemonClient } from "./daemon-client-
|
|
3
|
+
import { n as daemonClient } from "./daemon-client-RxAllljf.js";
|
|
4
4
|
//#region src/routes/welcome.tsx?tss-serverfn-split
|
|
5
5
|
var fetchProviders_createServerFn_handler = createServerRpc({
|
|
6
6
|
id: "818bf71baeed233268a5ad1a4be5a77e488be79b79ad1bd739463445a7be4d58",
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { i as api } from "./live-DbJeq6KP.js";
|
|
2
|
+
import { s as DEFAULT_PROFILE_ID } from "./src-vrZVrV9u.js";
|
|
3
|
+
import { r as useResource } from "./use-resource-BUA9qGGY.js";
|
|
4
|
+
import { t as Button } from "./Button-Dsnw22OF.js";
|
|
5
|
+
import { n as usePageTitle } from "./page-title-PTpFHXWo.js";
|
|
6
|
+
import { C as PageShell } from "./parts-k9M-atPa.js";
|
|
7
|
+
import { t as Route } from "./welcome-CwzLt6Rp.js";
|
|
8
|
+
import { a as ProviderConnect, c as ProviderAvatar, i as hostOf, n as ConnectedSummary, r as ProviderChooser } from "./AddProviderDialog-DtkjBMv4.js";
|
|
7
9
|
import { useState } from "react";
|
|
8
10
|
import { useNavigate } from "@tanstack/react-router";
|
|
9
11
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as createServerFn } from "../server.js";
|
|
2
|
-
import { t as createSsrRpc } from "./createSsrRpc-
|
|
2
|
+
import { t as createSsrRpc } from "./createSsrRpc-6LHNEsSK.js";
|
|
3
3
|
import { createFileRoute, lazyRouteComponent, redirect } from "@tanstack/react-router";
|
|
4
4
|
//#region src/lib/auth.ts
|
|
5
5
|
var fetchAuthState = createServerFn({ method: "GET" }).handler(createSsrRpc("a5d3825fc69573bb55bab6df578c750ebb0240dd394c3acee3adea02918a5dc2"));
|
|
@@ -11,7 +11,7 @@ function isSetupOpen(path) {
|
|
|
11
11
|
}
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region src/routes/welcome.tsx
|
|
14
|
-
var $$splitComponentImporter = () => import("./welcome-
|
|
14
|
+
var $$splitComponentImporter = () => import("./welcome-CYhh3iUU.js");
|
|
15
15
|
var fetchProviders = createServerFn({ method: "GET" }).handler(createSsrRpc("818bf71baeed233268a5ad1a4be5a77e488be79b79ad1bd739463445a7be4d58"));
|
|
16
16
|
var Route = createFileRoute("/welcome")({
|
|
17
17
|
beforeLoad: async () => {
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
//#region src/lib/workspace.ts
|
|
2
|
+
var isOneOf = (values, value) => typeof value === "string" && values.includes(value);
|
|
3
|
+
var PANEL_TABS = [
|
|
4
|
+
"agent",
|
|
5
|
+
"team",
|
|
6
|
+
"connections",
|
|
7
|
+
"changes",
|
|
8
|
+
"files"
|
|
9
|
+
];
|
|
10
|
+
/** The three screens that take the whole width, with the Agent list folded to avatars. */
|
|
11
|
+
var FOCUS_VIEWS = [
|
|
12
|
+
"connections",
|
|
13
|
+
"changes",
|
|
14
|
+
"files"
|
|
15
|
+
];
|
|
16
|
+
var PANEL_LABELS = {
|
|
17
|
+
agent: "Agent",
|
|
18
|
+
team: "Team",
|
|
19
|
+
connections: "Connections",
|
|
20
|
+
changes: "Changes",
|
|
21
|
+
files: "Files"
|
|
22
|
+
};
|
|
23
|
+
/** Sheets of the Agent tab. */
|
|
24
|
+
var AGENT_SECTIONS = [
|
|
25
|
+
"schedules",
|
|
26
|
+
"learning",
|
|
27
|
+
"mailbox",
|
|
28
|
+
"skills",
|
|
29
|
+
"telegram",
|
|
30
|
+
"browser"
|
|
31
|
+
];
|
|
32
|
+
/** Sheets of the Team tab. */
|
|
33
|
+
var TEAM_SECTIONS = [
|
|
34
|
+
"user-md",
|
|
35
|
+
"memory",
|
|
36
|
+
"settings"
|
|
37
|
+
];
|
|
38
|
+
var SECTIONS = [...AGENT_SECTIONS, ...TEAM_SECTIONS];
|
|
39
|
+
var isAgentSection = (value) => isOneOf(AGENT_SECTIONS, value);
|
|
40
|
+
var isTeamSection = (value) => isOneOf(TEAM_SECTIONS, value);
|
|
41
|
+
var text = (value) => typeof value === "string" && value.length > 0 ? value : void 0;
|
|
42
|
+
/** A whole number from 0, as the router reads it from the address (a number or its text). */
|
|
43
|
+
var count = (value) => {
|
|
44
|
+
const number = typeof value === "string" ? Number(value) : value;
|
|
45
|
+
return typeof number === "number" && Number.isInteger(number) && number >= 0 ? number : void 0;
|
|
46
|
+
};
|
|
47
|
+
/** The search params the workspace understands; anything else is dropped. */
|
|
48
|
+
function parseWorkspaceSearch(search) {
|
|
49
|
+
const panel = search.panel;
|
|
50
|
+
return {
|
|
51
|
+
agent: text(search.agent),
|
|
52
|
+
team: text(search.team),
|
|
53
|
+
panel: panel === "none" || isOneOf(PANEL_TABS, panel) ? panel : void 0,
|
|
54
|
+
view: isOneOf(FOCUS_VIEWS, search.view) ? search.view : void 0,
|
|
55
|
+
file: text(search.file),
|
|
56
|
+
result: text(search.result),
|
|
57
|
+
conversation: text(search.conversation),
|
|
58
|
+
find: text(search.find),
|
|
59
|
+
match: count(search.match),
|
|
60
|
+
section: isOneOf(SECTIONS, search.section) ? search.section : void 0,
|
|
61
|
+
note: text(search.note)
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Cookie that remembers the side panel between visits, so the first paint has it: the last tab,
|
|
66
|
+
* prefixed with `none:` while the panel is hidden.
|
|
67
|
+
*/
|
|
68
|
+
var PANEL_COOKIE = "bz_panel";
|
|
69
|
+
function parsePanelCookie(raw) {
|
|
70
|
+
const hidden = raw?.startsWith("none:") ?? false;
|
|
71
|
+
const tab = hidden ? raw?.slice(5) : raw;
|
|
72
|
+
return {
|
|
73
|
+
open: !hidden,
|
|
74
|
+
tab: isOneOf(PANEL_TABS, tab) ? tab : "team"
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
function writePanelCookie(memory) {
|
|
78
|
+
const value = memory.open ? memory.tab : `none:${memory.tab}`;
|
|
79
|
+
document.cookie = `${PANEL_COOKIE}=${value}; Path=/; Max-Age=31536000; SameSite=Lax`;
|
|
80
|
+
}
|
|
81
|
+
//#endregion
|
|
82
|
+
export { isAgentSection as a, parseWorkspaceSearch as c, PANEL_TABS as i, writePanelCookie as l, PANEL_COOKIE as n, isTeamSection as o, PANEL_LABELS as r, parsePanelCookie as s, FOCUS_VIEWS as t };
|