mirror of
https://github.com/hansjone/dsh-im-ops.git
synced 2026-10-09 04:13:17 +08:00
fix: complete per-bot agent preset lifecycle
This commit is contained in:
parent
8ab4b9e7de
commit
01576f65c6
27 changed files with 721 additions and 208 deletions
|
|
@ -1,4 +1,8 @@
|
|||
import QRCode from 'qrcode';
|
||||
import {
|
||||
normalizeAgentPresetCatalog,
|
||||
normalizeAgentPresetId,
|
||||
} from '../../../../src/channels/shared/agent-preset.mjs';
|
||||
import { publicConnectionTestResult } from '../../../../src/channels/shared/connection-test.mjs';
|
||||
import { resolveRpcAuthority } from '../../rpc-authority.mjs';
|
||||
import { publicWorkspaceError, validWorkspacePayload } from '../shared/workspace-rpc.mjs';
|
||||
|
|
@ -254,6 +258,7 @@ function publicBotEntry(entry) {
|
|||
state: connectionState(source, registration, connected),
|
||||
connected,
|
||||
configured: source.configured === true,
|
||||
agentPreset: normalizeAgentPresetId(source.agentPreset),
|
||||
bot: publicBot(source.bot),
|
||||
health: publicHealth(source, connected),
|
||||
};
|
||||
|
|
@ -295,6 +300,7 @@ export async function toPublicFeishuStatus(status, { encodeQr = qrCodeDataUrl }
|
|||
bot: publicBot(source.bot),
|
||||
health: publicHealth(source, connected),
|
||||
bots,
|
||||
agentPresetCatalog: normalizeAgentPresetCatalog(source.agentPresetCatalog),
|
||||
totals: {
|
||||
configured: bots.length || (source.configured === true ? 1 : 0),
|
||||
connected: bots.length ? bots.filter((bot) => bot.connected).length : (connected ? 1 : 0),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue