@cool-ai/beach-channel-cron
v0.1.1
Published
Beach cron channel — scheduled inbound triggers. Implements core's ChannelAdaptor (inbound only).
Readme
@cool-ai/beach-channel-cron
The cron channel adaptor: scheduled inbound triggers. You own the scheduler — node-cron, a platform timer, whatever — and call fire on each tick; the adaptor turns the tick into an InboundRequest and routes it. A tick fires work; it does not answer a caller, so there is no reply path — send is a no-op and the request carries no reply destination.
It implements core's ChannelAdaptor so it registers with the channel-router uniformly, but only its trigger side does anything.
Use
import { CronChannelAdaptor } from '@cool-ai/beach-channel-cron';
const cron = new CronChannelAdaptor({
inbound: (req) => channelRouter.inbound(req),
});
// From your scheduler:
schedule('0 2 * * *', () => cron.fire('nightly-report', { window: 'last-24h' }));The jobId keys the conversation thread, so repeated ticks of the same job share a session; the payload is handed through channel-blind as the message's data.
