src/services/ directory
Service Interface
All services implement this interface:| Method | Description |
|---|---|
initialize(runtime) | Setup with agent runtime |
start() | Begin data fetching |
stop() | Cleanup and stop |
getData<T>() | Get cached data |
refresh() | Force immediate refresh |
getHealth() | Get status and stats |
Service interface in src/services/types.ts
ChanService
Fetches trending threads from SFW 4chan boards. Scores threads by activity (replies + images).| Config | Default | Description |
|---|---|---|
refreshInterval | 10 min | Time between fetches |
maxCacheAge | 30 min | Stale cache threshold |
options.boards | g, sci, biz | Boards to monitor |
src/services/chan.ts
NewsService
Fetches and caches news from RSS feeds and APIs.| Config | Default | Description |
|---|---|---|
refreshInterval | 5 min | Time between fetches |
maxCacheAge | 30 min | Stale cache threshold |
options.sources | BBC, CoinDesk, TechCrunch | News sources |
src/services/news.ts
MarketService
Fetches cryptocurrency price data with sentiment analysis.| Config | Default | Description |
|---|---|---|
refreshInterval | 4 min | Time between fetches |
maxCacheAge | 10 min | Stale cache threshold |
options.assets | bitcoin, ethereum, solana | Tracked assets |
src/services/market.ts
Service Types
| Type | Description |
|---|---|
news | News feed aggregation |
market | Price and market data |
social | Social media mentions |
calendar | Calendar/scheduling |
wallet | Wallet/blockchain data |
storage | File/data storage |
custom | User-defined services |
ServiceType enum in src/services/types.ts