Add consent-gated media exchange library
This commit is contained in:
1 parent
b8e4a1bb88
commit
bf474dfe10
42 files changed
+2533
-9
No files matched your search
@@ -44,6 +44,8 @@ import { ConfigStore } from '../config/persistence.js';
|
||||
import { createConfigBackedSubredditPollingControl } from './subreddit-polling-control.js';
|
||||
import { ConversationAutomationService } from './conversation-automation.js';
|
||||
import { AiUsageRepository } from '../database/ai-usage-repository.js';
|
||||
import { MediaLibraryRepository } from '../database/media-library-repository.js';
|
||||
import { MediaLibraryExchangeService } from './media-library-exchange.js';
|
||||
|
||||
export interface ConcreteRuntimeFactoryOptions {
|
||||
config: Config;
|
||||
@@ -193,6 +195,14 @@ async function buildRuntime(
|
||||
sentMessageHistory: async (since) => messagesRepo.getSentTimestampsSince(since),
|
||||
});
|
||||
await rateLimiter.initialize();
|
||||
const mediaExchange = new MediaLibraryExchangeService(
|
||||
new MediaLibraryRepository(db),
|
||||
chatService,
|
||||
logger,
|
||||
session.accountId,
|
||||
undefined,
|
||||
accountConfig.browser.dryRun,
|
||||
);
|
||||
const conversationAutomation = new ConversationAutomationService(
|
||||
chatService,
|
||||
aiClient,
|
||||
@@ -205,6 +215,10 @@ async function buildRuntime(
|
||||
accountConfig.reddit.filterSellers ? accountConfig.reddit.sellerKeywords : [],
|
||||
accountConfig.reddit.filterSellers ? accountConfig.reddit.sellerDomains : [],
|
||||
() => accountConfig.reddit.subreddits,
|
||||
Date.now,
|
||||
undefined,
|
||||
undefined,
|
||||
mediaExchange,
|
||||
);
|
||||
|
||||
const resources: RedditAccountRuntimeResources = {
|
||||
|
||||
Reference in new issue
Block a user