Files
wehub-resource-sync d88fd01084
CI / test (3.10) (push) Failing after 1s
CI / test (3.12) (push) Failing after 0s
CI / skillgen-check (push) Failing after 0s
CI / security-scan (push) Failing after 0s
chore: import upstream snapshot with attribution
2026-07-13 12:09:14 +08:00

33 lines
1.0 KiB
TypeScript

import { logger } from './logger';
async function processInbound(orgId: string, phone: string) {
const { shouldHandle, processMessage } = await import('./mayaEngine.js');
const handle = await shouldHandle(orgId, phone);
if (handle.sessionId) {
await processMessage({ orgId, phone }, handle.sessionId);
}
}
async function pollMessages(orgId: string) {
const { commsQueue } = await import('./queue.js');
await commsQueue.add('check-inbound', { orgId });
}
async function loadHandler(handlerName: string) {
// dynamic template literal — path not statically resolvable, should produce no edge
const mod = await import(`./handlers/${handlerName}`);
return mod.default;
}
async function loadStatic() {
// static template literal (no interpolation) — should resolve like a plain string
const { helper } = await import(`./staticHelper`);
return helper;
}
function syncOnly() {
logger.info('no dynamic imports here');
}
export { processInbound, pollMessages, loadHandler, loadStatic, syncOnly };