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
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import { r as readCookie, t as CSRF_COOKIES } from "./cookies-HnTYjKRp.js";
|
|
2
|
+
import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
//#region src/lib/api.ts
|
|
5
|
+
var ApiError = class extends Error {
|
|
6
|
+
status;
|
|
7
|
+
/** The daemon's machine-readable `code`, when it sent one. */
|
|
8
|
+
code;
|
|
9
|
+
/** The parsed JSON error body, when there was one. */
|
|
10
|
+
body;
|
|
11
|
+
constructor(message, status, code, body) {
|
|
12
|
+
super(message);
|
|
13
|
+
this.status = status;
|
|
14
|
+
this.code = code;
|
|
15
|
+
this.body = body;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
function csrfHeader() {
|
|
19
|
+
for (const name of CSRF_COOKIES) {
|
|
20
|
+
const value = readCookie(document.cookie, name);
|
|
21
|
+
if (value) return { "x-bazilion-csrf": value };
|
|
22
|
+
}
|
|
23
|
+
return {};
|
|
24
|
+
}
|
|
25
|
+
async function failure(response) {
|
|
26
|
+
const text = await response.text().catch(() => "");
|
|
27
|
+
let body = {};
|
|
28
|
+
try {
|
|
29
|
+
const parsed = JSON.parse(text);
|
|
30
|
+
if (parsed && typeof parsed === "object") body = parsed;
|
|
31
|
+
} catch {}
|
|
32
|
+
const message = typeof body.error === "string" ? body.error : text.slice(0, 300) || `HTTP ${response.status}`;
|
|
33
|
+
const code = typeof body.code === "string" ? body.code : void 0;
|
|
34
|
+
return new ApiError(message, response.status, code, body);
|
|
35
|
+
}
|
|
36
|
+
/** The raw response (streams, downloads, text); throws ApiError unless it is ok. */
|
|
37
|
+
async function apiFetch(path, init = {}) {
|
|
38
|
+
const method = init.method ?? (init.body === void 0 ? "GET" : "POST");
|
|
39
|
+
const headers = method === "GET" ? {} : csrfHeader();
|
|
40
|
+
let body;
|
|
41
|
+
if (init.body instanceof FormData) body = init.body;
|
|
42
|
+
else if (init.body !== void 0) {
|
|
43
|
+
headers["content-type"] = "application/json";
|
|
44
|
+
body = JSON.stringify(init.body);
|
|
45
|
+
}
|
|
46
|
+
const response = await fetch(path, {
|
|
47
|
+
method,
|
|
48
|
+
headers,
|
|
49
|
+
body,
|
|
50
|
+
signal: init.signal
|
|
51
|
+
});
|
|
52
|
+
if (!response.ok) throw await failure(response);
|
|
53
|
+
return response;
|
|
54
|
+
}
|
|
55
|
+
/** The daemon's JSON answer (undefined for an empty body); throws ApiError with its message. */
|
|
56
|
+
async function api(path, init = {}) {
|
|
57
|
+
const text = await (await apiFetch(path, init)).text();
|
|
58
|
+
return text ? JSON.parse(text) : void 0;
|
|
59
|
+
}
|
|
60
|
+
function errorMessage(error) {
|
|
61
|
+
return error instanceof Error ? error.message : String(error);
|
|
62
|
+
}
|
|
63
|
+
//#endregion
|
|
64
|
+
//#region src/lib/live.tsx
|
|
65
|
+
var CHANNEL = "bazilion-live";
|
|
66
|
+
var LOCK = "bazilion-live";
|
|
67
|
+
var EVENT_TYPES = ["activity", "attention"];
|
|
68
|
+
/** After a failed stream: wait, then try again, longer each time up to the last. */
|
|
69
|
+
var RETRY_MS = [
|
|
70
|
+
1e3,
|
|
71
|
+
3e3,
|
|
72
|
+
1e4,
|
|
73
|
+
3e4
|
|
74
|
+
];
|
|
75
|
+
var LiveContext = createContext({
|
|
76
|
+
connected: false,
|
|
77
|
+
subscribe: () => () => {},
|
|
78
|
+
isLeader: () => false,
|
|
79
|
+
anyTabFocused: () => true
|
|
80
|
+
});
|
|
81
|
+
function useLive() {
|
|
82
|
+
return useContext(LiveContext);
|
|
83
|
+
}
|
|
84
|
+
/** Parse one SSE message's data; null for anything that is not a live event. */
|
|
85
|
+
function parseLiveEvent(data) {
|
|
86
|
+
try {
|
|
87
|
+
const event = JSON.parse(data);
|
|
88
|
+
return event && EVENT_TYPES.includes(event.type) ? event : null;
|
|
89
|
+
} catch {
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
function LiveProvider({ enabled, children }) {
|
|
94
|
+
const [connected, setConnected] = useState(false);
|
|
95
|
+
const handlers = useRef(/* @__PURE__ */ new Map());
|
|
96
|
+
const latest = useRef(/* @__PURE__ */ new Map());
|
|
97
|
+
const leading = useRef(false);
|
|
98
|
+
const focusedTabs = useRef(/* @__PURE__ */ new Set());
|
|
99
|
+
const deliver = useCallback((event) => {
|
|
100
|
+
latest.current.set(event.type, event);
|
|
101
|
+
for (const handler of handlers.current.get(event.type) ?? []) try {
|
|
102
|
+
handler(event);
|
|
103
|
+
} catch (error) {
|
|
104
|
+
console.warn("live feed reader failed:", error);
|
|
105
|
+
}
|
|
106
|
+
}, []);
|
|
107
|
+
useEffect(() => {
|
|
108
|
+
if (!enabled) return;
|
|
109
|
+
let stopped = false;
|
|
110
|
+
let source = null;
|
|
111
|
+
let retry;
|
|
112
|
+
let failures = 0;
|
|
113
|
+
const tab = Math.random().toString(36).slice(2);
|
|
114
|
+
const channel = typeof BroadcastChannel === "undefined" ? null : new BroadcastChannel(CHANNEL);
|
|
115
|
+
const shared = Boolean(channel && typeof navigator !== "undefined" && navigator.locks);
|
|
116
|
+
const post = (message) => channel?.postMessage(message);
|
|
117
|
+
const share = (message) => {
|
|
118
|
+
if (shared) post(message);
|
|
119
|
+
};
|
|
120
|
+
let releaseLock = () => {};
|
|
121
|
+
const status = (value) => {
|
|
122
|
+
setConnected(value);
|
|
123
|
+
share({
|
|
124
|
+
kind: "status",
|
|
125
|
+
connected: value
|
|
126
|
+
});
|
|
127
|
+
};
|
|
128
|
+
const open = () => {
|
|
129
|
+
if (stopped || !shared && document.visibilityState === "hidden") return;
|
|
130
|
+
source = new EventSource("/api/events");
|
|
131
|
+
for (const type of EVENT_TYPES) source.addEventListener(type, (message) => {
|
|
132
|
+
const event = parseLiveEvent(message.data);
|
|
133
|
+
if (!event) return;
|
|
134
|
+
failures = 0;
|
|
135
|
+
deliver(event);
|
|
136
|
+
share({
|
|
137
|
+
kind: "event",
|
|
138
|
+
event
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
source.onopen = () => status(true);
|
|
142
|
+
source.onerror = () => {
|
|
143
|
+
status(false);
|
|
144
|
+
if (source?.readyState === EventSource.CLOSED) {
|
|
145
|
+
source = null;
|
|
146
|
+
const wait = RETRY_MS[Math.min(failures, RETRY_MS.length - 1)] ?? 3e4;
|
|
147
|
+
failures++;
|
|
148
|
+
retry = window.setTimeout(open, wait);
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
const lead = () => {
|
|
153
|
+
leading.current = true;
|
|
154
|
+
open();
|
|
155
|
+
};
|
|
156
|
+
const reportFocus = () => {
|
|
157
|
+
const focused = document.visibilityState === "visible" && document.hasFocus();
|
|
158
|
+
if (focused) focusedTabs.current.add(tab);
|
|
159
|
+
else focusedTabs.current.delete(tab);
|
|
160
|
+
post({
|
|
161
|
+
kind: "focus",
|
|
162
|
+
tab,
|
|
163
|
+
focused
|
|
164
|
+
});
|
|
165
|
+
};
|
|
166
|
+
if (channel) channel.onmessage = ({ data }) => {
|
|
167
|
+
if (data.kind === "event") {
|
|
168
|
+
if (shared) deliver(data.event);
|
|
169
|
+
} else if (data.kind === "status") {
|
|
170
|
+
if (shared) setConnected(data.connected);
|
|
171
|
+
} else if (data.kind === "focus") if (data.focused) focusedTabs.current.add(data.tab);
|
|
172
|
+
else focusedTabs.current.delete(data.tab);
|
|
173
|
+
else if (data.kind === "hello") {
|
|
174
|
+
if (leading.current) {
|
|
175
|
+
for (const event of latest.current.values()) post({
|
|
176
|
+
kind: "event",
|
|
177
|
+
event
|
|
178
|
+
});
|
|
179
|
+
post({
|
|
180
|
+
kind: "status",
|
|
181
|
+
connected: source?.readyState === EventSource.OPEN
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
reportFocus();
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
const close = () => {
|
|
188
|
+
window.clearTimeout(retry);
|
|
189
|
+
source?.close();
|
|
190
|
+
source = null;
|
|
191
|
+
setConnected(false);
|
|
192
|
+
};
|
|
193
|
+
const onVisibility = () => {
|
|
194
|
+
if (document.visibilityState === "hidden") close();
|
|
195
|
+
else if (!source) open();
|
|
196
|
+
};
|
|
197
|
+
if (shared) {
|
|
198
|
+
navigator.locks.request(LOCK, () => {
|
|
199
|
+
if (stopped) return;
|
|
200
|
+
lead();
|
|
201
|
+
return new Promise((resolve) => {
|
|
202
|
+
releaseLock = resolve;
|
|
203
|
+
});
|
|
204
|
+
}).catch(() => {});
|
|
205
|
+
post({ kind: "hello" });
|
|
206
|
+
} else {
|
|
207
|
+
leading.current = true;
|
|
208
|
+
if (document.visibilityState !== "hidden") open();
|
|
209
|
+
document.addEventListener("visibilitychange", onVisibility);
|
|
210
|
+
}
|
|
211
|
+
reportFocus();
|
|
212
|
+
window.addEventListener("focus", reportFocus);
|
|
213
|
+
window.addEventListener("blur", reportFocus);
|
|
214
|
+
document.addEventListener("visibilitychange", reportFocus);
|
|
215
|
+
const leave = () => post({
|
|
216
|
+
kind: "focus",
|
|
217
|
+
tab,
|
|
218
|
+
focused: false
|
|
219
|
+
});
|
|
220
|
+
window.addEventListener("pagehide", leave);
|
|
221
|
+
return () => {
|
|
222
|
+
stopped = true;
|
|
223
|
+
leave();
|
|
224
|
+
document.removeEventListener("visibilitychange", onVisibility);
|
|
225
|
+
window.clearTimeout(retry);
|
|
226
|
+
source?.close();
|
|
227
|
+
leading.current = false;
|
|
228
|
+
releaseLock();
|
|
229
|
+
window.removeEventListener("focus", reportFocus);
|
|
230
|
+
window.removeEventListener("blur", reportFocus);
|
|
231
|
+
document.removeEventListener("visibilitychange", reportFocus);
|
|
232
|
+
window.removeEventListener("pagehide", leave);
|
|
233
|
+
channel?.close();
|
|
234
|
+
setConnected(false);
|
|
235
|
+
};
|
|
236
|
+
}, [enabled, deliver]);
|
|
237
|
+
const subscribe = useCallback((type, handler) => {
|
|
238
|
+
const generic = handler;
|
|
239
|
+
let set = handlers.current.get(type);
|
|
240
|
+
if (!set) {
|
|
241
|
+
set = /* @__PURE__ */ new Set();
|
|
242
|
+
handlers.current.set(type, set);
|
|
243
|
+
}
|
|
244
|
+
set.add(generic);
|
|
245
|
+
const last = latest.current.get(type);
|
|
246
|
+
if (last) generic(last);
|
|
247
|
+
return () => {
|
|
248
|
+
set.delete(generic);
|
|
249
|
+
};
|
|
250
|
+
}, []);
|
|
251
|
+
const value = useMemo(() => ({
|
|
252
|
+
connected,
|
|
253
|
+
subscribe,
|
|
254
|
+
isLeader: () => leading.current,
|
|
255
|
+
anyTabFocused: () => focusedTabs.current.size > 0
|
|
256
|
+
}), [connected, subscribe]);
|
|
257
|
+
return /* @__PURE__ */ jsx(LiveContext.Provider, {
|
|
258
|
+
value,
|
|
259
|
+
children
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
//#endregion
|
|
263
|
+
export { apiFetch as a, api as i, useLive as n, errorMessage as o, ApiError as r, LiveProvider as t };
|
|
@@ -98,7 +98,7 @@ function useThemeMode() {
|
|
|
98
98
|
}
|
|
99
99
|
//#endregion
|
|
100
100
|
//#region src/routes/login.tsx
|
|
101
|
-
var $$splitComponentImporter = () => import("./login-
|
|
101
|
+
var $$splitComponentImporter = () => import("./login-C4lL4AxI.js");
|
|
102
102
|
var Route = createFileRoute("/login")({
|
|
103
103
|
validateSearch: (search) => ({ error: search.error === "token" || search.error === "origin" ? search.error : void 0 }),
|
|
104
104
|
component: lazyRouteComponent($$splitComponentImporter, "component")
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as usePageTitle } from "./page-title-
|
|
2
|
-
import { a as PawIcon, i as useThemeMode, o as BaziuLogo, r as setThemeMode, t as Route } from "./login-
|
|
1
|
+
import { n as usePageTitle } from "./page-title-PTpFHXWo.js";
|
|
2
|
+
import { a as PawIcon, i as useThemeMode, o as BaziuLogo, r as setThemeMode, t as Route } from "./login-BJdJ219n.js";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { KeyRound, MessageSquareText, Monitor, Moon, Sun, UsersRound } from "lucide-react";
|
|
5
5
|
//#region src/components/ThemeToggle.tsx
|
|
@@ -189,7 +189,8 @@ var ATTENTION_KINDS = {
|
|
|
189
189
|
review_failure: "Review failures",
|
|
190
190
|
trigger_failure: "Schedule failures",
|
|
191
191
|
agent_loop_break: "Loop breaks",
|
|
192
|
-
queue_interrupted: "Paused queues"
|
|
192
|
+
queue_interrupted: "Paused queues",
|
|
193
|
+
turn_failure: "Failed turns"
|
|
193
194
|
};
|
|
194
195
|
function severityLabel(severity) {
|
|
195
196
|
switch (severity) {
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as
|
|
3
|
-
import { t as
|
|
4
|
-
import {
|
|
1
|
+
import { i as api, o as errorMessage } from "./live-DbJeq6KP.js";
|
|
2
|
+
import { t as Button } from "./Button-Dsnw22OF.js";
|
|
3
|
+
import { t as ConfirmDialog } from "./ConfirmDialog-DAcSBHkT.js";
|
|
4
|
+
import { a as CardForm, d as Chip, g as Notice, h as ListRow, o as CardList, r as CardBody, s as CardRow, x as Waiting, y as SetupCard } from "./parts-k9M-atPa.js";
|
|
5
|
+
import { d as TextField, o as SecretField, s as SelectField } from "./form-BEjeiSy3.js";
|
|
6
|
+
import { t as Route } from "./mcp-DwCzj7eO.js";
|
|
7
|
+
import { t as ConfigPage } from "./ConfigPage-usZi48Zr.js";
|
|
5
8
|
import { useState } from "react";
|
|
6
9
|
import { useRouter } from "@tanstack/react-router";
|
|
7
10
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -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/mcp.tsx?tss-serverfn-split
|
|
5
5
|
var fetchServers_createServerFn_handler = createServerRpc({
|
|
6
6
|
id: "278849457893891c3d22806d15e11a0a42cc3630b30e9e62b74cf2d3b982ded7",
|
|
@@ -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/mcp.tsx
|
|
5
|
-
var $$splitComponentImporter = () => import("./mcp-
|
|
5
|
+
var $$splitComponentImporter = () => import("./mcp-BXnWQOwM.js");
|
|
6
6
|
var fetchServers = createServerFn({ method: "GET" }).handler(createSsrRpc("278849457893891c3d22806d15e11a0a42cc3630b30e9e62b74cf2d3b982ded7"));
|
|
7
7
|
var Route = createFileRoute("/config/mcp")({
|
|
8
8
|
loader: () => fetchServers(),
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import "./src-vrZVrV9u.js";
|
|
2
|
+
//#region src/components/workspace/rail/open-groups.ts
|
|
3
|
+
var SIDEBAR_OPEN_GROUPS_COOKIE = "bz_sidebar_open_groups";
|
|
4
|
+
function writeOpenGroupsCookie(map) {
|
|
5
|
+
document.cookie = `${SIDEBAR_OPEN_GROUPS_COOKIE}=${encodeURIComponent(JSON.stringify(map))}; Path=/; Max-Age=31536000; SameSite=Lax`;
|
|
6
|
+
}
|
|
7
|
+
/** An explicit choice wins; otherwise the Team in view and the default Team start open. */
|
|
8
|
+
function isGroupOpen(openGroups, teamId, current) {
|
|
9
|
+
return openGroups[teamId] ?? (current || teamId === "default");
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { isGroupOpen as n, writeOpenGroupsCookie as r, SIDEBAR_OPEN_GROUPS_COOKIE as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as api, n as useLive } from "./live-DbJeq6KP.js";
|
|
2
2
|
import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
3
3
|
import { useRouterState } from "@tanstack/react-router";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -29,6 +29,7 @@ function AttentionCountProvider({ enabled, children }) {
|
|
|
29
29
|
agentWaits: 0
|
|
30
30
|
});
|
|
31
31
|
const controller = useRef(null);
|
|
32
|
+
const live = useLive();
|
|
32
33
|
const load = useCallback(() => {
|
|
33
34
|
if (document.visibilityState === "hidden") return;
|
|
34
35
|
controller.current?.abort();
|
|
@@ -36,8 +37,9 @@ function AttentionCountProvider({ enabled, children }) {
|
|
|
36
37
|
controller.current = current;
|
|
37
38
|
api("/api/attention/summary", { signal: current.signal }).then((summary) => setCounts(attentionCounts(summary))).catch(() => {});
|
|
38
39
|
}, []);
|
|
40
|
+
useEffect(() => live.subscribe("attention", (event) => setCounts(attentionCounts(event.summary))), [live.subscribe]);
|
|
39
41
|
useEffect(() => {
|
|
40
|
-
if (!enabled) return;
|
|
42
|
+
if (!enabled || live.connected) return;
|
|
41
43
|
load();
|
|
42
44
|
const timer = setInterval(load, POLL_MS);
|
|
43
45
|
const onShow = () => {
|
|
@@ -52,7 +54,8 @@ function AttentionCountProvider({ enabled, children }) {
|
|
|
52
54
|
}, [
|
|
53
55
|
enabled,
|
|
54
56
|
load,
|
|
55
|
-
pathname
|
|
57
|
+
pathname,
|
|
58
|
+
live.connected
|
|
56
59
|
]);
|
|
57
60
|
const value = useMemo(() => ({
|
|
58
61
|
...counts,
|