feat: wake agent via dispatchInboundMessage (in-process)
Use the same mechanism as Discord plugin — direct in-process call
to dispatchInboundMessageWithDispatcher from plugin-sdk. No WebSocket,
no CLI, no cron service dependency.
Creates unique session key per slot: agent:{agentId}:hf-calendar:slot-{slotId}
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -7,20 +7,10 @@ export function registerGatewayStartHook(api: any, deps: {
|
||||
pushMetaToMonitor: () => Promise<void>;
|
||||
startCalendarScheduler: () => void;
|
||||
setMetaPushInterval: (handle: ReturnType<typeof setInterval>) => void;
|
||||
onCronServiceAvailable?: (cron: any) => void;
|
||||
}) {
|
||||
const { logger, pushMetaToMonitor, startCalendarScheduler, setMetaPushInterval } = deps;
|
||||
|
||||
api.on('gateway_start', (event?: any) => {
|
||||
// Extract cron service from gateway startup event (same as memory-core dreaming)
|
||||
if (event && deps.onCronServiceAvailable) {
|
||||
const context = event?.context;
|
||||
const cron = context?.cron ?? context?.deps?.cron;
|
||||
if (cron && typeof cron.add === 'function') {
|
||||
deps.onCronServiceAvailable(cron);
|
||||
logger.info('HarborForge: cron service acquired from gateway_start');
|
||||
}
|
||||
}
|
||||
api.on('gateway_start', () => {
|
||||
logger.info('HarborForge plugin active');
|
||||
const live = getPluginConfig(api);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user