style: prettier formatting fixes
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -29,7 +29,9 @@ function now() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Create a mock ChannelAdapter for testing. */
|
/** Create a mock ChannelAdapter for testing. */
|
||||||
function createMockAdapter(channelType: string): ChannelAdapter & { delivered: OutboundMessage[]; inbound: InboundMessage[] } {
|
function createMockAdapter(
|
||||||
|
channelType: string,
|
||||||
|
): ChannelAdapter & { delivered: OutboundMessage[]; inbound: InboundMessage[] } {
|
||||||
const delivered: OutboundMessage[] = [];
|
const delivered: OutboundMessage[] = [];
|
||||||
const inbound: InboundMessage[] = [];
|
const inbound: InboundMessage[] = [];
|
||||||
let setupConfig: ChannelSetup | null = null;
|
let setupConfig: ChannelSetup | null = null;
|
||||||
@@ -74,9 +76,8 @@ describe('channel registry', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should register and retrieve channel adapters', async () => {
|
it('should register and retrieve channel adapters', async () => {
|
||||||
const { registerChannelAdapter, getRegisteredChannelNames, getChannelContainerConfig } = await import(
|
const { registerChannelAdapter, getRegisteredChannelNames, getChannelContainerConfig } =
|
||||||
'./channel-registry.js'
|
await import('./channel-registry.js');
|
||||||
);
|
|
||||||
|
|
||||||
registerChannelAdapter('test-channel', {
|
registerChannelAdapter('test-channel', {
|
||||||
factory: () => createMockAdapter('test'),
|
factory: () => createMockAdapter('test'),
|
||||||
|
|||||||
@@ -27,9 +27,7 @@ export function getAllMessagingGroups(): MessagingGroup[] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getMessagingGroupsByChannel(channelType: string): MessagingGroup[] {
|
export function getMessagingGroupsByChannel(channelType: string): MessagingGroup[] {
|
||||||
return getDb()
|
return getDb().prepare('SELECT * FROM messaging_groups WHERE channel_type = ?').all(channelType) as MessagingGroup[];
|
||||||
.prepare('SELECT * FROM messaging_groups WHERE channel_type = ?')
|
|
||||||
.all(channelType) as MessagingGroup[];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function updateMessagingGroup(
|
export function updateMessagingGroup(
|
||||||
|
|||||||
@@ -20,11 +20,7 @@ import { log } from './log.js';
|
|||||||
// import './channels/discord-v2.js';
|
// import './channels/discord-v2.js';
|
||||||
|
|
||||||
import type { ChannelAdapter, ChannelSetup, ConversationConfig } from './channels/adapter.js';
|
import type { ChannelAdapter, ChannelSetup, ConversationConfig } from './channels/adapter.js';
|
||||||
import {
|
import { initChannelAdapters, teardownChannelAdapters, getChannelAdapter } from './channels/channel-registry.js';
|
||||||
initChannelAdapters,
|
|
||||||
teardownChannelAdapters,
|
|
||||||
getChannelAdapter,
|
|
||||||
} from './channels/channel-registry.js';
|
|
||||||
|
|
||||||
async function main(): Promise<void> {
|
async function main(): Promise<void> {
|
||||||
log.info('NanoClaw v2 starting');
|
log.info('NanoClaw v2 starting');
|
||||||
|
|||||||
Reference in New Issue
Block a user