@theokit/gateway 0.15.0 → 0.16.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/dist/index.d.cts CHANGED
@@ -280,6 +280,18 @@ interface WeComMessageEvent extends BaseMessageEvent {
280
280
  readonly raw: unknown;
281
281
  };
282
282
  }
283
+ /** QQ Bot event variant, a C2C (direct) text message pushed to the signed webhook. */
284
+ interface QQMessageEvent extends BaseMessageEvent {
285
+ readonly platform: "qq";
286
+ readonly qq: {
287
+ /** The message's id; a reply is sent as a passive reply to it. */
288
+ readonly messageId: string;
289
+ /** The sender's `user_openid`; the send target for a reply. */
290
+ readonly userOpenId: string;
291
+ /** The webhook payload — escape hatch. */
292
+ readonly raw: unknown;
293
+ };
294
+ }
283
295
  /** Yuanbao (元宝) bot event variant, a text message pushed to the signed callback URL. */
284
296
  interface YuanbaoMessageEvent extends BaseMessageEvent {
285
297
  readonly platform: "yuanbao";
@@ -308,6 +320,34 @@ interface TwitchMessageEvent extends BaseMessageEvent {
308
320
  readonly raw: unknown;
309
321
  };
310
322
  }
323
+ /** One tweet of a mention's thread, oldest first in {@link XMessageEvent.x}`.thread`. */
324
+ interface XThreadTweet {
325
+ readonly tweetId: string;
326
+ readonly authorId: string;
327
+ /** The author's handle, `""` when the API did not return it. */
328
+ readonly username: string;
329
+ readonly text: string;
330
+ }
331
+ /** X (Twitter) event variant, a tweet that mentions the bot account. */
332
+ interface XMessageEvent extends BaseMessageEvent {
333
+ readonly platform: "x";
334
+ readonly x: {
335
+ /** The mention tweet's id; a reply is posted under it. */
336
+ readonly tweetId: string;
337
+ /** The thread's conversation id; also the channel id. */
338
+ readonly conversationId: string;
339
+ /** The author's user id. */
340
+ readonly authorId: string;
341
+ /** The tweets the mention replies to, oldest first; empty when it starts a thread. */
342
+ readonly thread: readonly XThreadTweet[];
343
+ /** The tweet the mention quotes, when it quotes one. */
344
+ readonly quoted?: XThreadTweet;
345
+ /** `true` when the author is not allowlisted and was let in by guest mode. */
346
+ readonly guest: boolean;
347
+ /** The tweet object — escape hatch. */
348
+ readonly raw: unknown;
349
+ };
350
+ }
311
351
 
312
352
  /**
313
353
  * `MessageEvent` — canonical inbound shape every adapter emits (T1.1, ADR D173).
@@ -626,6 +666,8 @@ interface PlatformEventRegistry {
626
666
  wechat: WeChatMessageEvent;
627
667
  wecom: WeComMessageEvent;
628
668
  yuanbao: YuanbaoMessageEvent;
669
+ x: XMessageEvent;
670
+ qq: QQMessageEvent;
629
671
  raft: RaftMessageEvent;
630
672
  clickclack: ClickClackMessageEvent;
631
673
  buzz: BuzzMessageEvent;
@@ -1951,4 +1993,4 @@ declare function listenerLifecycle(opts: {
1951
1993
  stop(): Promise<void>;
1952
1994
  };
1953
1995
 
1954
- export { type AgentIdStrategy, type BaseMessageEvent, BasePlatformAdapter, type BuiltChannel, type BuzzMessageEvent, CREDENTIAL_SHAPES, type ChannelConfigField, type ChannelDescriptor, type ChannelEntry, type ChannelRejection, type ChannelRendering, type ChannelWebhook, type ChunkByGraphemeOptions, type ChunkTextOptions, type ClickClackMessageEvent, type ConnectFailure, type CoveredShape, type CreateChannelsResult, type DeliveryRequest, DeliveryRouter, type DeliveryTarget, type DiscordMessageEvent, type EmailMessageEvent, type FeishuLarkMessageEvent, type FenceRegion, GatewayConfigurationError, type GatewayConfigurationErrorOptions, type GatewayContext, type GatewayHandler, type GatewayHook, GatewayLifecycleError, type GatewayLifecycleErrorOptions, GatewayRunner, type GatewayRunnerOptions, type GoogleChatMessageEvent, type HookDecision, HookExecutor, type HookName, type IMessageMessageEvent, type InboundAudio, type IngestResult, type IrcMessageEvent, type LineMessageEvent, type ListenableApp, type ListenerLike, type MatrixMessageEvent, type MattermostMessageEvent, type MessageEvent, type NextcloudTalkMessageEvent, type NostrMessageEvent, type OnErrorContext, type OutboundAttachment, type OutboundMessage, type PlatformEventRegistry, type PlatformName, type PostOutboundContext, type PreInboundContext, type RaftMessageEvent, type RawBodyCaptureOptions, type RawBodyRequest, type ReconnectPolicy, type SMSMessageEvent, SeenIds, type SendResult, SessionRouter, type SignalMessageEvent, type SlackMessageEvent, type StartResult, type SynologyChatMessageEvent, type TeamsMessageEvent, type TelegramMessageEvent, type TlonUrbitMessageEvent, type TwitchMessageEvent, type UncoveredShape, type WeChatMessageEvent, type WeComMessageEvent, type WebhookRequest, WeixinAdapterBase, type WeixinAdapterConfig, type WeixinFetch, type WeixinSendRequest, type WeixinWebhookAnswer, type WhatsAppMessageEvent, type YuanbaoMessageEvent, type ZaloMessageEvent, type ZaloPersonalMessageEvent, channelRendering, chunkByGrapheme, chunkText, createChannels, defaultStrategy, listenerLifecycle, loadPeer, maskShapes, parseFlatXml, rawBodyCapture, redactSecrets, scanFences, splitKeepingRows, toDialect };
1996
+ export { type AgentIdStrategy, type BaseMessageEvent, BasePlatformAdapter, type BuiltChannel, type BuzzMessageEvent, CREDENTIAL_SHAPES, type ChannelConfigField, type ChannelDescriptor, type ChannelEntry, type ChannelRejection, type ChannelRendering, type ChannelWebhook, type ChunkByGraphemeOptions, type ChunkTextOptions, type ClickClackMessageEvent, type ConnectFailure, type CoveredShape, type CreateChannelsResult, type DeliveryRequest, DeliveryRouter, type DeliveryTarget, type DiscordMessageEvent, type EmailMessageEvent, type FeishuLarkMessageEvent, type FenceRegion, GatewayConfigurationError, type GatewayConfigurationErrorOptions, type GatewayContext, type GatewayHandler, type GatewayHook, GatewayLifecycleError, type GatewayLifecycleErrorOptions, GatewayRunner, type GatewayRunnerOptions, type GoogleChatMessageEvent, type HookDecision, HookExecutor, type HookName, type IMessageMessageEvent, type InboundAudio, type IngestResult, type IrcMessageEvent, type LineMessageEvent, type ListenableApp, type ListenerLike, type MatrixMessageEvent, type MattermostMessageEvent, type MessageEvent, type NextcloudTalkMessageEvent, type NostrMessageEvent, type OnErrorContext, type OutboundAttachment, type OutboundMessage, type PlatformEventRegistry, type PlatformName, type PostOutboundContext, type PreInboundContext, type QQMessageEvent, type RaftMessageEvent, type RawBodyCaptureOptions, type RawBodyRequest, type ReconnectPolicy, type SMSMessageEvent, SeenIds, type SendResult, SessionRouter, type SignalMessageEvent, type SlackMessageEvent, type StartResult, type SynologyChatMessageEvent, type TeamsMessageEvent, type TelegramMessageEvent, type TlonUrbitMessageEvent, type TwitchMessageEvent, type UncoveredShape, type WeChatMessageEvent, type WeComMessageEvent, type WebhookRequest, WeixinAdapterBase, type WeixinAdapterConfig, type WeixinFetch, type WeixinSendRequest, type WeixinWebhookAnswer, type WhatsAppMessageEvent, type XMessageEvent, type XThreadTweet, type YuanbaoMessageEvent, type ZaloMessageEvent, type ZaloPersonalMessageEvent, channelRendering, chunkByGrapheme, chunkText, createChannels, defaultStrategy, listenerLifecycle, loadPeer, maskShapes, parseFlatXml, rawBodyCapture, redactSecrets, scanFences, splitKeepingRows, toDialect };
package/dist/index.d.ts CHANGED
@@ -280,6 +280,18 @@ interface WeComMessageEvent extends BaseMessageEvent {
280
280
  readonly raw: unknown;
281
281
  };
282
282
  }
283
+ /** QQ Bot event variant, a C2C (direct) text message pushed to the signed webhook. */
284
+ interface QQMessageEvent extends BaseMessageEvent {
285
+ readonly platform: "qq";
286
+ readonly qq: {
287
+ /** The message's id; a reply is sent as a passive reply to it. */
288
+ readonly messageId: string;
289
+ /** The sender's `user_openid`; the send target for a reply. */
290
+ readonly userOpenId: string;
291
+ /** The webhook payload — escape hatch. */
292
+ readonly raw: unknown;
293
+ };
294
+ }
283
295
  /** Yuanbao (元宝) bot event variant, a text message pushed to the signed callback URL. */
284
296
  interface YuanbaoMessageEvent extends BaseMessageEvent {
285
297
  readonly platform: "yuanbao";
@@ -308,6 +320,34 @@ interface TwitchMessageEvent extends BaseMessageEvent {
308
320
  readonly raw: unknown;
309
321
  };
310
322
  }
323
+ /** One tweet of a mention's thread, oldest first in {@link XMessageEvent.x}`.thread`. */
324
+ interface XThreadTweet {
325
+ readonly tweetId: string;
326
+ readonly authorId: string;
327
+ /** The author's handle, `""` when the API did not return it. */
328
+ readonly username: string;
329
+ readonly text: string;
330
+ }
331
+ /** X (Twitter) event variant, a tweet that mentions the bot account. */
332
+ interface XMessageEvent extends BaseMessageEvent {
333
+ readonly platform: "x";
334
+ readonly x: {
335
+ /** The mention tweet's id; a reply is posted under it. */
336
+ readonly tweetId: string;
337
+ /** The thread's conversation id; also the channel id. */
338
+ readonly conversationId: string;
339
+ /** The author's user id. */
340
+ readonly authorId: string;
341
+ /** The tweets the mention replies to, oldest first; empty when it starts a thread. */
342
+ readonly thread: readonly XThreadTweet[];
343
+ /** The tweet the mention quotes, when it quotes one. */
344
+ readonly quoted?: XThreadTweet;
345
+ /** `true` when the author is not allowlisted and was let in by guest mode. */
346
+ readonly guest: boolean;
347
+ /** The tweet object — escape hatch. */
348
+ readonly raw: unknown;
349
+ };
350
+ }
311
351
 
312
352
  /**
313
353
  * `MessageEvent` — canonical inbound shape every adapter emits (T1.1, ADR D173).
@@ -626,6 +666,8 @@ interface PlatformEventRegistry {
626
666
  wechat: WeChatMessageEvent;
627
667
  wecom: WeComMessageEvent;
628
668
  yuanbao: YuanbaoMessageEvent;
669
+ x: XMessageEvent;
670
+ qq: QQMessageEvent;
629
671
  raft: RaftMessageEvent;
630
672
  clickclack: ClickClackMessageEvent;
631
673
  buzz: BuzzMessageEvent;
@@ -1951,4 +1993,4 @@ declare function listenerLifecycle(opts: {
1951
1993
  stop(): Promise<void>;
1952
1994
  };
1953
1995
 
1954
- export { type AgentIdStrategy, type BaseMessageEvent, BasePlatformAdapter, type BuiltChannel, type BuzzMessageEvent, CREDENTIAL_SHAPES, type ChannelConfigField, type ChannelDescriptor, type ChannelEntry, type ChannelRejection, type ChannelRendering, type ChannelWebhook, type ChunkByGraphemeOptions, type ChunkTextOptions, type ClickClackMessageEvent, type ConnectFailure, type CoveredShape, type CreateChannelsResult, type DeliveryRequest, DeliveryRouter, type DeliveryTarget, type DiscordMessageEvent, type EmailMessageEvent, type FeishuLarkMessageEvent, type FenceRegion, GatewayConfigurationError, type GatewayConfigurationErrorOptions, type GatewayContext, type GatewayHandler, type GatewayHook, GatewayLifecycleError, type GatewayLifecycleErrorOptions, GatewayRunner, type GatewayRunnerOptions, type GoogleChatMessageEvent, type HookDecision, HookExecutor, type HookName, type IMessageMessageEvent, type InboundAudio, type IngestResult, type IrcMessageEvent, type LineMessageEvent, type ListenableApp, type ListenerLike, type MatrixMessageEvent, type MattermostMessageEvent, type MessageEvent, type NextcloudTalkMessageEvent, type NostrMessageEvent, type OnErrorContext, type OutboundAttachment, type OutboundMessage, type PlatformEventRegistry, type PlatformName, type PostOutboundContext, type PreInboundContext, type RaftMessageEvent, type RawBodyCaptureOptions, type RawBodyRequest, type ReconnectPolicy, type SMSMessageEvent, SeenIds, type SendResult, SessionRouter, type SignalMessageEvent, type SlackMessageEvent, type StartResult, type SynologyChatMessageEvent, type TeamsMessageEvent, type TelegramMessageEvent, type TlonUrbitMessageEvent, type TwitchMessageEvent, type UncoveredShape, type WeChatMessageEvent, type WeComMessageEvent, type WebhookRequest, WeixinAdapterBase, type WeixinAdapterConfig, type WeixinFetch, type WeixinSendRequest, type WeixinWebhookAnswer, type WhatsAppMessageEvent, type YuanbaoMessageEvent, type ZaloMessageEvent, type ZaloPersonalMessageEvent, channelRendering, chunkByGrapheme, chunkText, createChannels, defaultStrategy, listenerLifecycle, loadPeer, maskShapes, parseFlatXml, rawBodyCapture, redactSecrets, scanFences, splitKeepingRows, toDialect };
1996
+ export { type AgentIdStrategy, type BaseMessageEvent, BasePlatformAdapter, type BuiltChannel, type BuzzMessageEvent, CREDENTIAL_SHAPES, type ChannelConfigField, type ChannelDescriptor, type ChannelEntry, type ChannelRejection, type ChannelRendering, type ChannelWebhook, type ChunkByGraphemeOptions, type ChunkTextOptions, type ClickClackMessageEvent, type ConnectFailure, type CoveredShape, type CreateChannelsResult, type DeliveryRequest, DeliveryRouter, type DeliveryTarget, type DiscordMessageEvent, type EmailMessageEvent, type FeishuLarkMessageEvent, type FenceRegion, GatewayConfigurationError, type GatewayConfigurationErrorOptions, type GatewayContext, type GatewayHandler, type GatewayHook, GatewayLifecycleError, type GatewayLifecycleErrorOptions, GatewayRunner, type GatewayRunnerOptions, type GoogleChatMessageEvent, type HookDecision, HookExecutor, type HookName, type IMessageMessageEvent, type InboundAudio, type IngestResult, type IrcMessageEvent, type LineMessageEvent, type ListenableApp, type ListenerLike, type MatrixMessageEvent, type MattermostMessageEvent, type MessageEvent, type NextcloudTalkMessageEvent, type NostrMessageEvent, type OnErrorContext, type OutboundAttachment, type OutboundMessage, type PlatformEventRegistry, type PlatformName, type PostOutboundContext, type PreInboundContext, type QQMessageEvent, type RaftMessageEvent, type RawBodyCaptureOptions, type RawBodyRequest, type ReconnectPolicy, type SMSMessageEvent, SeenIds, type SendResult, SessionRouter, type SignalMessageEvent, type SlackMessageEvent, type StartResult, type SynologyChatMessageEvent, type TeamsMessageEvent, type TelegramMessageEvent, type TlonUrbitMessageEvent, type TwitchMessageEvent, type UncoveredShape, type WeChatMessageEvent, type WeComMessageEvent, type WebhookRequest, WeixinAdapterBase, type WeixinAdapterConfig, type WeixinFetch, type WeixinSendRequest, type WeixinWebhookAnswer, type WhatsAppMessageEvent, type XMessageEvent, type XThreadTweet, type YuanbaoMessageEvent, type ZaloMessageEvent, type ZaloPersonalMessageEvent, channelRendering, chunkByGrapheme, chunkText, createChannels, defaultStrategy, listenerLifecycle, loadPeer, maskShapes, parseFlatXml, rawBodyCapture, redactSecrets, scanFences, splitKeepingRows, toDialect };
package/dist/index.js CHANGED
@@ -199,6 +199,8 @@ var RENDERINGS = {
199
199
  wechat: { format: "plain", translate: translateWith(STRIP) },
200
200
  wecom: { format: "plain", translate: translateWith(STRIP) },
201
201
  yuanbao: { format: "plain", translate: translateWith(STRIP) },
202
+ qq: { format: "plain", translate: translateWith(STRIP) },
203
+ x: { format: "plain", translate: translateWith(STRIP) },
202
204
  raft: { format: "plain", translate: translateWith(STRIP) }
203
205
  };
204
206
  function channelRendering(platform) {
@@ -668,6 +670,35 @@ var GatewayLifecycleError = class extends Error {
668
670
  this.code = opts.code;
669
671
  }
670
672
  };
673
+ 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.
674
+ 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.
675
+ 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.
676
+ gateway-clickclack \`token\` :: a ClickClack bot token (\`ccb_\` prefix) or session token with no fixed shape for the latter. It travels only in Authorization headers, which the adapter never logs.
677
+ gateway-zalo \`accessToken\`, \`oaSecretKey\` :: a Zalo Official Account access token and OA secret key: opaque strings with no prefix or fixed shape to recognise. The token travels only in an \`access_token\` header and the key only into the signature check, and the adapter never logs either.
678
+ gateway-wechat \`appSecret\`, \`token\` :: a WeChat Official Account AppSecret (32 hex characters, indistinguishable from any other hex string) and the server-URL verification token (a string the operator chooses). The secret travels only to the access-token endpoint and the token only into the signature check; the adapter never logs either.
679
+ gateway-wecom \`corpSecret\`, \`token\`, \`encodingAesKey\` :: a WeCom application Secret (43 URL-safe base64 characters, indistinguishable from other opaque strings), the callback Token (a string the operator chooses) and the EncodingAESKey (43 base64 characters). The secret travels only to the access-token endpoint, the token into the signature check and the key into the decryption; the adapter never logs any of them.
680
+ gateway-yuanbao \`appSecret\`, \`callbackSecret\` :: a Yuanbao bot AppSecret and the callback signing secret, both opaque strings with no prefix or fixed shape. The app secret travels only to the access-token endpoint and the callback secret only into the signature check; the adapter never logs either.
681
+ gateway-zalo-personal \`credentials\` :: a Zalo web session: a cookie jar, an IMEI-like device id and a user agent. The cookie has no prefix or fixed shape to recognise. It travels only to the Zalo library, which the adapter never logs.
682
+ gateway-twitch \`accessToken\` :: 30 lowercase alphanumerics with no prefix, the shape of many ids and hashes in a log. It travels only in Authorization headers, which the adapter never logs.
683
+ gateway-tlon-urbit \`code\` :: a +code is four dash-joined phonemic syllable words, the same shape as an Urbit ship name such as ~sampel-palnet-sampel-palnet, which the logs exist to show. It travels only in the /~/login body, which the adapter never logs.
684
+ gateway-synology-chat \`botToken\` and \`incomingUrl\` :: a bot token is a random string the NAS generates with no prefix, and the Incoming URL carries its own token as a query parameter of an ordinary entry.cgi URL. Neither has a shape to claim without eating ordinary ids and URLs; the adapter never logs the URL, and refuses a callback token before reading it.
685
+ gateway-feishu-lark \`appSecret\` :: 32 alphanumerics with no prefix, the shape of many tokens and hashes; it travels only in the body of the tenant-token request, which the adapter never logs.
686
+ gateway-nostr \`secretKey\` (64-hex form) :: 64 hex characters is also every Nostr public key and event id, which the logs exist to show, and a sha256 digest. The nsec1 spelling of the same key is masked above.
687
+ gateway-sms \`authToken\` (Twilio), gateway-line \`channelSecret\` :: 32 lowercase hex characters, which is also an md5 digest, a dashless UUID and half a git tree hash. Masking it would eat the correlation id a developer reads the log to find.
688
+ gateway-mattermost \`accessToken\` :: 26 lowercase alphanumerics, which is exactly a lowercase ULID \u2014 the shape of most trace ids.
689
+ gateway-email \`password\`, gateway-sms \`apiSecret\` and \`signatureSecret\` (Vonage) :: no format of their own; a passphrase is indistinguishable from prose. The SDK's own \`key=value\` rule already masks these fully wherever they appear as \`field=value\`, and adding a pattern here made that WORSE by claiming the value first \u2014 it was masked as first6\u2026last4 instead of removed.
690
+ gateway-slack \`botToken\` :: already masked by one of the SDK's own twelve built-in patterns \u2014 \`xoxb-\` is Slack's and the SDK knows it. A pattern here would be a second one doing the first's work, and the field-level gate flagged its absence, which is the gate working.
691
+ gateway-whatsapp \`appSecret\` :: 32 lowercase hex, the same shape as the Twilio auth token above and as every md5 and dashless UUID. Masking it would eat the correlation ids in a log.
692
+ gateway-nextcloud-talk \`secret\` :: a Talk bot secret is a string of 40 to 128 characters the administrator chose for \`occ talk:bot:install\`, with no prefix or format to recognise. It never travels: both sides send only an HMAC made with it, and the adapter never logs it.
693
+ gateway-irc \`password\` and \`saslPassword\` :: a server password and a NickServ password are passphrases the operator chose, with no format to recognise. The SDK's \`key=value\` rule masks them as fields wherever they appear as \`password=...\`; the SASL payload on the wire is their base64, which the adapter never logs.
694
+ gateway-google-chat \`privateKey\` :: a PEM block spans lines, and in a log it usually arrives inside a JSON string with its line breaks escaped as \\n, which no single-line shape can claim whole. The SDK's \`key=value\` rule masks it as a field wherever it appears as \`private_key=...\` or \`privateKey=...\`.
695
+ gateway-line \`channelAccessToken\`, gateway-sms \`authToken\` (Plivo) :: long base64 runs with no prefix, indistinguishable from any encoded blob a platform library puts in an error message.`;
696
+ function parseUncovered(table) {
697
+ return table.split("\n").map((row) => {
698
+ const [field = "", why = ""] = row.split(" :: ");
699
+ return { field, why };
700
+ });
701
+ }
671
702
  var CREDENTIAL_SHAPES = {
672
703
  covered: [
673
704
  {
@@ -706,92 +737,7 @@ var CREDENTIAL_SHAPES = {
706
737
  alsoMatches: "nothing plausible \u2014 `nsec1` is NIP-19's prefix for a secret key"
707
738
  }
708
739
  ],
709
- uncovered: [
710
- {
711
- field: "gateway-buzz `token`",
712
- why: "a Buzz bot token with no fixed shape this package could confirm. It travels only in Authorization headers, which the adapter never logs."
713
- },
714
- {
715
- field: "gateway-clickclack `token`",
716
- why: "a ClickClack bot token (`ccb_` prefix) or session token with no fixed shape for the latter. It travels only in Authorization headers, which the adapter never logs."
717
- },
718
- {
719
- field: "gateway-zalo `accessToken`, `oaSecretKey`",
720
- why: "a Zalo Official Account access token and OA secret key: opaque strings with no prefix or fixed shape to recognise. The token travels only in an `access_token` header and the key only into the signature check, and the adapter never logs either."
721
- },
722
- {
723
- field: "gateway-wechat `appSecret`, `token`",
724
- why: "a WeChat Official Account AppSecret (32 hex characters, indistinguishable from any other hex string) and the server-URL verification token (a string the operator chooses). The secret travels only to the access-token endpoint and the token only into the signature check; the adapter never logs either."
725
- },
726
- {
727
- field: "gateway-wecom `corpSecret`, `token`, `encodingAesKey`",
728
- why: "a WeCom application Secret (43 URL-safe base64 characters, indistinguishable from other opaque strings), the callback Token (a string the operator chooses) and the EncodingAESKey (43 base64 characters). The secret travels only to the access-token endpoint, the token into the signature check and the key into the decryption; the adapter never logs any of them."
729
- },
730
- {
731
- field: "gateway-yuanbao `appSecret`, `callbackSecret`",
732
- why: "a Yuanbao bot AppSecret and the callback signing secret, both opaque strings with no prefix or fixed shape. The app secret travels only to the access-token endpoint and the callback secret only into the signature check; the adapter never logs either."
733
- },
734
- {
735
- field: "gateway-zalo-personal `credentials`",
736
- why: "a Zalo web session: a cookie jar, an IMEI-like device id and a user agent. The cookie has no prefix or fixed shape to recognise. It travels only to the Zalo library, which the adapter never logs."
737
- },
738
- {
739
- field: "gateway-twitch `accessToken`",
740
- why: "30 lowercase alphanumerics with no prefix, the shape of many ids and hashes in a log. It travels only in Authorization headers, which the adapter never logs."
741
- },
742
- {
743
- field: "gateway-tlon-urbit `code`",
744
- why: "a +code is four dash-joined phonemic syllable words, the same shape as an Urbit ship name such as ~sampel-palnet-sampel-palnet, which the logs exist to show. It travels only in the /~/login body, which the adapter never logs."
745
- },
746
- {
747
- field: "gateway-synology-chat `botToken` and `incomingUrl`",
748
- why: "a bot token is a random string the NAS generates with no prefix, and the Incoming URL carries its own token as a query parameter of an ordinary entry.cgi URL. Neither has a shape to claim without eating ordinary ids and URLs; the adapter never logs the URL, and refuses a callback token before reading it."
749
- },
750
- {
751
- field: "gateway-feishu-lark `appSecret`",
752
- why: "32 alphanumerics with no prefix, the shape of many tokens and hashes; it travels only in the body of the tenant-token request, which the adapter never logs."
753
- },
754
- {
755
- field: "gateway-nostr `secretKey` (64-hex form)",
756
- why: "64 hex characters is also every Nostr public key and event id, which the logs exist to show, and a sha256 digest. The nsec1 spelling of the same key is masked above."
757
- },
758
- {
759
- field: "gateway-sms `authToken` (Twilio), gateway-line `channelSecret`",
760
- why: "32 lowercase hex characters, which is also an md5 digest, a dashless UUID and half a git tree hash. Masking it would eat the correlation id a developer reads the log to find."
761
- },
762
- {
763
- field: "gateway-mattermost `accessToken`",
764
- why: "26 lowercase alphanumerics, which is exactly a lowercase ULID \u2014 the shape of most trace ids."
765
- },
766
- {
767
- field: "gateway-email `password`, gateway-sms `apiSecret` and `signatureSecret` (Vonage)",
768
- why: "no format of their own; a passphrase is indistinguishable from prose. The SDK's own `key=value` rule already masks these fully wherever they appear as `field=value`, and adding a pattern here made that WORSE by claiming the value first \u2014 it was masked as first6\u2026last4 instead of removed."
769
- },
770
- {
771
- field: "gateway-slack `botToken`",
772
- why: "already masked by one of the SDK's own twelve built-in patterns \u2014 `xoxb-` is Slack's and the SDK knows it. A pattern here would be a second one doing the first's work, and the field-level gate flagged its absence, which is the gate working."
773
- },
774
- {
775
- field: "gateway-whatsapp `appSecret`",
776
- why: "32 lowercase hex, the same shape as the Twilio auth token above and as every md5 and dashless UUID. Masking it would eat the correlation ids in a log."
777
- },
778
- {
779
- field: "gateway-nextcloud-talk `secret`",
780
- why: "a Talk bot secret is a string of 40 to 128 characters the administrator chose for `occ talk:bot:install`, with no prefix or format to recognise. It never travels: both sides send only an HMAC made with it, and the adapter never logs it."
781
- },
782
- {
783
- field: "gateway-irc `password` and `saslPassword`",
784
- why: "a server password and a NickServ password are passphrases the operator chose, with no format to recognise. The SDK's `key=value` rule masks them as fields wherever they appear as `password=...`; the SASL payload on the wire is their base64, which the adapter never logs."
785
- },
786
- {
787
- field: "gateway-google-chat `privateKey`",
788
- why: "a PEM block spans lines, and in a log it usually arrives inside a JSON string with its line breaks escaped as \\n, which no single-line shape can claim whole. The SDK's `key=value` rule masks it as a field wherever it appears as `private_key=...` or `privateKey=...`."
789
- },
790
- {
791
- field: "gateway-line `channelAccessToken`, gateway-sms `authToken` (Plivo)",
792
- why: "long base64 runs with no prefix, indistinguishable from any encoded blob a platform library puts in an error message."
793
- }
794
- ]
740
+ uncovered: parseUncovered(UNCOVERED_TABLE)
795
741
  };
796
742
  function maskShapes(text) {
797
743
  let out = text;