bazilion 0.55.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 +192 -37
- package/dist/cli.js.map +1 -1
- package/dist/daemon.js +1164 -412
- 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-bTJUy9Qf.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-D7kPQGoh.js → SectionTabs-Dc0bNn-J.js} +1 -1
- package/dist/web/client/assets/{Segmented-oPkAHPO1.js → Segmented-iylzLwE6.js} +1 -1
- package/dist/web/client/assets/SkillsParts-C5T7sYDA.js +1 -0
- package/dist/web/client/assets/SpawnTeamModal-DatFF4f_.js +1 -0
- package/dist/web/client/assets/TeamForm-l-N_PYeE.js +1 -0
- package/dist/web/client/assets/TeamThread-BWmIQiAh.js +1 -0
- package/dist/web/client/assets/UnsavedChangesGuard-vQBdMl8h.js +1 -0
- 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-BbQFbTPh.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-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-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-B2ZDYo52.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-D1pnOGPG.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-B-N6NIX4.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-DM3q-V4R.js +1 -0
- package/dist/web/client/assets/{manage-BaIU5zKy.js → manage-R57MUzsY.js} +1 -1
- package/dist/web/client/assets/mcp-CSHrVH1t.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-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-DaNLwvEs.js → square-terminal-CYfGBHPC.js} +1 -1
- package/dist/web/client/assets/style-Bm9QsFpy.js +7 -0
- package/dist/web/client/assets/styles-B-kTTvCo.css +2 -0
- package/dist/web/client/assets/{system-CrTSr5_t.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-Bn0Sx7r6.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-g8wtn_or.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-DtkjBMv4.js} +5 -2
- package/dist/web/server/assets/AgentAvatar-8gTAy_tP.js +37 -0
- package/dist/web/server/assets/{AgentTemplateParts-Ce7snK3m.js → AgentTemplateParts-CxWyovvM.js} +6 -2
- package/dist/web/server/assets/Button-Dsnw22OF.js +17 -0
- package/dist/web/server/assets/{ConfigPage-qP9ejjuw.js → ConfigPage-usZi48Zr.js} +2 -2
- package/dist/web/server/assets/{ConfirmDialog-Z-uYbE9B.js → ConfirmDialog-DAcSBHkT.js} +3 -1
- package/dist/web/server/assets/{ConnectionsView-CLIV7V5D.js → ConnectionsView-Dy6uYSRI.js} +9 -7
- package/dist/web/server/assets/Dialog-DTeF-nOZ.js +85 -0
- package/dist/web/server/assets/{ManagePage-BR9FwVZM.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-DWpdydCJ.js → SkillsParts-Cw05b3al.js} +6 -2
- package/dist/web/server/assets/SpawnDialog-BAE8W91z.js +125 -0
- package/dist/web/server/assets/{SpawnTeamModal-C-YMvoaB.js → SpawnTeamModal-CgBY0HuN.js} +6 -2
- package/dist/web/server/assets/{TeamForm-CL45gBdt.js → TeamForm-JyO5xJXX.js} +6 -2
- package/dist/web/server/assets/{TeamThread-CVVH6kKj.js → TeamThread-5o48EbXL.js} +52 -4
- package/dist/web/server/assets/{UnsavedChangesGuard-CXK75QQp.js → UnsavedChangesGuard-CJQGu45L.js} +1 -1
- package/dist/web/server/assets/{_id-8zsImuGa.js → _id-BE_RSvuN.js} +14 -9
- package/dist/web/server/assets/{_id-d2OwovYV.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-2I4CSMQj.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-BpfoPuTv.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-CwZ27Wsl.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-CyUoElTP.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-C07Cp5Ue.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-vuXrAv1j.js → agents-BXuglv4G.js} +12 -6
- package/dist/web/server/assets/{agents-DTub-rJk.js → agents-DhenbitX.js} +2 -2
- package/dist/web/server/assets/{agents-CwzhpDPm.js → agents-KJcDMj0Y.js} +9 -6
- package/dist/web/server/assets/{agents-DCWEoaxY.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-BqCnJ1hg.js → attention-CDdOCOio.js} +2 -2
- package/dist/web/server/assets/{attention-DwGaur_w.js → attention-DM__BzWY.js} +8 -6
- package/dist/web/server/assets/{attention-Dki8rmGZ.js → attention-X0U6ZmiA.js} +1 -1
- package/dist/web/server/assets/{auth-dJnrFW6y.js → auth-BexhV8Yq.js} +1 -1
- package/dist/web/server/assets/{config-B9dJiji_.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-D3MR2VjE.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-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-C6ucNYZW.js} +2 -1
- package/dist/web/server/assets/{mcp-BQ15a9dG.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-CYQuYWGX.js → mcp-DwCzj7eO.js} +2 -2
- package/dist/web/server/assets/open-groups-BMGYUTtY.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-k9M-atPa.js +436 -0
- package/dist/web/server/assets/{router-CPdWGKQ5.js → router-BttfLktO.js} +185 -77
- package/dist/web/server/assets/{routes-BPloBDc8.js → routes-A7UcreVX.js} +3 -3
- package/dist/web/server/assets/{routes-Dw1K3TQw.js → routes-B9jw-MJ8.js} +1175 -321
- package/dist/web/server/assets/{routes-xDPesCQu.js → routes-BX2FV8rS.js} +3 -3
- package/dist/web/server/assets/{skills-D0xrNc2_.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-6VSpEORe.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-aMybyKzc.js → style-BQ3H9I7Y.js} +1 -1
- package/dist/web/server/assets/{system-B5sPgdQW.js → system-BJPKqM6b.js} +2 -2
- package/dist/web/server/assets/{system-CXmiWyDG.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-yF3I_Zjq.js → teams-B6gbflsZ.js} +10 -6
- package/dist/web/server/assets/{teams-iXiCnN2i.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-ClRBVSYU.js → teams-CiX8LUQo.js} +2 -2
- package/dist/web/server/assets/{teams-Dq4RCxis.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-DwEgyR1x.js → telegram-D8_V7_sW.js} +286 -272
- package/dist/web/server/assets/{telegram-D9U9c1MN.js → telegram-DA2dwLID.js} +2 -2
- package/dist/web/server/assets/{tools-VPIKjr3y.js → tools-CckcG9Jl.js} +5 -3
- package/dist/web/server/assets/{tools-DflVIdDd.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-CbHGYti0.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-966nOyyK.js → welcome-CYhh3iUU.js} +8 -6
- package/dist/web/server/assets/{welcome-7DrYZVs6.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/worker.js +27 -6
- 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/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-
|
|
1
|
+
import { i as api, o as errorMessage } from "./live-DbJeq6KP.js";
|
|
2
|
+
import { r as useResource } from "./use-resource-BUA9qGGY.js";
|
|
3
|
+
import { t as Button } from "./Button-Dsnw22OF.js";
|
|
3
4
|
import { r as ago } from "./ModelMenu-D-hTgYOO.js";
|
|
4
|
-
import { t as ConfirmDialog } from "./ConfirmDialog-
|
|
5
|
-
import { t as
|
|
6
|
-
import { t as
|
|
5
|
+
import { t as ConfirmDialog } from "./ConfirmDialog-DAcSBHkT.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-k9M-atPa.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-BEjeiSy3.js";
|
|
8
|
+
import { t as Route } from "./telegram-DA2dwLID.js";
|
|
9
|
+
import { t as ConfigPage } from "./ConfigPage-usZi48Zr.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,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-D8_V7_sW.js");
|
|
6
6
|
var fetchTelegramConfig = createServerFn({ method: "GET" }).handler(createSsrRpc("9252e07d6f45cb1c4543c2ca6f1b0c4c7697c249f3e6c94fda53b8a603929a92"));
|
|
7
7
|
var Route = createFileRoute("/config/telegram")({
|
|
8
8
|
loader: () => fetchTelegramConfig(),
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as api, o as errorMessage, r as ApiError } from "./live-DbJeq6KP.js";
|
|
2
2
|
import { p as cn } from "./ModelMenu-D-hTgYOO.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { a as CardForm, d as Chip, g as Notice, y as SetupCard } from "./parts-k9M-atPa.js";
|
|
4
|
+
import { a as SaveBar, d as TextField, f as saveStatus, i as Problem, l as SwitchRow, n as ChoiceCards, o as SecretField } from "./form-BEjeiSy3.js";
|
|
5
|
+
import { t as Route } from "./tools-CluiJywK.js";
|
|
6
|
+
import { t as ConfigPage } from "./ConfigPage-usZi48Zr.js";
|
|
5
7
|
import { useId, useState } from "react";
|
|
6
8
|
import { useRouter } from "@tanstack/react-router";
|
|
7
9
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|