UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

22 lines (21 loc) • 972 B
import { o as normalizeLowercaseStringOrEmpty } from "./string-coerce-CCIiB4H7.mjs"; //#region src/security/external-content-source.ts /** * Resolve a hook session key into its external content source. * Unknown `hook:*` sessions are treated as webhooks so legacy/custom hooks stay wrapped. */ function resolveHookExternalContentSource(e) { const t = normalizeLowercaseStringOrEmpty(e); if (t.startsWith("hook:gmail:")) return "gmail"; if (t.startsWith("hook:")) return "webhook"; } /** Map hook session provenance to the prompt-facing external content source label. */ function mapHookExternalContentSource(e) { return e === "webhook" ? "webhook" : "email"; } /** Return true when a session key should receive external-content prompt wrapping. */ function isExternalHookSession(e) { return resolveHookExternalContentSource(e) !== void 0; } //#endregion export { mapHookExternalContentSource as n, resolveHookExternalContentSource as r, isExternalHookSession as t };