mirror of
https://github.com/hansjone/dsh-im-ops.git
synced 2026-10-11 06:33:17 +08:00
Keep IM tool approvals in chat and add WhatsApp default model.
Claim in-flight IM turns before ownership flips active so approvals no longer stick only in DSH Web, auto-recover stale session models once, and let WhatsApp bots pick a shared default model for new sessions. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
2723e94541
commit
74c58bdcde
21 changed files with 1388 additions and 395 deletions
|
|
@ -1,4 +1,9 @@
|
|||
import { normalizeAgentPresetCatalog, normalizeAgentPresetId, SET_AGENT_PRESET_ENDPOINT } from '../../agent-preset.js';
|
||||
import {
|
||||
normalizeDefaultModelSelection,
|
||||
normalizeHostModelCatalog,
|
||||
SET_DEFAULT_MODEL_ENDPOINT,
|
||||
} from '../../default-model.js';
|
||||
import { normalizeLastMessageError } from '../../last-message-error.js';
|
||||
import { normalizeAccessGrant } from '../../../../src/channels/shared/access-grant.mjs';
|
||||
import { normalizeAccessPolicy } from '../../../../src/channels/shared/access-policy.mjs';
|
||||
|
|
@ -21,6 +26,7 @@ export const WHATSAPP_ENDPOINTS = Object.freeze({
|
|||
setGroupSessionScope: 'bot.group-session-scope.set',
|
||||
setWorkspace: 'bot.workspace.set',
|
||||
setAgentPreset: SET_AGENT_PRESET_ENDPOINT,
|
||||
setDefaultModel: SET_DEFAULT_MODEL_ENDPOINT,
|
||||
setContextEnhancement: 'bot.context-enhancement.set',
|
||||
resolveChannelPeer: 'bot.session.channel-peer',
|
||||
});
|
||||
|
|
@ -98,6 +104,7 @@ function normalizeBot(value) {
|
|||
state: connected ? 'connected' : state,
|
||||
workspace: text(value.workspace, '', 4_096),
|
||||
agentPreset: normalizeAgentPresetId(value.agentPreset),
|
||||
defaultModel: normalizeDefaultModelSelection(value.defaultModel),
|
||||
contextEnhancement: normalizeContextEnhancementConfig(value.contextEnhancement),
|
||||
...(Object.hasOwn(value, 'accessPolicy')
|
||||
? { accessPolicy: normalizeAccessPolicy(value.accessPolicy) }
|
||||
|
|
@ -137,6 +144,7 @@ export function normalizeSnapshot(value) {
|
|||
totals: { configured: bots.length, connected: bots.filter((bot) => bot.connected).length },
|
||||
provisioning: source.provisioning ? normalizeProvisioning(source.provisioning) : null,
|
||||
agentPresetCatalog: normalizeAgentPresetCatalog(source.agentPresetCatalog),
|
||||
modelCatalog: normalizeHostModelCatalog(source.modelCatalog),
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue