2026-03-01 17:10:55 +00:00
|
|
|
import type { Context } from "./context"
|
2026-02-28 15:57:01 +00:00
|
|
|
import type { FeedItem } from "./feed"
|
|
|
|
|
|
|
|
|
|
export interface ItemGroup {
|
|
|
|
|
/** IDs of items to present together */
|
|
|
|
|
itemIds: string[]
|
|
|
|
|
/** Summary text for the group */
|
|
|
|
|
summary: string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface FeedEnhancement {
|
|
|
|
|
/** New items to inject into the feed */
|
|
|
|
|
additionalItems?: FeedItem[]
|
|
|
|
|
/** Groups of items to present together with a summary */
|
|
|
|
|
groupedItems?: ItemGroup[]
|
|
|
|
|
/** Item IDs to remove from the feed */
|
|
|
|
|
suppress?: string[]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* A function that transforms feed items and produces enhancement directives.
|
|
|
|
|
* Use named functions for meaningful error attribution.
|
|
|
|
|
*/
|
2026-03-01 17:10:55 +00:00
|
|
|
export type FeedPostProcessor = (items: FeedItem[], context: Context) => Promise<FeedEnhancement>
|