bazilion 0.55.0 → 0.57.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 +193 -37
- package/dist/cli.js.map +1 -1
- package/dist/daemon.js +1821 -788
- package/dist/daemon.js.map +1 -1
- package/dist/web/client/assets/AddProviderDialog-DwUu2FGE.js +1 -0
- package/dist/web/client/assets/AgentTemplateParts-C3BasVck.js +1 -0
- package/dist/web/client/assets/{Button-bTJUy9Qf.js → Button-CoKQRO-s.js} +1 -1
- package/dist/web/client/assets/ConfigPage-DFmHgEaL.js +1 -0
- package/dist/web/client/assets/ConfirmDialog-BCOfW63x.js +1 -0
- package/dist/web/client/assets/ConnectionsView-BbpY5YbI.js +1 -0
- package/dist/web/client/assets/ManagePage-BzyMHGqs.js +1 -0
- package/dist/web/client/assets/SectionTabs-C8H_LunZ.js +1 -0
- package/dist/web/client/assets/{Segmented-oPkAHPO1.js → Segmented-iylzLwE6.js} +1 -1
- package/dist/web/client/assets/SkillsParts-DoygBgF2.js +1 -0
- package/dist/web/client/assets/SpawnTeamModal-BVf4yN9X.js +1 -0
- package/dist/web/client/assets/TeamForm-Bfb5hVUX.js +1 -0
- package/dist/web/client/assets/TeamThread-BFmaBj82.js +1 -0
- package/dist/web/client/assets/UnsavedChangesGuard-BUsIHSxO.js +1 -0
- package/dist/web/client/assets/_id-BRD3kxrX.js +1 -0
- package/dist/web/client/assets/_id-BapVoTMJ.js +1 -0
- package/dist/web/client/assets/access-CqcKius1.js +1 -0
- package/dist/web/client/assets/{agent-actions-CUee6aJq.js → agent-actions-B-9KIwn6.js} +1 -1
- package/dist/web/client/assets/agents-BC_ITk28.js +1 -0
- package/dist/web/client/assets/agents-DQ8nQnD6.js +1 -0
- package/dist/web/client/assets/arrow-right-BqqfPqVi.js +1 -0
- package/dist/web/client/assets/attention-BnCihfi0.js +1 -0
- package/dist/web/client/assets/{bot-BCone8es.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-DYS8bkQl.js +1 -0
- package/dist/web/client/assets/{createLucideIcon-jxSFpY0Q.js → createLucideIcon-CZHSSDYA.js} +1 -1
- package/dist/web/client/assets/{download-Dy88XavQ.js → download-Dr0PgyMr.js} +1 -1
- package/dist/web/client/assets/es2015-DZDOQ3kj.js +41 -0
- package/dist/web/client/assets/{file-text-DPsZ8-h9.js → file-text-D6OTHixJ.js} +1 -1
- package/dist/web/client/assets/{images-QBh_rL8b.js → images-BULrW-FC.js} +1 -1
- package/dist/web/client/assets/index-CxXsZzDC.js +14 -0
- package/dist/web/client/assets/{key-round-C-I8fAG0.js → key-round-DmSZN0Kq.js} +1 -1
- package/dist/web/client/assets/{list-checks-C9Q-bjEi.js → list-checks-DdTdAQXS.js} +1 -1
- package/dist/web/client/assets/login-DFVsVP0s.js +1 -0
- package/dist/web/client/assets/{manage-BaIU5zKy.js → manage-CpXaObuS.js} +1 -1
- package/dist/web/client/assets/mcp-DslGDHmN.js +1 -0
- package/dist/web/client/assets/{message-square-Bwf9cHOx.js → message-square-B_pULba_.js} +1 -1
- package/dist/web/client/assets/{network-B3FA93gC.js → network-BqmVqC4_.js} +1 -1
- package/dist/web/client/assets/parts-C104qEuC.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-D1wFPm0n.js +85 -0
- package/dist/web/client/assets/skills-DmIo3vN3.js +1 -0
- package/dist/web/client/assets/{square-terminal-DaNLwvEs.js → square-terminal-CYfGBHPC.js} +1 -1
- package/dist/web/client/assets/style-CqkCFvvz.js +7 -0
- package/dist/web/client/assets/styles-C7NsCHeU.css +2 -0
- package/dist/web/client/assets/{system-CrTSr5_t.js → system-CUW9JZ9c.js} +1 -1
- package/dist/web/client/assets/teams-DJzYsuh9.js +1 -0
- package/dist/web/client/assets/teams-DrhG8KiS.js +1 -0
- package/dist/web/client/assets/telegram-Bk_kg8hb.js +1 -0
- package/dist/web/client/assets/tools-z9Ixmuu2.js +1 -0
- package/dist/web/client/assets/usage-DGe3x1m7.js +1 -0
- package/dist/web/client/assets/use-resource-qjIkNQDY.js +1 -0
- package/dist/web/client/assets/{users-round-BElBVSnw.js → users-round-cxQ5HF-C.js} +1 -1
- package/dist/web/client/assets/welcome-DDKqxHkF.js +1 -0
- package/dist/web/client/assets/{wrench-DotqSqSm.js → wrench-BLEJjETg.js} +1 -1
- package/dist/web/server/assets/{AddProviderDialog-BbpuvC2a.js → AddProviderDialog-CpLDHOcA.js} +6 -3
- package/dist/web/server/assets/AgentAvatar-8gTAy_tP.js +37 -0
- package/dist/web/server/assets/{AgentTemplateParts-Ce7snK3m.js → AgentTemplateParts-Dh9F_-T_.js} +7 -3
- package/dist/web/server/assets/Button-Dsnw22OF.js +17 -0
- package/dist/web/server/assets/{ConfigPage-qP9ejjuw.js → ConfigPage-CrxctbtN.js} +2 -2
- package/dist/web/server/assets/{ConfirmDialog-Z-uYbE9B.js → ConfirmDialog-C89B8qKM.js} +3 -1
- package/dist/web/server/assets/{ConnectionsView-CLIV7V5D.js → ConnectionsView-DslcKQmA.js} +9 -7
- package/dist/web/server/assets/Dialog-_Gt_Nt86.js +85 -0
- package/dist/web/server/assets/{ManagePage-BR9FwVZM.js → ManagePage-DGYNJ6XG.js} +2 -2
- package/dist/web/server/assets/{ModelMenu-D-hTgYOO.js → ModelMenu-DEJoYASj.js} +13 -1
- package/dist/web/server/assets/{SectionTabs-CWQ5orUW.js → SectionTabs--vMBvaUz.js} +9 -2
- package/dist/web/server/assets/{SkillsParts-DWpdydCJ.js → SkillsParts-CqS2B45v.js} +7 -3
- package/dist/web/server/assets/SpawnDialog-BNKj2Lup.js +127 -0
- package/dist/web/server/assets/{SpawnTeamModal-C-YMvoaB.js → SpawnTeamModal-zcLxtFOO.js} +6 -2
- package/dist/web/server/assets/{TeamForm-CL45gBdt.js → TeamForm-XFP0l2TB.js} +11 -5
- package/dist/web/server/assets/{TeamThread-CVVH6kKj.js → TeamThread-gYV_ToRM.js} +59 -12
- package/dist/web/server/assets/{UnsavedChangesGuard-CXK75QQp.js → UnsavedChangesGuard-CB_TugFF.js} +1 -1
- package/dist/web/server/assets/{_id-d2OwovYV.js → _id-517adSuB.js} +2 -2
- package/dist/web/server/assets/{_id-BKzOw78O.js → _id-BTyd2i5U.js} +1 -1
- package/dist/web/server/assets/{_id-8zsImuGa.js → _id-BsQnL9LV.js} +14 -9
- package/dist/web/server/assets/{_id-2I4CSMQj.js → _id-CyinHJam.js} +17 -11
- package/dist/web/server/assets/{_id-De3Bm0SG.js → _id-D4RFNqaJ.js} +2 -2
- package/dist/web/server/assets/{_id-BpfoPuTv.js → _id-josYXBx3.js} +2 -2
- package/dist/web/server/assets/_tanstack-start-manifest_v-w2xn07aY.js +275 -0
- package/dist/web/server/assets/{access-WWspT0v4.js → access-B97-94Wt.js} +1 -1
- package/dist/web/server/assets/{access-CyUoElTP.js → access-BdQmjMJV.js} +2 -2
- package/dist/web/server/assets/{access-CwZ27Wsl.js → access-Cc7fMMod.js} +7 -4
- package/dist/web/server/assets/activity-Czfq-5_F.js +471 -0
- package/dist/web/server/assets/{agent-actions-C07Cp5Ue.js → agent-actions-ChH7Mne4.js} +1 -1
- package/dist/web/server/assets/{agents-DCWEoaxY.js → agents-BL918wVc.js} +2 -2
- package/dist/web/server/assets/{agents-vuXrAv1j.js → agents-BlUZqqJn.js} +14 -8
- package/dist/web/server/assets/{agents-CRtMfKqX.js → agents-BzJFjA2i.js} +2 -2
- package/dist/web/server/assets/{agents-CwzhpDPm.js → agents-CjrkaEz8.js} +11 -8
- package/dist/web/server/assets/{agents-DQowl6Ly.js → agents-Tg3zkmQv.js} +2 -2
- package/dist/web/server/assets/{agents-DTub-rJk.js → agents-uw32jPWx.js} +2 -2
- package/dist/web/server/assets/{attention-Dki8rmGZ.js → attention-2unmuO-q.js} +1 -1
- package/dist/web/server/assets/{attention-BqCnJ1hg.js → attention-C94WWwQe.js} +2 -2
- package/dist/web/server/assets/{attention-DwGaur_w.js → attention-a_OmC6L3.js} +9 -7
- package/dist/web/server/assets/{auth-dJnrFW6y.js → auth-DuIqEAed.js} +1 -1
- package/dist/web/server/assets/{config-B9dJiji_.js → config-BG1KOtwA.js} +2 -2
- package/dist/web/server/assets/{config-D3MR2VjE.js → config-Bhem9XER.js} +10 -7
- package/dist/web/server/assets/{config-X7qWbbpH.js → config-D1Li_7Yt2.js} +1 -1
- package/dist/web/server/assets/createSsrRpc-6LHNEsSK.js +16 -0
- package/dist/web/server/assets/{daemon-client-B_ZRIIrT.js → daemon-client-D-NWKQto.js} +1 -1
- package/dist/web/server/assets/form-Bwsyt9OY.js +416 -0
- package/dist/web/server/assets/live-DbJeq6KP.js +263 -0
- package/dist/web/server/assets/{login-CRd1yTH5.js → login-BJdJ219n.js} +1 -1
- package/dist/web/server/assets/{login-ZN6KV8n-.js → login-C4lL4AxI.js} +2 -2
- package/dist/web/server/assets/{manage-Ce6cI4eW.js → manage-C7ReF2ZZ.js} +3 -2
- package/dist/web/server/assets/{mcp-CYQuYWGX.js → mcp-BFixpBQk.js} +2 -2
- package/dist/web/server/assets/{mcp-BQ15a9dG.js → mcp-BTZkDvdc.js} +7 -4
- package/dist/web/server/assets/{mcp-C97uAZe1.js → mcp-Ceg9gzKE.js} +1 -1
- package/dist/web/server/assets/open-groups-C89TEK85.js +12 -0
- package/dist/web/server/assets/{page-title-CVY-c2Pd.js → page-title-PTpFHXWo.js} +1 -1
- package/dist/web/server/assets/parts-B0wbj_yK.js +436 -0
- package/dist/web/server/assets/{router-CPdWGKQ5.js → router-Ci_9VxDk.js} +244 -104
- package/dist/web/server/assets/{routes-BPloBDc8.js → routes-CVrH9qgo.js} +3 -3
- package/dist/web/server/assets/{routes-Dw1K3TQw.js → routes-D9Mw1_VV.js} +1453 -403
- package/dist/web/server/assets/{routes-xDPesCQu.js → routes-DsuaDPTO.js} +3 -3
- package/dist/web/server/assets/{skills-DWzlT_hC.js → skills-BNbZ75am.js} +1 -1
- package/dist/web/server/assets/{skills-6VSpEORe.js → skills-BWwEFc4a.js} +2 -2
- package/dist/web/server/assets/{skills-D0xrNc2_.js → skills-D5rnOmKJ.js} +9 -7
- package/dist/web/server/assets/src-BeMh8Fze.js +113 -0
- package/dist/web/server/assets/{start-DhW7sy23.js → start-2MvkBRdC.js} +1 -1
- package/dist/web/server/assets/{style-aMybyKzc.js → style-B3l0Wtlf.js} +1 -1
- package/dist/web/server/assets/{system-B5sPgdQW.js → system-Cr4C-YRw.js} +2 -2
- package/dist/web/server/assets/{system-CXmiWyDG.js → system-DT7AU0e6.js} +3 -3
- package/dist/web/server/assets/{system-D3th6n2E.js → system-DsmXkgqn.js} +1 -1
- package/dist/web/server/assets/{teams-ClRBVSYU.js → teams-BeStcDvQ.js} +2 -2
- package/dist/web/server/assets/{teams-yF3I_Zjq.js → teams-CsEBLW8-.js} +14 -8
- package/dist/web/server/assets/{teams-Dq4RCxis.js → teams-Dix5XVIx.js} +2 -2
- package/dist/web/server/assets/{teams-iXiCnN2i.js → teams-DjE0swAZ.js} +10 -6
- package/dist/web/server/assets/{teams-70u1XQTr.js → teams-Rk_RED7X.js} +1 -1
- package/dist/web/server/assets/{teams-BopOP4x7.js → teams-u6m6JzuU.js} +1 -1
- package/dist/web/server/assets/{telegram-DwEgyR1x.js → telegram-BjqABrl-.js} +287 -273
- package/dist/web/server/assets/{telegram-CGol0CKX2.js → telegram-CQpF3EHA.js} +1 -1
- package/dist/web/server/assets/{telegram-D9U9c1MN.js → telegram-DhzHgDfg.js} +2 -2
- package/dist/web/server/assets/{tools-C-wwWjLI.js → tools-DC69leH7.js} +1 -1
- package/dist/web/server/assets/{tools-DflVIdDd.js → tools-Dn6RnOFu.js} +2 -2
- package/dist/web/server/assets/{tools-VPIKjr3y.js → tools-x_DQTQtE.js} +6 -4
- package/dist/web/server/assets/usage-4zMG0sab.js +465 -0
- package/dist/web/server/assets/usage-mvQegG4l.js +46 -0
- package/dist/web/server/assets/{use-resource-CbHGYti0.js → use-resource-BjN1uJoL.js} +10 -2
- package/dist/web/server/assets/{welcome-7DrYZVs6.js → welcome-BuE9FRf4.js} +2 -2
- package/dist/web/server/assets/{welcome-CxXMI4HI.js → welcome-DYw35wl5.js} +1 -1
- package/dist/web/server/assets/{welcome-966nOyyK.js → welcome-DrYbWGd_.js} +8 -6
- package/dist/web/server/assets/workspace-0XPILV1W.js +82 -0
- package/dist/web/server/server.js +20 -20
- package/dist/worker.js +143 -18
- package/dist/worker.js.map +1 -1
- package/package.json +1 -1
- package/dist/web/client/assets/AddProviderDialog-DfFOaCjC.js +0 -1
- package/dist/web/client/assets/AgentTemplateParts-IMJmAQjN.js +0 -1
- package/dist/web/client/assets/ConfigPage-CzLHZa5o.js +0 -1
- package/dist/web/client/assets/ConfirmDialog-Cu_evkgc.js +0 -1
- package/dist/web/client/assets/ConnectionsView-D7Fmutl2.js +0 -1
- package/dist/web/client/assets/ManagePage-BfvlCrmz.js +0 -1
- package/dist/web/client/assets/SectionTabs-D7kPQGoh.js +0 -1
- package/dist/web/client/assets/SkillsParts-BuTxcCam.js +0 -1
- package/dist/web/client/assets/SpawnTeamModal-B1UnOvtp.js +0 -1
- package/dist/web/client/assets/TeamForm-DbzxtRjj.js +0 -1
- package/dist/web/client/assets/TeamThread-jpsWq6vI.js +0 -1
- package/dist/web/client/assets/UnsavedChangesGuard-BfyU9v9i.js +0 -1
- package/dist/web/client/assets/_id-BCNBLF-2.js +0 -1
- package/dist/web/client/assets/_id-D8_H79U2.js +0 -1
- package/dist/web/client/assets/access-CDWe1Kwy.js +0 -1
- package/dist/web/client/assets/agents-sE686DTf.js +0 -1
- package/dist/web/client/assets/agents-yrur1NDa.js +0 -1
- package/dist/web/client/assets/arrow-right-U66krZnr.js +0 -1
- package/dist/web/client/assets/attention-DYEHDfmx.js +0 -1
- package/dist/web/client/assets/chevron-right-CuqJFXTe.js +0 -1
- package/dist/web/client/assets/config-BHv886pr.js +0 -1
- package/dist/web/client/assets/index-GOthyyE-.js +0 -14
- package/dist/web/client/assets/login-Dhe15Uuc.js +0 -1
- package/dist/web/client/assets/mcp-A_Eo7x3q.js +0 -1
- package/dist/web/client/assets/parts-CpIfn_BH.js +0 -41
- package/dist/web/client/assets/plus-CQPjc8uR.js +0 -1
- package/dist/web/client/assets/routes-CTg_yjbY.js +0 -85
- package/dist/web/client/assets/skills-CLjtYtkA.js +0 -1
- package/dist/web/client/assets/style-mjEbxhf5.js +0 -7
- package/dist/web/client/assets/styles-DzcEC3Rd.css +0 -2
- package/dist/web/client/assets/teams-Bhje5n2h.js +0 -1
- package/dist/web/client/assets/teams-Cbgw0Qhv.js +0 -1
- package/dist/web/client/assets/telegram-HtUczmaA.js +0 -1
- package/dist/web/client/assets/tools-BpjFvmoX.js +0 -1
- package/dist/web/client/assets/use-resource-BnvgCpBi.js +0 -1
- package/dist/web/client/assets/welcome-D47LKWYO.js +0 -1
- package/dist/web/server/assets/Rail-b6EbjBB-.js +0 -605
- package/dist/web/server/assets/SpawnDialog-3wNx0W1R.js +0 -1851
- package/dist/web/server/assets/_tanstack-start-manifest_v-kkY_s_uR.js +0 -256
- package/dist/web/server/assets/createSsrRpc-qesavJv-.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
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as modelName } from "./ModelMenu-
|
|
1
|
+
import { l as modelName } from "./ModelMenu-DEJoYASj.js";
|
|
2
2
|
//#region src/lib/manage.ts
|
|
3
3
|
/** "A", "A and B", "A, B and C". */
|
|
4
4
|
function listed(items) {
|
|
@@ -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,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-BTZkDvdc.js");
|
|
6
6
|
var fetchServers = createServerFn({ method: "GET" }).handler(createSsrRpc("278849457893891c3d22806d15e11a0a42cc3630b30e9e62b74cf2d3b982ded7"));
|
|
7
7
|
var Route = createFileRoute("/config/mcp")({
|
|
8
8
|
loader: () => fetchServers(),
|
|
@@ -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-C89B8qKM.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-B0wbj_yK.js";
|
|
5
|
+
import { d as TextField, o as SecretField, s as SelectField } from "./form-Bwsyt9OY.js";
|
|
6
|
+
import { t as Route } from "./mcp-BFixpBQk.js";
|
|
7
|
+
import { t as ConfigPage } from "./ConfigPage-CrxctbtN.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-D-NWKQto.js";
|
|
4
4
|
//#region src/routes/config/mcp.tsx?tss-serverfn-split
|
|
5
5
|
var fetchServers_createServerFn_handler = createServerRpc({
|
|
6
6
|
id: "278849457893891c3d22806d15e11a0a42cc3630b30e9e62b74cf2d3b982ded7",
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import "./src-BeMh8Fze.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";
|