v2 phase 4: channel adapter interface, registry, and host wiring

ChannelAdapter interface with setup/deliver/teardown/setTyping lifecycle.
Self-registration pattern via channel-registry. Host wiring in index-v2
bridges inbound messages to routeInbound and outbound delivery to adapters.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
gavrielc
2026-04-09 00:10:46 +03:00
parent d35386a46e
commit 7201fe5032
6 changed files with 483 additions and 9 deletions

View File

@@ -14,6 +14,7 @@ export {
getMessagingGroup,
getMessagingGroupByPlatform,
getAllMessagingGroups,
getMessagingGroupsByChannel,
updateMessagingGroup,
deleteMessagingGroup,
createMessagingGroupAgent,

View File

@@ -26,6 +26,12 @@ export function getAllMessagingGroups(): MessagingGroup[] {
return getDb().prepare('SELECT * FROM messaging_groups ORDER BY name').all() as MessagingGroup[];
}
export function getMessagingGroupsByChannel(channelType: string): MessagingGroup[] {
return getDb()
.prepare('SELECT * FROM messaging_groups WHERE channel_type = ?')
.all(channelType) as MessagingGroup[];
}
export function updateMessagingGroup(
id: string,
updates: Partial<Pick<MessagingGroup, 'name' | 'is_group' | 'admin_user_id'>>,