@openclaw/twitch 2026.10.10 → 2026.11.1

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.
@@ -1,4 +1,4 @@
1
- import { n as sendMessageTwitchInternal, r as getOrCreateClientManager } from "./plugin-CnPNkPhc.mjs";
1
+ import { n as sendMessageTwitchInternal, r as getOrCreateClientManager } from "./plugin-DQbaBSx7.mjs";
2
2
  import { l as normalizeTwitchChannel } from "./setup-surface-8f7RsuJw.mjs";
3
3
  import { t as getTwitchRuntime } from "./runtime-DrwVh6hF.mjs";
4
4
  import { createChannelIngressError, createChannelIngressMonitor } from "openclaw/plugin-sdk/channel-outbound";
@@ -413,6 +413,30 @@ async function sendMessageTwitchInternal(params) {
413
413
  receipt: createTwitchSendReceipt(messageId, params.channel)
414
414
  };
415
415
  }
416
+ // extensions/twitch/src/target.ts
417
+ function parseTwitchMessagingTarget(target) {
418
+ const providerTarget = stripChannelTargetPrefix(target, "twitch", "twitch-chat");
419
+ const kindMatch = /^(user|dm|channel|group|conversation|room):/i.exec(providerTarget);
420
+ const kind = kindMatch?.[1]?.toLowerCase();
421
+ return {
422
+ channelTarget: kindMatch ? providerTarget.slice(kindMatch[0].length) : providerTarget,
423
+ isDirectMessage: kind === "user" || kind === "dm"
424
+ };
425
+ }
426
+ /**
427
+ * Normalizes a Twitch messaging target to the bare channel name used by routing
428
+ * and the chat transport. Accepts internal addresses such as
429
+ * `twitch:channel:<channel>` and their `twitch-chat:` alias. Direct-message
430
+ * targets are unsupported and normalize to an empty string.
431
+ */
432
+ function normalizeTwitchMessagingTarget(target) {
433
+ const parsed = parseTwitchMessagingTarget(target);
434
+ return parsed.isDirectMessage ? "" : normalizeTwitchChannel(parsed.channelTarget);
435
+ }
436
+ /** Direct-message/user addresses are unsupported and must not fall back to a channel. */
437
+ function isTwitchDirectMessageTarget(target) {
438
+ return parseTwitchMessagingTarget(target).isDirectMessage;
439
+ }
416
440
  // extensions/twitch/src/outbound.ts
417
441
  const twitchOutbound = {
418
442
  deliveryMode: "direct",
@@ -427,8 +451,8 @@ const twitchOutbound = {
427
451
  const trimmed = to?.trim() ?? "";
428
452
  const allowListRaw = normalizeStringEntries(allowFrom ?? []);
429
453
  const hasWildcard = allowListRaw.includes("*");
430
- const allowList = allowListRaw.filter((entry) => entry !== "*").map((entry) => normalizeTwitchChannel(entry)).filter((entry) => entry.length > 0);
431
- const normalizedTo = normalizeTwitchChannel(trimmed);
454
+ const allowList = allowListRaw.filter((entry) => entry !== "*").map((entry) => normalizeTwitchMessagingTarget(entry)).filter((entry) => entry.length > 0);
455
+ const normalizedTo = normalizeTwitchMessagingTarget(trimmed);
432
456
  if (normalizedTo && (!(mode === "implicit" || mode === "heartbeat") || hasWildcard || allowList.length === 0 || allowList.includes(normalizedTo))) return {
433
457
  ok: true,
434
458
  to: normalizedTo
@@ -443,13 +467,13 @@ const twitchOutbound = {
443
467
  if (params.signal?.aborted) throw new Error("Outbound delivery aborted");
444
468
  const { account, accountId: normalizedAccountId, availableAccountIds, configured } = resolveTwitchAccountContext(cfg, accountId);
445
469
  if (!account) throw new Error(`Twitch account not found: ${accountId ?? normalizedAccountId}. Available accounts: ${availableAccountIds.join(", ") || "none"}`);
446
- const channel = to || account.channel;
447
- if (!channel) throw new Error("No channel specified and no default channel in account config");
448
- if (!configured) throw new Error(`Account ${normalizedAccountId} is not properly configured. Required: username, clientId, and accessToken (config or env for default account).`);
449
- const deliveryChannel = normalizeTwitchChannel(channel) || account.channel;
470
+ const target = to.trim();
471
+ if (isTwitchDirectMessageTarget(target)) throw new Error("Delivering to Twitch requires target <channel-name>");
472
+ const deliveryChannel = normalizeTwitchMessagingTarget(target) || normalizeTwitchChannel(account.channel);
450
473
  if (!deliveryChannel) throw new Error("No channel specified and no default channel in account config");
474
+ if (!configured) throw new Error(`Account ${normalizedAccountId} is not properly configured. Required: username, clientId, and accessToken (config or env for default account).`);
451
475
  const result = await sendMessageTwitchInternal({
452
- channel: normalizeTwitchChannel(deliveryChannel),
476
+ channel: deliveryChannel,
453
477
  text,
454
478
  cfg,
455
479
  account,
@@ -688,14 +712,6 @@ function collectTwitchStatusIssues(accounts) {
688
712
  return issues;
689
713
  }
690
714
  // extensions/twitch/src/plugin.ts
691
- function normalizeTwitchMessagingTarget(target) {
692
- const providerTarget = stripChannelTargetPrefix(target, "twitch", "twitch-chat");
693
- const kindMatch = /^(user|dm|channel|group|conversation|room):/i.exec(providerTarget);
694
- const kind = kindMatch?.[1]?.toLowerCase();
695
- if (kind === "user" || kind === "dm") return "";
696
- const channelTarget = kindMatch ? providerTarget.slice(kindMatch[0].length) : providerTarget;
697
- return normalizeTwitchChannel(channelTarget);
698
- }
699
715
  const twitchPlugin = createChatChannelPlugin({
700
716
  pairing: {
701
717
  idLabel: "twitchUserId",
@@ -810,7 +826,7 @@ const twitchPlugin = createChatChannelPlugin({
810
826
  await runPassiveAccountLifecycle({
811
827
  abortSignal: ctx.abortSignal,
812
828
  start: async () => {
813
- const { monitorTwitchProvider } = await import("./monitor-OlDdzwhV.mjs");
829
+ const { monitorTwitchProvider } = await import("./monitor-BcIEp3sb.mjs");
814
830
  return monitorTwitchProvider({
815
831
  account,
816
832
  accountId,
@@ -1 +1 @@
1
- {"version":3,"entries":[{"output":"api.js","source":"extensions/twitch/api.ts"},{"output":"channel-plugin-api.js","source":"extensions/twitch/channel-plugin-api.ts"},{"output":"index.js","source":"extensions/twitch/index.ts"},{"output":"runtime-api.js","source":"extensions/twitch/runtime-api.ts"},{"output":"setup-entry.js","source":"extensions/twitch/setup-entry.ts"},{"output":"setup-plugin-api.js","source":"extensions/twitch/setup-plugin-api.ts"}],"chunks":[{"output":".setup/monitor-OlDdzwhV.mjs","sha256":"47f069744f14b8b5226cc4a937cc917a8903b5d4496b3e39b80a96bdc72ab0cb","facadeSource":"extensions/twitch/src/monitor.ts","sources":["extensions/twitch/src/access-control.ts","extensions/twitch/src/monitor.ts","extensions/twitch/src/twitch-ingress.ts"]},{"output":".setup/plugin-CnPNkPhc.mjs","sha256":"2535ad958e3e1c5da46598268beefefdbe404960741b82b8f4f23564393d3bec","facadeSource":null,"sources":["extensions/twitch/src/actions.ts","extensions/twitch/src/client-manager-registry.ts","extensions/twitch/src/config-schema.ts","extensions/twitch/src/outbound.ts","extensions/twitch/src/plugin.ts","extensions/twitch/src/probe.ts","extensions/twitch/src/resolver.ts","extensions/twitch/src/send.ts","extensions/twitch/src/status.ts","extensions/twitch/src/twitch-client.ts"]},{"output":".setup/runtime-DrwVh6hF.mjs","sha256":"3617013b885cf1d86fd26001e27a0701f88851d853668218820ece37fafaf014","facadeSource":null,"sources":["extensions/twitch/src/runtime.ts"]},{"output":".setup/setup-plugin-api-DCp5heMU.mjs","sha256":"973936c3ed15061983cb2c633ad0070a0032ca7f091d8d16c3078e6f9127da1d","facadeSource":"extensions/twitch/setup-plugin-api.ts","sources":[]},{"output":".setup/setup-surface-8f7RsuJw.mjs","sha256":"ce0a8b74b0f640a3db87f6a5ce500c93611155b2cd276e6ca492e49fc0c3e4c0","facadeSource":null,"sources":["extensions/twitch/src/config.ts","extensions/twitch/src/setup-surface.ts","extensions/twitch/src/token.ts","extensions/twitch/src/utils/twitch.ts"]},{"output":"api.js","sha256":"67c5bb85628166e621530ea38760e20bafd217630439da4c7c902819e083b93c","facadeSource":"extensions/twitch/api.ts","sources":[]},{"output":"channel-plugin-api.js","sha256":"b6ea5f7fa47831948dea934ec538d7a5ca9650a6862fe51b6d4c5c63dfd6338e","facadeSource":"extensions/twitch/channel-plugin-api.ts","sources":[]},{"output":"index.js","sha256":"ae12fa88716486195f5e255ab8bd0824c67979d83593c2be4f4c3a423bfc8307","facadeSource":"extensions/twitch/index.ts","sources":["extensions/twitch/index.ts"]},{"output":"runtime-api.js","sha256":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881","facadeSource":"extensions/twitch/runtime-api.ts","sources":[]},{"output":"setup-entry.js","sha256":"8d4bb618699fb5498c3df4fa7e0f1accac475b732b08c42407e3d6b07a917f23","facadeSource":"extensions/twitch/setup-entry.ts","sources":["extensions/twitch/setup-entry.ts"]},{"output":"setup-plugin-api.js","sha256":"d1d232f8767fd877552e54a815cdc1518c185f42261273780dff6abbb19a28d1","facadeSource":"extensions/twitch/setup-plugin-api.ts","sources":[]}],"unrenderedSources":["extensions/twitch/api.ts","extensions/twitch/channel-plugin-api.ts","extensions/twitch/runtime-api.ts","extensions/twitch/setup-plugin-api.ts","extensions/twitch/src/constants.ts"]}
1
+ {"version":3,"entries":[{"output":"api.js","source":"extensions/twitch/api.ts"},{"output":"channel-plugin-api.js","source":"extensions/twitch/channel-plugin-api.ts"},{"output":"index.js","source":"extensions/twitch/index.ts"},{"output":"runtime-api.js","source":"extensions/twitch/runtime-api.ts"},{"output":"setup-entry.js","source":"extensions/twitch/setup-entry.ts"},{"output":"setup-plugin-api.js","source":"extensions/twitch/setup-plugin-api.ts"}],"chunks":[{"output":".setup/monitor-BcIEp3sb.mjs","sha256":"cb0433871a8d2e6609ef5912188bcccda34b309eeaa62893332464c60b373059","facadeSource":"extensions/twitch/src/monitor.ts","sources":["extensions/twitch/src/access-control.ts","extensions/twitch/src/monitor.ts","extensions/twitch/src/twitch-ingress.ts"]},{"output":".setup/plugin-DQbaBSx7.mjs","sha256":"2a522587b7b8d2df91908f64ac7ac32ad0b02f5fef2a5f3a771474b5b4c9f8ee","facadeSource":null,"sources":["extensions/twitch/src/actions.ts","extensions/twitch/src/client-manager-registry.ts","extensions/twitch/src/config-schema.ts","extensions/twitch/src/outbound.ts","extensions/twitch/src/plugin.ts","extensions/twitch/src/probe.ts","extensions/twitch/src/resolver.ts","extensions/twitch/src/send.ts","extensions/twitch/src/status.ts","extensions/twitch/src/target.ts","extensions/twitch/src/twitch-client.ts"]},{"output":".setup/runtime-DrwVh6hF.mjs","sha256":"3617013b885cf1d86fd26001e27a0701f88851d853668218820ece37fafaf014","facadeSource":null,"sources":["extensions/twitch/src/runtime.ts"]},{"output":".setup/setup-plugin-api-DCp5heMU.mjs","sha256":"973936c3ed15061983cb2c633ad0070a0032ca7f091d8d16c3078e6f9127da1d","facadeSource":"extensions/twitch/setup-plugin-api.ts","sources":[]},{"output":".setup/setup-surface-8f7RsuJw.mjs","sha256":"ce0a8b74b0f640a3db87f6a5ce500c93611155b2cd276e6ca492e49fc0c3e4c0","facadeSource":null,"sources":["extensions/twitch/src/config.ts","extensions/twitch/src/setup-surface.ts","extensions/twitch/src/token.ts","extensions/twitch/src/utils/twitch.ts"]},{"output":"api.js","sha256":"b1def76ad376e836d113fc75dd07bfa081445ffb51c0fe2af7cb8bd7b51417f2","facadeSource":"extensions/twitch/api.ts","sources":[]},{"output":"channel-plugin-api.js","sha256":"677641f19ed5ef255d3c9222299eeb2c4cfd08b2f176c4e9b5e5143018db3487","facadeSource":"extensions/twitch/channel-plugin-api.ts","sources":[]},{"output":"index.js","sha256":"ae12fa88716486195f5e255ab8bd0824c67979d83593c2be4f4c3a423bfc8307","facadeSource":"extensions/twitch/index.ts","sources":["extensions/twitch/index.ts"]},{"output":"runtime-api.js","sha256":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881","facadeSource":"extensions/twitch/runtime-api.ts","sources":[]},{"output":"setup-entry.js","sha256":"8d4bb618699fb5498c3df4fa7e0f1accac475b732b08c42407e3d6b07a917f23","facadeSource":"extensions/twitch/setup-entry.ts","sources":["extensions/twitch/setup-entry.ts"]},{"output":"setup-plugin-api.js","sha256":"d1d232f8767fd877552e54a815cdc1518c185f42261273780dff6abbb19a28d1","facadeSource":"extensions/twitch/setup-plugin-api.ts","sources":[]}],"unrenderedSources":["extensions/twitch/api.ts","extensions/twitch/channel-plugin-api.ts","extensions/twitch/runtime-api.ts","extensions/twitch/setup-plugin-api.ts","extensions/twitch/src/constants.ts"]}
package/dist/api.js CHANGED
@@ -1,3 +1,3 @@
1
- import { t as twitchPlugin } from "./.setup/plugin-CnPNkPhc.mjs";
1
+ import { t as twitchPlugin } from "./.setup/plugin-DQbaBSx7.mjs";
2
2
  import { n as setTwitchRuntime } from "./.setup/runtime-DrwVh6hF.mjs";
3
3
  export { setTwitchRuntime, twitchPlugin };
@@ -1 +1 @@
1
- export { t as twitchPlugin } from "./.setup/plugin-CnPNkPhc.mjs";
1
+ export { t as twitchPlugin } from "./.setup/plugin-DQbaBSx7.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/twitch",
3
- "version": "2026.10.10",
3
+ "version": "2026.11.1",
4
4
  "description": "OpenClaw Twitch channel plugin for chat and moderation workflows.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -31,10 +31,10 @@
31
31
  "minHostVersion": ">=2026.4.10"
32
32
  },
33
33
  "compat": {
34
- "pluginApi": ">=2026.10.10"
34
+ "pluginApi": ">=2026.11.1"
35
35
  },
36
36
  "build": {
37
- "openclawVersion": "2026.10.10"
37
+ "openclawVersion": "2026.11.1"
38
38
  },
39
39
  "channel": {
40
40
  "id": "twitch",
@@ -74,7 +74,7 @@
74
74
  "assets/activity.svg"
75
75
  ],
76
76
  "peerDependencies": {
77
- "openclaw": ">=2026.10.10"
77
+ "openclaw": ">=2026.11.1"
78
78
  },
79
79
  "peerDependenciesMeta": {
80
80
  "openclaw": {