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
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as useResource } from "./use-resource-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { t as
|
|
6
|
-
import { t as
|
|
1
|
+
import { i as api, o as errorMessage } from "./live-DbJeq6KP.js";
|
|
2
|
+
import { r as useResource } from "./use-resource-BjN1uJoL.js";
|
|
3
|
+
import { t as Button } from "./Button-Dsnw22OF.js";
|
|
4
|
+
import { r as ago } from "./ModelMenu-DEJoYASj.js";
|
|
5
|
+
import { t as ConfirmDialog } from "./ConfirmDialog-C89B8qKM.js";
|
|
6
|
+
import { a as CardForm, d as Chip, f as Fact, g as Notice, h as ListRow, l as CheckItem, o as CardList, p as Facts, r as CardBody, s as CardRow, t as Banner, u as CheckList, x as Waiting, y as SetupCard } from "./parts-B0wbj_yK.js";
|
|
7
|
+
import { a as SaveBar, d as TextField, f as saveStatus, i as Problem, l as SwitchRow, o as SecretField, t as CheckboxRow } from "./form-Bwsyt9OY.js";
|
|
8
|
+
import { t as Route } from "./telegram-DhzHgDfg.js";
|
|
9
|
+
import { t as ConfigPage } from "./ConfigPage-CrxctbtN.js";
|
|
7
10
|
import { useEffect, useState } from "react";
|
|
8
11
|
import { useRouter } from "@tanstack/react-router";
|
|
9
12
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -235,7 +238,8 @@ var KINDS = {
|
|
|
235
238
|
review_failure: "Review failures",
|
|
236
239
|
trigger_failure: "Scheduled trigger failures",
|
|
237
240
|
agent_loop_break: "Agent message loop breaks",
|
|
238
|
-
queue_interrupted: "Queues paused after restart"
|
|
241
|
+
queue_interrupted: "Queues paused after restart",
|
|
242
|
+
turn_failure: "Failed background turns"
|
|
239
243
|
};
|
|
240
244
|
function browserZone() {
|
|
241
245
|
try {
|
|
@@ -387,7 +391,7 @@ function NotificationsForm({ settings, justSaved, onSaved }) {
|
|
|
387
391
|
});
|
|
388
392
|
}
|
|
389
393
|
//#endregion
|
|
390
|
-
//#region src/components/setup/
|
|
394
|
+
//#region src/components/setup/telegram/parts.tsx
|
|
391
395
|
var TELEGRAM_PATH = "/api/config/telegram";
|
|
392
396
|
function StateChip({ state }) {
|
|
393
397
|
return state && /* @__PURE__ */ jsx(Chip, {
|
|
@@ -395,51 +399,137 @@ function StateChip({ state }) {
|
|
|
395
399
|
children: state.label
|
|
396
400
|
});
|
|
397
401
|
}
|
|
398
|
-
|
|
399
|
-
|
|
402
|
+
//#endregion
|
|
403
|
+
//#region src/components/setup/telegram/AllowedUsersCard.tsx
|
|
404
|
+
/** The Telegram users who may use the bot besides its owner. */
|
|
405
|
+
function AllowedUsersCard() {
|
|
406
|
+
const [users, setUsers] = useState(null);
|
|
407
|
+
const [userId, setUserId] = useState("");
|
|
408
|
+
const [label, setLabel] = useState("");
|
|
400
409
|
const [busy, setBusy] = useState(false);
|
|
401
410
|
const [error, setError] = useState(null);
|
|
402
|
-
|
|
411
|
+
const [removing, setRemoving] = useState(null);
|
|
412
|
+
const path = `${TELEGRAM_PATH}/acl`;
|
|
413
|
+
const load = async () => setUsers(await api(path));
|
|
414
|
+
useEffect(() => {
|
|
415
|
+
load().catch((cause) => setError(errorMessage(cause)));
|
|
416
|
+
}, []);
|
|
417
|
+
const id = userId.trim();
|
|
418
|
+
const idProblem = id !== "" && !/^\d+$/.test(id) ? "A Telegram user id is a number, like 123456789." : void 0;
|
|
419
|
+
async function add(event) {
|
|
420
|
+
event.preventDefault();
|
|
421
|
+
if (id === "" || idProblem || busy) return;
|
|
403
422
|
setBusy(true);
|
|
404
423
|
setError(null);
|
|
405
424
|
try {
|
|
406
|
-
await api(
|
|
407
|
-
|
|
425
|
+
await api(path, { body: {
|
|
426
|
+
userId: Number(id),
|
|
427
|
+
label: label.trim() || null
|
|
428
|
+
} });
|
|
429
|
+
setUserId("");
|
|
430
|
+
setLabel("");
|
|
431
|
+
await load();
|
|
408
432
|
} catch (cause) {
|
|
409
433
|
setError(errorMessage(cause));
|
|
410
434
|
} finally {
|
|
411
435
|
setBusy(false);
|
|
412
436
|
}
|
|
413
437
|
}
|
|
414
|
-
return /* @__PURE__ */ jsxs(
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
children:
|
|
438
|
+
return /* @__PURE__ */ jsxs(SetupCard, {
|
|
439
|
+
labelledBy: "telegram-allowed",
|
|
440
|
+
icon: /* @__PURE__ */ jsx(Users, { className: "size-5" }),
|
|
441
|
+
title: "Allowed users",
|
|
442
|
+
description: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
443
|
+
"The Telegram users who can use the bot, for commands and chat. Anyone finds their id by sending ",
|
|
444
|
+
/* @__PURE__ */ jsx("code", { children: "/whoami" }),
|
|
445
|
+
"."
|
|
446
|
+
] }),
|
|
447
|
+
action: /* @__PURE__ */ jsx(StateChip, { state: allowedState(users) }),
|
|
448
|
+
children: [
|
|
449
|
+
users === null && !error && /* @__PURE__ */ jsx(CardRow, {
|
|
450
|
+
className: "py-4",
|
|
451
|
+
children: /* @__PURE__ */ jsx(Waiting, { children: "Loading…" })
|
|
428
452
|
}),
|
|
429
|
-
|
|
430
|
-
"
|
|
431
|
-
" "
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
453
|
+
users && !hasOwner(users) && /* @__PURE__ */ jsx(CardRow, {
|
|
454
|
+
className: "py-4 text-sm text-muted-foreground",
|
|
455
|
+
children: "Closed: the bot has no owner yet. Others can be added once the owner is paired above."
|
|
456
|
+
}),
|
|
457
|
+
users && users.length > 0 && /* @__PURE__ */ jsx(CardList, { children: users.map((user) => {
|
|
458
|
+
const name = allowedName(user);
|
|
459
|
+
return /* @__PURE__ */ jsx(ListRow, {
|
|
460
|
+
title: name,
|
|
461
|
+
meta: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", { children: user.role === "owner" ? "Owner" : "Member" }), name !== String(user.userId) && /* @__PURE__ */ jsx("code", { children: user.userId })] }),
|
|
462
|
+
actions: user.role !== "owner" && /* @__PURE__ */ jsx(Button, {
|
|
463
|
+
variant: "danger",
|
|
464
|
+
disabled: busy,
|
|
465
|
+
"aria-label": `Remove ${name}`,
|
|
466
|
+
onClick: () => setRemoving(user),
|
|
467
|
+
children: "Remove"
|
|
468
|
+
})
|
|
469
|
+
}, user.userId);
|
|
470
|
+
}) }),
|
|
471
|
+
users && hasOwner(users) && /* @__PURE__ */ jsxs(CardForm, {
|
|
472
|
+
onSubmit: add,
|
|
473
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
474
|
+
className: "grid items-start gap-x-3 gap-y-4 sm:grid-cols-[minmax(0,14rem)_minmax(0,18rem)]",
|
|
475
|
+
children: [/* @__PURE__ */ jsx(TextField, {
|
|
476
|
+
label: "Telegram user ID",
|
|
477
|
+
value: userId,
|
|
478
|
+
disabled: busy,
|
|
479
|
+
placeholder: "123456789",
|
|
480
|
+
mono: true,
|
|
481
|
+
inputMode: "numeric",
|
|
482
|
+
problem: idProblem,
|
|
483
|
+
onChange: setUserId
|
|
484
|
+
}), /* @__PURE__ */ jsx(TextField, {
|
|
485
|
+
label: "Label (optional)",
|
|
486
|
+
value: label,
|
|
487
|
+
disabled: busy,
|
|
488
|
+
placeholder: "e.g. Pat",
|
|
489
|
+
onChange: setLabel
|
|
490
|
+
})]
|
|
491
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
492
|
+
className: "flex flex-wrap items-center gap-x-4 gap-y-2",
|
|
493
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
494
|
+
variant: "primary",
|
|
495
|
+
type: "submit",
|
|
496
|
+
disabled: busy || id === "" || idProblem !== void 0,
|
|
497
|
+
children: busy ? "Adding…" : "Add user"
|
|
498
|
+
})
|
|
499
|
+
})]
|
|
500
|
+
}),
|
|
501
|
+
error && /* @__PURE__ */ jsx(CardBody, { children: /* @__PURE__ */ jsx(Notice, {
|
|
502
|
+
tone: "warning",
|
|
503
|
+
role: "alert",
|
|
504
|
+
title: "That did not work.",
|
|
505
|
+
children: error
|
|
506
|
+
}) }),
|
|
507
|
+
/* @__PURE__ */ jsx(ConfirmDialog, {
|
|
508
|
+
open: removing !== null,
|
|
509
|
+
onOpenChange: (open) => {
|
|
510
|
+
if (!open) setRemoving(null);
|
|
511
|
+
},
|
|
512
|
+
title: `Remove ${removing ? allowedName(removing) : ""}?`,
|
|
513
|
+
description: /* @__PURE__ */ jsxs("p", {
|
|
514
|
+
className: "m-0",
|
|
515
|
+
children: [
|
|
516
|
+
"Telegram user ",
|
|
517
|
+
/* @__PURE__ */ jsx("code", { children: removing?.userId }),
|
|
518
|
+
" immediately loses command and chat access. Their Telegram account is not changed, and they can be allowed again later."
|
|
519
|
+
]
|
|
520
|
+
}),
|
|
521
|
+
confirmLabel: "Remove Telegram access",
|
|
522
|
+
onConfirm: async () => {
|
|
523
|
+
if (!removing) return;
|
|
524
|
+
await api(`${path}/${removing.userId}`, { method: "DELETE" });
|
|
525
|
+
await load();
|
|
526
|
+
}
|
|
527
|
+
})
|
|
528
|
+
]
|
|
441
529
|
});
|
|
442
530
|
}
|
|
531
|
+
//#endregion
|
|
532
|
+
//#region src/components/setup/telegram/BotCard.tsx
|
|
443
533
|
/** The bot's token and the group it works in, saved together. */
|
|
444
534
|
function BotCard({ stored, state, justSaved, onSaved, onDisconnected }) {
|
|
445
535
|
const [draft, setDraft] = useState({
|
|
@@ -563,128 +653,55 @@ function BotCard({ stored, state, justSaved, onSaved, onDisconnected }) {
|
|
|
563
653
|
]
|
|
564
654
|
});
|
|
565
655
|
}
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
tone: "warning",
|
|
599
|
-
role: "alert",
|
|
600
|
-
title: "That did not work.",
|
|
601
|
-
children: error
|
|
602
|
-
}),
|
|
603
|
-
health?.error && /* @__PURE__ */ jsxs(Notice, {
|
|
604
|
-
tone: "warning",
|
|
605
|
-
role: "alert",
|
|
606
|
-
title: /* @__PURE__ */ jsxs(Fragment$1, { children: ["Failed at ", /* @__PURE__ */ jsx("code", { children: health.error.step })] }),
|
|
607
|
-
children: [/* @__PURE__ */ jsx("p", {
|
|
608
|
-
className: "m-0",
|
|
609
|
-
children: health.error.message
|
|
610
|
-
}), /* @__PURE__ */ jsx("p", {
|
|
611
|
-
className: "m-0 mt-1 text-muted-foreground",
|
|
612
|
-
children: preflightHint(health.error.step)
|
|
613
|
-
})]
|
|
614
|
-
}),
|
|
615
|
-
health?.preflight && /* @__PURE__ */ jsxs("div", {
|
|
616
|
-
role: "status",
|
|
617
|
-
"aria-live": "polite",
|
|
618
|
-
"aria-atomic": "true",
|
|
619
|
-
className: "grid gap-3",
|
|
620
|
-
children: [/* @__PURE__ */ jsx(CheckList, { children: preflightChecks(health.preflight).map((check) => /* @__PURE__ */ jsx(CheckItem, {
|
|
621
|
-
ok: check.ok,
|
|
622
|
-
label: check.label,
|
|
623
|
-
children: check.detail
|
|
624
|
-
}, check.label)) }), /* @__PURE__ */ jsxs("p", {
|
|
625
|
-
className: "m-0 text-sm text-muted-foreground",
|
|
626
|
-
children: [
|
|
627
|
-
"Group members: ",
|
|
628
|
-
health.preflight.memberCount ?? "unknown",
|
|
629
|
-
". Everyone in the group can read the Agents’ replies."
|
|
630
|
-
]
|
|
631
|
-
})]
|
|
632
|
-
}),
|
|
633
|
-
health && !health.error && !health.preflight && /* @__PURE__ */ jsx("p", {
|
|
634
|
-
role: "status",
|
|
635
|
-
className: "m-0 text-sm text-muted-foreground",
|
|
636
|
-
children: "No preflight data."
|
|
637
|
-
})
|
|
638
|
-
] }), health?.polling && /* @__PURE__ */ jsx(PollingFacts, {
|
|
639
|
-
polling: health.polling,
|
|
640
|
-
now
|
|
641
|
-
})]
|
|
642
|
-
});
|
|
643
|
-
}
|
|
644
|
-
function PollingFacts({ polling, now }) {
|
|
645
|
-
const moment = (at) => /* @__PURE__ */ jsx("time", {
|
|
646
|
-
dateTime: new Date(at).toISOString(),
|
|
647
|
-
children: ago(at, now)
|
|
648
|
-
});
|
|
649
|
-
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(CardRow, {
|
|
650
|
-
className: "bg-muted/50 py-2 text-xs font-bold uppercase tracking-[0.08em] text-muted-foreground",
|
|
651
|
-
children: "The running bot"
|
|
652
|
-
}), /* @__PURE__ */ jsxs(Facts, {
|
|
653
|
-
className: "border-t-0",
|
|
654
|
-
children: [
|
|
655
|
-
/* @__PURE__ */ jsx(Fact, {
|
|
656
|
-
label: "Polling",
|
|
657
|
-
tone: polling.running ? "success" : "warning",
|
|
658
|
-
children: polling.running ? "Running" : "Stopped"
|
|
659
|
-
}),
|
|
660
|
-
/* @__PURE__ */ jsx(Fact, {
|
|
661
|
-
label: "Group setup",
|
|
662
|
-
tone: polling.activated ? "success" : "warning",
|
|
663
|
-
children: polling.activated ? "Activated" : "Awaiting activation"
|
|
664
|
-
}),
|
|
665
|
-
polling.startedAt !== null && /* @__PURE__ */ jsx(Fact, {
|
|
666
|
-
label: "Started",
|
|
667
|
-
children: moment(polling.startedAt)
|
|
668
|
-
}),
|
|
669
|
-
polling.lastSuccessfulPollAt !== null && /* @__PURE__ */ jsx(Fact, {
|
|
670
|
-
label: "Last poll",
|
|
671
|
-
children: moment(polling.lastSuccessfulPollAt)
|
|
672
|
-
}),
|
|
673
|
-
polling.lastUpdateId !== null && /* @__PURE__ */ jsx(Fact, {
|
|
674
|
-
label: "Last update",
|
|
675
|
-
children: /* @__PURE__ */ jsx("span", {
|
|
676
|
-
className: "font-mono text-[0.9em]",
|
|
677
|
-
children: polling.lastUpdateId
|
|
678
|
-
})
|
|
656
|
+
//#endregion
|
|
657
|
+
//#region src/components/setup/telegram/MigrationBanner.tsx
|
|
658
|
+
/** Telegram moved the group to a new id, and the bot still points at the old one. */
|
|
659
|
+
function MigrationBanner({ toChatId, onReconnected }) {
|
|
660
|
+
const [busy, setBusy] = useState(false);
|
|
661
|
+
const [error, setError] = useState(null);
|
|
662
|
+
async function reconnect() {
|
|
663
|
+
setBusy(true);
|
|
664
|
+
setError(null);
|
|
665
|
+
try {
|
|
666
|
+
await api(`${TELEGRAM_PATH}/reconnect`, { method: "POST" });
|
|
667
|
+
await onReconnected();
|
|
668
|
+
} catch (cause) {
|
|
669
|
+
setError(errorMessage(cause));
|
|
670
|
+
} finally {
|
|
671
|
+
setBusy(false);
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
675
|
+
className: "grid gap-2",
|
|
676
|
+
children: [/* @__PURE__ */ jsxs(Banner, {
|
|
677
|
+
tone: "warning",
|
|
678
|
+
lead: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
679
|
+
"Telegram moved this group to a new chat id, ",
|
|
680
|
+
/* @__PURE__ */ jsx("code", { children: toChatId }),
|
|
681
|
+
"."
|
|
682
|
+
] }),
|
|
683
|
+
action: /* @__PURE__ */ jsx(Button, {
|
|
684
|
+
variant: "primary",
|
|
685
|
+
disabled: busy,
|
|
686
|
+
onClick: () => void reconnect(),
|
|
687
|
+
children: busy ? "Reconnecting…" : "Reconnect"
|
|
679
688
|
}),
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
children:
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
689
|
+
children: [
|
|
690
|
+
"The bot still points at the old id. Reconnecting moves it over and creates the",
|
|
691
|
+
" ",
|
|
692
|
+
/* @__PURE__ */ jsx("code", { children: "⚙ bazilion" }),
|
|
693
|
+
" service topic again in the new group; each Agent’s topic follows when it is next used."
|
|
694
|
+
]
|
|
695
|
+
}), error && /* @__PURE__ */ jsx(Banner, {
|
|
696
|
+
tone: "warning",
|
|
697
|
+
role: "alert",
|
|
698
|
+
lead: "The bot was not reconnected.",
|
|
699
|
+
children: error
|
|
700
|
+
})]
|
|
701
|
+
});
|
|
687
702
|
}
|
|
703
|
+
//#endregion
|
|
704
|
+
//#region src/components/setup/telegram/PairingCard.tsx
|
|
688
705
|
/** The one person the bot belongs to: paired with a code sent in the group. */
|
|
689
706
|
function PairingCard({ onOwnerChange }) {
|
|
690
707
|
const [status, setStatus] = useState(null);
|
|
@@ -819,132 +836,129 @@ function PairingCard({ onOwnerChange }) {
|
|
|
819
836
|
})]
|
|
820
837
|
});
|
|
821
838
|
}
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
const [label, setLabel] = useState("");
|
|
827
|
-
const [busy, setBusy] = useState(false);
|
|
828
|
-
const [error, setError] = useState(null);
|
|
829
|
-
const [removing, setRemoving] = useState(null);
|
|
830
|
-
const path = `${TELEGRAM_PATH}/acl`;
|
|
831
|
-
const load = async () => setUsers(await api(path));
|
|
832
|
-
useEffect(() => {
|
|
833
|
-
load().catch((cause) => setError(errorMessage(cause)));
|
|
834
|
-
}, []);
|
|
835
|
-
const id = userId.trim();
|
|
836
|
-
const idProblem = id !== "" && !/^\d+$/.test(id) ? "A Telegram user id is a number, like 123456789." : void 0;
|
|
837
|
-
async function add(event) {
|
|
838
|
-
event.preventDefault();
|
|
839
|
-
if (id === "" || idProblem || busy) return;
|
|
840
|
-
setBusy(true);
|
|
841
|
-
setError(null);
|
|
842
|
-
try {
|
|
843
|
-
await api(path, { body: {
|
|
844
|
-
userId: Number(id),
|
|
845
|
-
label: label.trim() || null
|
|
846
|
-
} });
|
|
847
|
-
setUserId("");
|
|
848
|
-
setLabel("");
|
|
849
|
-
await load();
|
|
850
|
-
} catch (cause) {
|
|
851
|
-
setError(errorMessage(cause));
|
|
852
|
-
} finally {
|
|
853
|
-
setBusy(false);
|
|
854
|
-
}
|
|
855
|
-
}
|
|
839
|
+
//#endregion
|
|
840
|
+
//#region src/components/setup/telegram/PreflightCard.tsx
|
|
841
|
+
/** What Telegram answers about the bot and its group, and how the running bot is doing. */
|
|
842
|
+
function PreflightCard({ configured, health, working, note, error, now, onRun, onRestart }) {
|
|
856
843
|
return /* @__PURE__ */ jsxs(SetupCard, {
|
|
857
|
-
labelledBy: "telegram-
|
|
858
|
-
icon: /* @__PURE__ */ jsx(
|
|
859
|
-
title: "
|
|
860
|
-
description:
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
"
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
users && users.length > 0 && /* @__PURE__ */ jsx(CardList, { children: users.map((user) => {
|
|
876
|
-
const name = allowedName(user);
|
|
877
|
-
return /* @__PURE__ */ jsx(ListRow, {
|
|
878
|
-
title: name,
|
|
879
|
-
meta: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", { children: user.role === "owner" ? "Owner" : "Member" }), name !== String(user.userId) && /* @__PURE__ */ jsx("code", { children: user.userId })] }),
|
|
880
|
-
actions: user.role !== "owner" && /* @__PURE__ */ jsx(Button, {
|
|
881
|
-
variant: "danger",
|
|
882
|
-
disabled: busy,
|
|
883
|
-
"aria-label": `Remove ${name}`,
|
|
884
|
-
onClick: () => setRemoving(user),
|
|
885
|
-
children: "Remove"
|
|
886
|
-
})
|
|
887
|
-
}, user.userId);
|
|
888
|
-
}) }),
|
|
889
|
-
users && hasOwner(users) && /* @__PURE__ */ jsxs(CardForm, {
|
|
890
|
-
onSubmit: add,
|
|
891
|
-
children: [/* @__PURE__ */ jsxs("div", {
|
|
892
|
-
className: "grid items-start gap-x-3 gap-y-4 sm:grid-cols-[minmax(0,14rem)_minmax(0,18rem)]",
|
|
893
|
-
children: [/* @__PURE__ */ jsx(TextField, {
|
|
894
|
-
label: "Telegram user ID",
|
|
895
|
-
value: userId,
|
|
896
|
-
disabled: busy,
|
|
897
|
-
placeholder: "123456789",
|
|
898
|
-
mono: true,
|
|
899
|
-
inputMode: "numeric",
|
|
900
|
-
problem: idProblem,
|
|
901
|
-
onChange: setUserId
|
|
902
|
-
}), /* @__PURE__ */ jsx(TextField, {
|
|
903
|
-
label: "Label (optional)",
|
|
904
|
-
value: label,
|
|
905
|
-
disabled: busy,
|
|
906
|
-
placeholder: "e.g. Pat",
|
|
907
|
-
onChange: setLabel
|
|
908
|
-
})]
|
|
909
|
-
}), /* @__PURE__ */ jsx("div", {
|
|
910
|
-
className: "flex flex-wrap items-center gap-x-4 gap-y-2",
|
|
911
|
-
children: /* @__PURE__ */ jsx(Button, {
|
|
912
|
-
variant: "primary",
|
|
913
|
-
type: "submit",
|
|
914
|
-
disabled: busy || id === "" || idProblem !== void 0,
|
|
915
|
-
children: busy ? "Adding…" : "Add user"
|
|
916
|
-
})
|
|
844
|
+
labelledBy: "telegram-preflight",
|
|
845
|
+
icon: /* @__PURE__ */ jsx(ListChecks, { className: "size-5" }),
|
|
846
|
+
title: "Preflight checks",
|
|
847
|
+
description: "Asks Telegram whether the bot and its group are set up the way Bazilion needs.",
|
|
848
|
+
action: /* @__PURE__ */ jsx(StateChip, { state: preflightState(health) }),
|
|
849
|
+
children: [/* @__PURE__ */ jsxs(CardBody, { children: [
|
|
850
|
+
configured ? /* @__PURE__ */ jsxs("div", {
|
|
851
|
+
className: "flex flex-wrap items-center gap-2",
|
|
852
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
853
|
+
variant: "primary",
|
|
854
|
+
disabled: working !== null,
|
|
855
|
+
onClick: onRun,
|
|
856
|
+
children: working === "check" ? "Checking…" : "Run preflight"
|
|
857
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
858
|
+
variant: "ghost",
|
|
859
|
+
disabled: working !== null,
|
|
860
|
+
onClick: onRestart,
|
|
861
|
+
children: working === "restart" ? "Restarting…" : "Restart bot"
|
|
917
862
|
})]
|
|
863
|
+
}) : /* @__PURE__ */ jsx("p", {
|
|
864
|
+
className: "m-0 text-sm text-muted-foreground",
|
|
865
|
+
children: "Save the bot’s credentials above first."
|
|
918
866
|
}),
|
|
919
|
-
|
|
867
|
+
working === "check" && /* @__PURE__ */ jsx(Waiting, { children: "Asking Telegram…" }),
|
|
868
|
+
note && /* @__PURE__ */ jsx(Notice, {
|
|
869
|
+
tone: "neutral",
|
|
870
|
+
children: note
|
|
871
|
+
}),
|
|
872
|
+
error && /* @__PURE__ */ jsx(Notice, {
|
|
920
873
|
tone: "warning",
|
|
921
874
|
role: "alert",
|
|
922
875
|
title: "That did not work.",
|
|
923
876
|
children: error
|
|
924
|
-
})
|
|
925
|
-
/* @__PURE__ */
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
title: `Remove ${removing ? allowedName(removing) : ""}?`,
|
|
931
|
-
description: /* @__PURE__ */ jsxs("p", {
|
|
877
|
+
}),
|
|
878
|
+
health?.error && /* @__PURE__ */ jsxs(Notice, {
|
|
879
|
+
tone: "warning",
|
|
880
|
+
role: "alert",
|
|
881
|
+
title: /* @__PURE__ */ jsxs(Fragment$1, { children: ["Failed at ", /* @__PURE__ */ jsx("code", { children: health.error.step })] }),
|
|
882
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
932
883
|
className: "m-0",
|
|
884
|
+
children: health.error.message
|
|
885
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
886
|
+
className: "m-0 mt-1 text-muted-foreground",
|
|
887
|
+
children: preflightHint(health.error.step)
|
|
888
|
+
})]
|
|
889
|
+
}),
|
|
890
|
+
health?.preflight && /* @__PURE__ */ jsxs("div", {
|
|
891
|
+
role: "status",
|
|
892
|
+
"aria-live": "polite",
|
|
893
|
+
"aria-atomic": "true",
|
|
894
|
+
className: "grid gap-3",
|
|
895
|
+
children: [/* @__PURE__ */ jsx(CheckList, { children: preflightChecks(health.preflight).map((check) => /* @__PURE__ */ jsx(CheckItem, {
|
|
896
|
+
ok: check.ok,
|
|
897
|
+
label: check.label,
|
|
898
|
+
children: check.detail
|
|
899
|
+
}, check.label)) }), /* @__PURE__ */ jsxs("p", {
|
|
900
|
+
className: "m-0 text-sm text-muted-foreground",
|
|
933
901
|
children: [
|
|
934
|
-
"
|
|
935
|
-
|
|
936
|
-
"
|
|
902
|
+
"Group members: ",
|
|
903
|
+
health.preflight.memberCount ?? "unknown",
|
|
904
|
+
". Everyone in the group can read the Agents’ replies."
|
|
937
905
|
]
|
|
938
|
-
})
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
}
|
|
906
|
+
})]
|
|
907
|
+
}),
|
|
908
|
+
health && !health.error && !health.preflight && /* @__PURE__ */ jsx("p", {
|
|
909
|
+
role: "status",
|
|
910
|
+
className: "m-0 text-sm text-muted-foreground",
|
|
911
|
+
children: "No preflight data."
|
|
945
912
|
})
|
|
946
|
-
]
|
|
913
|
+
] }), health?.polling && /* @__PURE__ */ jsx(PollingFacts, {
|
|
914
|
+
polling: health.polling,
|
|
915
|
+
now
|
|
916
|
+
})]
|
|
917
|
+
});
|
|
918
|
+
}
|
|
919
|
+
function PollingFacts({ polling, now }) {
|
|
920
|
+
const moment = (at) => /* @__PURE__ */ jsx("time", {
|
|
921
|
+
dateTime: new Date(at).toISOString(),
|
|
922
|
+
children: ago(at, now)
|
|
947
923
|
});
|
|
924
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(CardRow, {
|
|
925
|
+
className: "bg-muted/50 py-2 text-xs font-bold uppercase tracking-[0.08em] text-muted-foreground",
|
|
926
|
+
children: "The running bot"
|
|
927
|
+
}), /* @__PURE__ */ jsxs(Facts, {
|
|
928
|
+
className: "border-t-0",
|
|
929
|
+
children: [
|
|
930
|
+
/* @__PURE__ */ jsx(Fact, {
|
|
931
|
+
label: "Polling",
|
|
932
|
+
tone: polling.running ? "success" : "warning",
|
|
933
|
+
children: polling.running ? "Running" : "Stopped"
|
|
934
|
+
}),
|
|
935
|
+
/* @__PURE__ */ jsx(Fact, {
|
|
936
|
+
label: "Group setup",
|
|
937
|
+
tone: polling.activated ? "success" : "warning",
|
|
938
|
+
children: polling.activated ? "Activated" : "Awaiting activation"
|
|
939
|
+
}),
|
|
940
|
+
polling.startedAt !== null && /* @__PURE__ */ jsx(Fact, {
|
|
941
|
+
label: "Started",
|
|
942
|
+
children: moment(polling.startedAt)
|
|
943
|
+
}),
|
|
944
|
+
polling.lastSuccessfulPollAt !== null && /* @__PURE__ */ jsx(Fact, {
|
|
945
|
+
label: "Last poll",
|
|
946
|
+
children: moment(polling.lastSuccessfulPollAt)
|
|
947
|
+
}),
|
|
948
|
+
polling.lastUpdateId !== null && /* @__PURE__ */ jsx(Fact, {
|
|
949
|
+
label: "Last update",
|
|
950
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
951
|
+
className: "font-mono text-[0.9em]",
|
|
952
|
+
children: polling.lastUpdateId
|
|
953
|
+
})
|
|
954
|
+
}),
|
|
955
|
+
polling.error && /* @__PURE__ */ jsx(Fact, {
|
|
956
|
+
label: "Error",
|
|
957
|
+
tone: "warning",
|
|
958
|
+
children: polling.error
|
|
959
|
+
})
|
|
960
|
+
]
|
|
961
|
+
})] });
|
|
948
962
|
}
|
|
949
963
|
//#endregion
|
|
950
964
|
//#region src/routes/config/telegram.tsx?tsr-split=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-D-NWKQto.js";
|
|
4
4
|
//#region src/routes/config/telegram.tsx?tss-serverfn-split
|
|
5
5
|
var fetchTelegramConfig_createServerFn_handler = createServerRpc({
|
|
6
6
|
id: "9252e07d6f45cb1c4543c2ca6f1b0c4c7697c249f3e6c94fda53b8a603929a92",
|
|
@@ -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/telegram.tsx
|
|
5
|
-
var $$splitComponentImporter = () => import("./telegram-
|
|
5
|
+
var $$splitComponentImporter = () => import("./telegram-BjqABrl-.js");
|
|
6
6
|
var fetchTelegramConfig = createServerFn({ method: "GET" }).handler(createSsrRpc("9252e07d6f45cb1c4543c2ca6f1b0c4c7697c249f3e6c94fda53b8a603929a92"));
|
|
7
7
|
var Route = createFileRoute("/config/telegram")({
|
|
8
8
|
loader: () => fetchTelegramConfig(),
|
|
@@ -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/tools.tsx?tss-serverfn-split
|
|
5
5
|
var fetchTools_createServerFn_handler = createServerRpc({
|
|
6
6
|
id: "946c6cbff3f55931c3fb28c971d20b18b4b8a9f25417a5d1afc0550d7afa393b",
|