refactor: move inbound config

This commit is contained in:
Peter Steinberger
2025-12-24 00:22:52 +00:00
parent 5e07400cd1
commit 93af424ce5
34 changed files with 283 additions and 243 deletions

View File

@@ -68,7 +68,7 @@ function resolveSession(opts: {
to?: string;
sessionId?: string;
}): SessionResolution {
const sessionCfg = opts.cfg.inbound?.session;
const sessionCfg = opts.cfg.session;
const scope = sessionCfg?.scope ?? "per-sender";
const mainKey = sessionCfg?.mainKey ?? "main";
const idleMinutes = Math.max(
@@ -150,7 +150,7 @@ export async function agentCommand(
});
const workspaceDir = workspace.dir;
const allowFrom = (cfg.inbound?.allowFrom ?? [])
const allowFrom = (cfg.routing?.allowFrom ?? [])
.map((val) => normalizeE164(val))
.filter((val) => val.length > 1);
@@ -421,7 +421,7 @@ export async function agentCommand(
if (deliver) {
if (deliveryProvider === "whatsapp" && !whatsappTarget) {
const err = new Error(
"Delivering to WhatsApp requires --to <E.164> or inbound.allowFrom[0]",
"Delivering to WhatsApp requires --to <E.164> or routing.allowFrom[0]",
);
if (!bestEffortDeliver) throw err;
logDeliveryError(err);