@theokit/gateway 0.19.0 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.20.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 80bbb11: Add `createAccessPolicyHook`, `createFilePairingStore` and `senderKey`: a `pre_inbound` hook that lets owners, paired and allowlisted senders through on platforms that authenticate the sender, applies a DM policy (`pairing`, `allowlist`, `open`, `disabled`) to strangers, and rate limits refusals.
8
+ - 295d6fa: Add `configFromEnv` and `selectVariant`: bind channel config fields to environment variables (`ChannelConfigField.env`), collect secret values for log masking, and pick a descriptor variant.
9
+
3
10
  ## 0.19.0
4
11
 
5
12
  ### Minor Changes
package/README.md CHANGED
@@ -280,6 +280,34 @@ const hook = commandHook([
280
280
 
281
281
  A command declared `arg: "none"` given an argument (or `"required"` given none) replies with its usage line instead of running. Two commands with the same name throw `GatewayConfigurationError` with code `duplicate_command`. `parseChatCommand(text, { prefixes })` is exported for apps that parse on their own.
282
282
 
283
+ ## Access policy and pairing
284
+
285
+ `createAccessPolicyHook` decides who may talk to the agent. Owners (`<platform>:<senderId>` keys),
286
+ allowlisted and paired senders pass, only on platforms where `isAuthenticated` is true; an owner or
287
+ allowlist key on any other platform makes the constructor throw `unauthenticated_owner`. A DM from
288
+ anyone else follows `dm`: `open` passes, `disabled` is silent, `allowlist` answers `refusalText`,
289
+ `pairing` answers a 6-digit code and tells the sender to ask the owner for `/approve <code>`. A
290
+ refused sender is answered at most once per `refusalIntervalMs` (default one hour). An
291
+ unauthenticated sender is never answered. In a group a stranger gets no reply unless `groups: "open"`.
292
+ The owner's `/approve <code>` is answered "Paired." and never reaches the agent. A failure inside
293
+ the hook is logged (redacted) and becomes a silent block.
294
+
295
+ ```typescript
296
+ import { createAccessPolicyHook, createFilePairingStore } from "@theokit/gateway";
297
+
298
+ const hook = createAccessPolicyHook({
299
+ owners: new Set(["telegram:12345"]),
300
+ dm: "pairing",
301
+ isAuthenticated: (p) => p === "telegram",
302
+ pairing: createFilePairingStore({ dir: "./state" }),
303
+ });
304
+ ```
305
+
306
+ `createFilePairingStore` keeps paired senders in `pairing.json` (mode 0600, written through a temp
307
+ file and a rename) and pending codes in memory for one hour. A missing file is an empty store; an
308
+ unreadable or malformed one throws `pairing_store_unreadable`. `senderKey(platform, id)` builds the
309
+ key; email ids compare case-insensitively.
310
+
283
311
  ## Agent bindings
284
312
 
285
313
  When one gateway serves several agents, `createAgentBindings` picks the agent per message. A rule names an `agent` and any of `platform`, `account` and `peer` (the sender id in a DM, the channel id otherwise). A rule matches when every field it sets equals the message's. The most specific match wins (peer 4, account 2, platform 1), ties go to the earlier rule, and no match gives `defaultAgent`.
@@ -372,6 +400,23 @@ if (connected.length === 0) throw new Error("no channel connected");
372
400
  for (const { platform, reason } of failed) console.error(`${platform} did not connect: ${reason}`);
373
401
  ```
374
402
 
403
+ To build channels from environment variables, give each descriptor field an `env` name and read it
404
+ with `configFromEnv`. It trims values, treats empty or whitespace as unset, lists unset required
405
+ variables by full name in `missing`, and returns secret values in `secrets` for a log mask.
406
+ `selectVariant` picks one of a descriptor's `variants` (for example a WhatsApp backend).
407
+
408
+ ```typescript
409
+ import { configFromEnv, createChannels, selectVariant } from "@theokit/gateway";
410
+
411
+ const descriptor = selectVariant(whatsappChannel, process.env.APP_WHATSAPP_BACKEND);
412
+ const { config, missing, secrets } = configFromEnv(descriptor, process.env, "APP_");
413
+ if (missing.length > 0) console.error(`skipped: set ${missing.join(", ")}`);
414
+ else {
415
+ const { adapters } = createChannels([{ descriptor, config }]);
416
+ // pass `secrets` to your log mask
417
+ }
418
+ ```
419
+
375
420
  - `createChannels` rejects an entry whose required field is absent, `null` or `""` with a
376
421
  `GatewayConfigurationError` coded `missing_required_config` that names the keys, and reports a
377
422
  configuration error thrown by `create` the same way. Any other error propagates. It performs no
package/dist/index.cjs CHANGED
@@ -1,6 +1,9 @@
1
1
  'use strict';
2
2
 
3
3
  var sdk = require('@theokit/sdk');
4
+ var crypto = require('crypto');
5
+ var fs = require('fs');
6
+ var path = require('path');
4
7
 
5
8
  // src/text/fence.ts
6
9
  var MAY_FENCE = /^ {0,3}(?:`{3}|~{3})/m;
@@ -277,17 +280,17 @@ var BasePlatformAdapter = class _BasePlatformAdapter {
277
280
  * `empty_text`, `not_connected`, then `invalid_channel` when `channel.valid` rejects the id.
278
281
  * Returns the refusal, or `undefined` when the message may be sent.
279
282
  */
280
- refuseUnsendable(out, check) {
283
+ refuseUnsendable(out, check2) {
281
284
  const refuse = (code, message) => ({
282
285
  ok: false,
283
286
  error: { code, message }
284
287
  });
285
288
  if (out.text.length === 0) return refuse("empty_text", "outbound text is empty");
286
- if (!check.connected) {
287
- return refuse("not_connected", `${check.className}.connect() has not succeeded`);
289
+ if (!check2.connected) {
290
+ return refuse("not_connected", `${check2.className}.connect() has not succeeded`);
288
291
  }
289
- if (check.channel !== void 0 && !check.channel.valid(out.channel.id)) {
290
- return refuse("invalid_channel", check.channel.message);
292
+ if (check2.channel !== void 0 && !check2.channel.valid(out.channel.id)) {
293
+ return refuse("invalid_channel", check2.channel.message);
291
294
  }
292
295
  return void 0;
293
296
  }
@@ -575,6 +578,54 @@ var GatewayConfigurationError = class extends Error {
575
578
  }
576
579
  };
577
580
 
581
+ // src/channel/config-from-env.ts
582
+ function readValue(env, name) {
583
+ const value = env[name]?.trim();
584
+ return value ? value : void 0;
585
+ }
586
+ function configFromEnv(descriptor, env, prefix = "") {
587
+ const config = {};
588
+ const missing = [];
589
+ const secrets = [];
590
+ for (const field of descriptor.config) {
591
+ if (field.env === void 0) continue;
592
+ const name = prefix + field.env;
593
+ const value = readValue(env, name);
594
+ if (value === void 0) {
595
+ if (field.required) missing.push(name);
596
+ continue;
597
+ }
598
+ config[field.key] = value;
599
+ recordSecret(field, value, secrets);
600
+ }
601
+ return { config, missing, secrets };
602
+ }
603
+ function recordSecret(field, value, secrets) {
604
+ if (field.secret && !secrets.includes(value)) secrets.push(value);
605
+ }
606
+ function mismatch(parent, variant, name) {
607
+ throw new GatewayConfigurationError("gateway", {
608
+ code: "platform_mismatch",
609
+ message: `channel ${parent.platform}: variant "${name}" reports platform ${variant.platform}`
610
+ });
611
+ }
612
+ function unknownVariant(descriptor, name) {
613
+ const valid = Object.keys(descriptor.variants ?? {});
614
+ const given = name === void 0 ? "(none given)" : `"${name}"`;
615
+ throw new GatewayConfigurationError("gateway", {
616
+ code: "unknown_channel_variant",
617
+ message: `channel ${descriptor.platform}: unknown variant ${given}; valid variants: ${valid.length > 0 ? valid.join(", ") : "(none)"}`
618
+ });
619
+ }
620
+ function selectVariant(descriptor, name) {
621
+ const variants = descriptor.variants ?? {};
622
+ if (name === void 0 && Object.keys(variants).length === 0) return descriptor;
623
+ const variant = name !== void 0 && Object.hasOwn(variants, name) ? variants[name] : void 0;
624
+ if (variant === void 0) return unknownVariant(descriptor, name);
625
+ if (variant.platform !== descriptor.platform) mismatch(descriptor, variant, name ?? "");
626
+ return variant;
627
+ }
628
+
578
629
  // src/channel/create-channels.ts
579
630
  function isAbsent(value) {
580
631
  return value === void 0 || value === null || value === "";
@@ -698,72 +749,6 @@ var GatewayLifecycleError = class extends Error {
698
749
  this.code = opts.code;
699
750
  }
700
751
  };
701
-
702
- // src/hooks/chat-command.ts
703
- var LEADING_MENTION = /^(?:<@[^>]+>|@\S+)\s+/;
704
- var DEFAULT_PREFIXES = ["/"];
705
- function matchPrefix(text, prefixes) {
706
- let best;
707
- for (const p of prefixes) {
708
- if (p.length > 0 && text.startsWith(p) && (best === void 0 || p.length > best.length)) {
709
- best = p;
710
- }
711
- }
712
- return best;
713
- }
714
- function parseChatCommand(text, options) {
715
- const body = text.trim().replace(LEADING_MENTION, "");
716
- const prefix = matchPrefix(body, options?.prefixes ?? DEFAULT_PREFIXES);
717
- if (prefix === void 0) return void 0;
718
- const rest = body.slice(prefix.length);
719
- const m = /^([^\s@]+)(?:@\S+)?(?:\s+([\s\S]*))?$/.exec(rest);
720
- if (!m?.[1]) return void 0;
721
- return { name: m[1].toLowerCase(), arg: (m[2] ?? "").trim() };
722
- }
723
- function usageOf(c) {
724
- return c.usage ?? `/${c.name}`;
725
- }
726
- function helpText(commands) {
727
- return commands.map((c) => `${usageOf(c)} - ${c.description}`).join("\n");
728
- }
729
- function assertUnique(names) {
730
- const seen = /* @__PURE__ */ new Set();
731
- for (const raw of names) {
732
- const name = raw.toLowerCase();
733
- if (seen.has(name)) {
734
- throw new GatewayConfigurationError("gateway", {
735
- code: "duplicate_command",
736
- message: `gateway: duplicate_command: ${raw}`,
737
- detail: raw
738
- });
739
- }
740
- seen.add(name);
741
- }
742
- }
743
- function badArity(c, arg) {
744
- const mode = c.arg ?? "optional";
745
- return mode === "none" && arg !== "" || mode === "required" && arg === "";
746
- }
747
- function commandHook(commands, options) {
748
- const helpName = options?.helpCommand === void 0 ? "help" : options.helpCommand;
749
- assertUnique([...commands.map((c) => c.name), ...helpName === false ? [] : [helpName]]);
750
- const byName = new Map(commands.map((c) => [c.name.toLowerCase(), c]));
751
- const help = helpText(commands);
752
- return {
753
- name: options?.name ?? "chat-commands",
754
- async pre_inbound({ event }) {
755
- const parsed = parseChatCommand(event.text);
756
- if (!parsed) return void 0;
757
- if (helpName !== false && parsed.name === helpName.toLowerCase()) {
758
- return { block: true, message: help };
759
- }
760
- const command = byName.get(parsed.name);
761
- if (!command) return void 0;
762
- if (badArity(command, parsed.arg)) return { block: true, message: usageOf(command) };
763
- return command.run(event, parsed.arg);
764
- }
765
- };
766
- }
767
752
  var UNCOVERED_TABLE = `gateway-qq \`appSecret\` :: a QQ Bot AppSecret, an opaque 32-character string with no prefix or fixed shape. It travels only to the access-token endpoint and into the webhook signature derivation; the adapter never logs it.
768
753
  gateway-x \`clientSecret\`, \`refreshToken\`, \`bearerToken\` :: an X OAuth 2.0 client secret, a rotating refresh token and an app bearer token, opaque strings with no fixed prefix. They travel only to the X API in Authorization headers and the token request body, which the adapter never logs.
769
754
  gateway-buzz \`token\` :: a Buzz bot token with no fixed shape this package could confirm. It travels only in Authorization headers, which the adapter never logs.
@@ -847,6 +832,256 @@ function maskSecrets(text, secrets) {
847
832
  for (const secret of ordered) out = out.split(secret).join("[redacted]");
848
833
  return out;
849
834
  }
835
+ function senderKey(platform, senderId) {
836
+ return `${platform}:${platform === "email" ? senderId.toLowerCase() : senderId}`;
837
+ }
838
+ var TTL_MS = 36e5;
839
+ var FILE = "pairing.json";
840
+ function unreadable() {
841
+ return new GatewayConfigurationError("gateway", {
842
+ code: "pairing_store_unreadable",
843
+ message: "gateway: pairing_store_unreadable"
844
+ });
845
+ }
846
+ function load(path) {
847
+ let raw;
848
+ try {
849
+ raw = fs.readFileSync(path, "utf8");
850
+ } catch (e) {
851
+ if (e.code === "ENOENT") return /* @__PURE__ */ new Set();
852
+ throw unreadable();
853
+ }
854
+ let parsed;
855
+ try {
856
+ parsed = JSON.parse(raw);
857
+ } catch {
858
+ throw unreadable();
859
+ }
860
+ const list = parsed?.paired;
861
+ if (!Array.isArray(list) || !list.every((x) => typeof x === "string")) throw unreadable();
862
+ return new Set(list);
863
+ }
864
+ function createFilePairingStore(options) {
865
+ const clock = options.clock ?? Date.now;
866
+ const random = options.random ?? crypto.randomInt;
867
+ const path$1 = path.join(options.dir, FILE);
868
+ const paired = load(path$1);
869
+ const pending = /* @__PURE__ */ new Map();
870
+ let chain = Promise.resolve();
871
+ const prune = () => {
872
+ const now = clock();
873
+ for (const [code, p] of pending) if (p.expires <= now) pending.delete(code);
874
+ };
875
+ function persist(next) {
876
+ fs.mkdirSync(options.dir, { recursive: true });
877
+ const tmp = `${path$1}.${process.pid}.${crypto.randomUUID()}.tmp`;
878
+ fs.writeFileSync(tmp, JSON.stringify({ paired: [...next].sort((a, b) => a.localeCompare(b)) }), {
879
+ mode: 384,
880
+ flag: "wx"
881
+ });
882
+ fs.renameSync(tmp, path$1);
883
+ }
884
+ return {
885
+ issue(platform, senderId) {
886
+ prune();
887
+ for (const [code2, p] of pending) {
888
+ if (senderKey(p.platform, p.senderId) === senderKey(platform, senderId)) return code2;
889
+ }
890
+ let code;
891
+ do {
892
+ code = String(random(1e5, 1e6));
893
+ } while (pending.has(code));
894
+ pending.set(code, { platform, senderId, expires: clock() + TTL_MS });
895
+ return code;
896
+ },
897
+ approve(code) {
898
+ const run = async () => {
899
+ prune();
900
+ const p = pending.get(code);
901
+ if (!p) return { ok: false, reason: "unknown_or_expired" };
902
+ const next = new Set(paired);
903
+ next.add(senderKey(p.platform, p.senderId));
904
+ try {
905
+ persist(next);
906
+ } catch {
907
+ return { ok: false, reason: "write_failed" };
908
+ }
909
+ paired.add(senderKey(p.platform, p.senderId));
910
+ pending.delete(code);
911
+ return { ok: true, platform: p.platform, senderId: p.senderId };
912
+ };
913
+ const result = chain.then(run, run);
914
+ chain = result.catch(() => void 0);
915
+ return result;
916
+ },
917
+ isPaired(platform, senderId) {
918
+ return paired.has(senderKey(platform, senderId));
919
+ }
920
+ };
921
+ }
922
+
923
+ // src/hooks/access-policy.ts
924
+ var SILENT = { block: true };
925
+ var DEFAULT_REFUSAL = "Sorry, you are not authorized to use this assistant.";
926
+ function normalize(key) {
927
+ const i = key.indexOf(":");
928
+ return i < 0 ? key : senderKey(key.slice(0, i), key.slice(i + 1));
929
+ }
930
+ function check(keys, isAuth) {
931
+ const out = /* @__PURE__ */ new Set();
932
+ for (const key of keys) {
933
+ const i = key.indexOf(":");
934
+ const platform = i < 0 ? key : key.slice(0, i);
935
+ if (!isAuth(platform)) {
936
+ throw new GatewayConfigurationError("gateway", {
937
+ code: "unauthenticated_owner",
938
+ message: `gateway: unauthenticated_owner: platform ${platform} does not authenticate the sender`,
939
+ detail: platform
940
+ });
941
+ }
942
+ out.add(normalize(key));
943
+ }
944
+ return out;
945
+ }
946
+ function createAccessPolicyHook(options) {
947
+ if (options.dm === "pairing" && !options.pairing) {
948
+ throw new GatewayConfigurationError("gateway", {
949
+ code: "pairing_store_required",
950
+ message: "gateway: pairing_store_required"
951
+ });
952
+ }
953
+ const owners = check(options.owners, options.isAuthenticated);
954
+ const allowed = check(options.allowed ?? /* @__PURE__ */ new Set(), options.isAuthenticated);
955
+ const clock = options.clock ?? Date.now;
956
+ const interval = options.refusalIntervalMs ?? 36e5;
957
+ const write = options.write ?? ((line) => process.stderr.write(`${line}
958
+ `));
959
+ const refusal = options.refusalText ?? DEFAULT_REFUSAL;
960
+ const store = options.pairing;
961
+ const refused2 = /* @__PURE__ */ new Map();
962
+ const mayRefuse = (key) => {
963
+ const now = clock();
964
+ for (const [k, t] of refused2) if (now - t >= interval) refused2.delete(k);
965
+ if (refused2.has(key)) return false;
966
+ refused2.set(key, now);
967
+ return true;
968
+ };
969
+ const pairingReply = (event) => {
970
+ const code = store.issue(event.platform, event.sender.id);
971
+ return {
972
+ block: true,
973
+ message: `Your pairing code is ${code}. Ask the owner to send /approve ${code}.`
974
+ };
975
+ };
976
+ const groupDecision = () => options.groups === "open" ? void 0 : SILENT;
977
+ const stranger = (event, key) => {
978
+ if (event.channel.type !== "dm") return groupDecision();
979
+ if (options.dm === "open") return void 0;
980
+ if (options.dm === "disabled" || !mayRefuse(key)) return SILENT;
981
+ if (options.dm === "allowlist") return { block: true, message: refusal };
982
+ return pairingReply(event);
983
+ };
984
+ const ownerMessage = async (text) => {
985
+ const m = /^\/approve\s+(\d{6})\s*$/.exec(text.trim());
986
+ if (!m?.[1]) return void 0;
987
+ if (!store) return { block: true, message: "Pairing is not enabled." };
988
+ const r = await store.approve(m[1]);
989
+ if (r.ok) return { block: true, message: "Paired." };
990
+ return {
991
+ block: true,
992
+ message: r.reason === "write_failed" ? "Saving the pairing failed. Check the storage and send the code again." : "Unknown or expired code."
993
+ };
994
+ };
995
+ const isPaired = (event) => store?.isPaired(event.platform, event.sender.id) === true;
996
+ const decide = async (event) => {
997
+ if (options.passThrough?.(event)) return void 0;
998
+ if (!options.isAuthenticated(event.platform)) return SILENT;
999
+ const key = senderKey(event.platform, event.sender.id);
1000
+ if (owners.has(key)) return ownerMessage(event.text);
1001
+ if (allowed.has(key) || isPaired(event)) return void 0;
1002
+ return stranger(event, key);
1003
+ };
1004
+ return {
1005
+ name: "access-policy",
1006
+ async pre_inbound({ event }) {
1007
+ try {
1008
+ return await decide(event);
1009
+ } catch (e) {
1010
+ try {
1011
+ write(`access-policy: hook failed: ${redactSecrets(e)}`);
1012
+ } catch {
1013
+ }
1014
+ return SILENT;
1015
+ }
1016
+ }
1017
+ };
1018
+ }
1019
+
1020
+ // src/hooks/chat-command.ts
1021
+ var LEADING_MENTION = /^(?:<@[^>]+>|@\S+)\s+/;
1022
+ var DEFAULT_PREFIXES = ["/"];
1023
+ function matchPrefix(text, prefixes) {
1024
+ let best;
1025
+ for (const p of prefixes) {
1026
+ if (p.length > 0 && text.startsWith(p) && (best === void 0 || p.length > best.length)) {
1027
+ best = p;
1028
+ }
1029
+ }
1030
+ return best;
1031
+ }
1032
+ function parseChatCommand(text, options) {
1033
+ const body = text.trim().replace(LEADING_MENTION, "");
1034
+ const prefix = matchPrefix(body, options?.prefixes ?? DEFAULT_PREFIXES);
1035
+ if (prefix === void 0) return void 0;
1036
+ const rest = body.slice(prefix.length);
1037
+ const m = /^([^\s@]+)(?:@\S+)?(?:\s+([\s\S]*))?$/.exec(rest);
1038
+ if (!m?.[1]) return void 0;
1039
+ return { name: m[1].toLowerCase(), arg: (m[2] ?? "").trim() };
1040
+ }
1041
+ function usageOf(c) {
1042
+ return c.usage ?? `/${c.name}`;
1043
+ }
1044
+ function helpText(commands) {
1045
+ return commands.map((c) => `${usageOf(c)} - ${c.description}`).join("\n");
1046
+ }
1047
+ function assertUnique(names) {
1048
+ const seen = /* @__PURE__ */ new Set();
1049
+ for (const raw of names) {
1050
+ const name = raw.toLowerCase();
1051
+ if (seen.has(name)) {
1052
+ throw new GatewayConfigurationError("gateway", {
1053
+ code: "duplicate_command",
1054
+ message: `gateway: duplicate_command: ${raw}`,
1055
+ detail: raw
1056
+ });
1057
+ }
1058
+ seen.add(name);
1059
+ }
1060
+ }
1061
+ function badArity(c, arg) {
1062
+ const mode = c.arg ?? "optional";
1063
+ return mode === "none" && arg !== "" || mode === "required" && arg === "";
1064
+ }
1065
+ function commandHook(commands, options) {
1066
+ const helpName = options?.helpCommand === void 0 ? "help" : options.helpCommand;
1067
+ assertUnique([...commands.map((c) => c.name), ...helpName === false ? [] : [helpName]]);
1068
+ const byName = new Map(commands.map((c) => [c.name.toLowerCase(), c]));
1069
+ const help = helpText(commands);
1070
+ return {
1071
+ name: options?.name ?? "chat-commands",
1072
+ async pre_inbound({ event }) {
1073
+ const parsed = parseChatCommand(event.text);
1074
+ if (!parsed) return void 0;
1075
+ if (helpName !== false && parsed.name === helpName.toLowerCase()) {
1076
+ return { block: true, message: help };
1077
+ }
1078
+ const command = byName.get(parsed.name);
1079
+ if (!command) return void 0;
1080
+ if (badArity(command, parsed.arg)) return { block: true, message: usageOf(command) };
1081
+ return command.run(event, parsed.arg);
1082
+ }
1083
+ };
1084
+ }
850
1085
 
851
1086
  // src/hooks/executor.ts
852
1087
  var HOOK_PHASES = ["pre_inbound", "post_outbound", "on_error"];
@@ -1804,9 +2039,9 @@ function statusForDeliver(outcomes) {
1804
2039
  }
1805
2040
 
1806
2041
  // src/webhook/express-server.ts
1807
- async function loadPeer(load, onMissing) {
2042
+ async function loadPeer(load2, onMissing) {
1808
2043
  try {
1809
- const mod = await load();
2044
+ const mod = await load2();
1810
2045
  return mod.default ?? mod;
1811
2046
  } catch {
1812
2047
  onMissing();
@@ -2049,8 +2284,11 @@ exports.channelRendering = channelRendering;
2049
2284
  exports.chunkByGrapheme = chunkByGrapheme;
2050
2285
  exports.chunkText = chunkText;
2051
2286
  exports.commandHook = commandHook;
2287
+ exports.configFromEnv = configFromEnv;
2288
+ exports.createAccessPolicyHook = createAccessPolicyHook;
2052
2289
  exports.createAgentBindings = createAgentBindings;
2053
2290
  exports.createChannels = createChannels;
2291
+ exports.createFilePairingStore = createFilePairingStore;
2054
2292
  exports.createWebhookHandler = createWebhookHandler;
2055
2293
  exports.defaultStrategy = defaultStrategy;
2056
2294
  exports.helpText = helpText;
@@ -2064,6 +2302,8 @@ exports.parseFlatXml = parseFlatXml;
2064
2302
  exports.rawBodyCapture = rawBodyCapture;
2065
2303
  exports.redactSecrets = redactSecrets;
2066
2304
  exports.scanFences = scanFences;
2305
+ exports.selectVariant = selectVariant;
2306
+ exports.senderKey = senderKey;
2067
2307
  exports.splitKeepingRows = splitKeepingRows;
2068
2308
  exports.statusForDeliver = statusForDeliver;
2069
2309
  exports.toDialect = toDialect;