@openclaw/twitch 2026.10.7 → 2026.10.9
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/.setup/{monitor-CsdDBmJ4.mjs → monitor-CbTcN0HN.mjs} +1 -1
- package/dist/.setup/{plugin-q9M3RXni.mjs → plugin-Dq8hlYYf.mjs} +33 -16
- package/dist/.source-module-urls/e92ae748f4a308f6cf1a5ef62518f7ba0627945de435d928747fa07ea1b4421f.json +1 -0
- package/dist/api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as sendMessageTwitchInternal, r as getOrCreateClientManager } from "./plugin-
|
|
1
|
+
import { n as sendMessageTwitchInternal, r as getOrCreateClientManager } from "./plugin-Dq8hlYYf.mjs";
|
|
2
2
|
import { l as normalizeTwitchChannel } from "./setup-surface-BHuTmMZL.mjs";
|
|
3
3
|
import { t as getTwitchRuntime } from "./runtime-B5If4b0g.mjs";
|
|
4
4
|
import { createChannelIngressError, createChannelIngressMonitor } from "openclaw/plugin-sdk/channel-outbound";
|
|
@@ -419,6 +419,31 @@ async function sendMessageTwitchInternal(params) {
|
|
|
419
419
|
};
|
|
420
420
|
}
|
|
421
421
|
//#endregion
|
|
422
|
+
//#region extensions/twitch/src/target.ts
|
|
423
|
+
function parseTwitchMessagingTarget(target) {
|
|
424
|
+
const providerTarget = stripChannelTargetPrefix(target, "twitch", "twitch-chat");
|
|
425
|
+
const kindMatch = /^(user|dm|channel|group|conversation|room):/i.exec(providerTarget);
|
|
426
|
+
const kind = kindMatch?.[1]?.toLowerCase();
|
|
427
|
+
return {
|
|
428
|
+
channelTarget: kindMatch ? providerTarget.slice(kindMatch[0].length) : providerTarget,
|
|
429
|
+
isDirectMessage: kind === "user" || kind === "dm"
|
|
430
|
+
};
|
|
431
|
+
}
|
|
432
|
+
/**
|
|
433
|
+
* Normalizes a Twitch messaging target to the bare channel name used by routing
|
|
434
|
+
* and the chat transport. Accepts internal addresses such as
|
|
435
|
+
* `twitch:channel:<channel>` and their `twitch-chat:` alias. Direct-message
|
|
436
|
+
* targets are unsupported and normalize to an empty string.
|
|
437
|
+
*/
|
|
438
|
+
function normalizeTwitchMessagingTarget(target) {
|
|
439
|
+
const parsed = parseTwitchMessagingTarget(target);
|
|
440
|
+
return parsed.isDirectMessage ? "" : normalizeTwitchChannel(parsed.channelTarget);
|
|
441
|
+
}
|
|
442
|
+
/** Direct-message/user addresses are unsupported and must not fall back to a channel. */
|
|
443
|
+
function isTwitchDirectMessageTarget(target) {
|
|
444
|
+
return parseTwitchMessagingTarget(target).isDirectMessage;
|
|
445
|
+
}
|
|
446
|
+
//#endregion
|
|
422
447
|
//#region extensions/twitch/src/outbound.ts
|
|
423
448
|
const twitchOutbound = {
|
|
424
449
|
deliveryMode: "direct",
|
|
@@ -433,8 +458,8 @@ const twitchOutbound = {
|
|
|
433
458
|
const trimmed = to?.trim() ?? "";
|
|
434
459
|
const allowListRaw = normalizeStringEntries(allowFrom ?? []);
|
|
435
460
|
const hasWildcard = allowListRaw.includes("*");
|
|
436
|
-
const allowList = allowListRaw.filter((entry) => entry !== "*").map((entry) =>
|
|
437
|
-
const normalizedTo =
|
|
461
|
+
const allowList = allowListRaw.filter((entry) => entry !== "*").map((entry) => normalizeTwitchMessagingTarget(entry)).filter((entry) => entry.length > 0);
|
|
462
|
+
const normalizedTo = normalizeTwitchMessagingTarget(trimmed);
|
|
438
463
|
if (normalizedTo && (!(mode === "implicit" || mode === "heartbeat") || hasWildcard || allowList.length === 0 || allowList.includes(normalizedTo))) return {
|
|
439
464
|
ok: true,
|
|
440
465
|
to: normalizedTo
|
|
@@ -449,13 +474,13 @@ const twitchOutbound = {
|
|
|
449
474
|
if (params.signal?.aborted) throw new Error("Outbound delivery aborted");
|
|
450
475
|
const { account, accountId: normalizedAccountId, availableAccountIds, configured } = resolveTwitchAccountContext(cfg, accountId);
|
|
451
476
|
if (!account) throw new Error(`Twitch account not found: ${accountId ?? normalizedAccountId}. Available accounts: ${availableAccountIds.join(", ") || "none"}`);
|
|
452
|
-
const
|
|
453
|
-
if (
|
|
454
|
-
|
|
455
|
-
const deliveryChannel = normalizeTwitchChannel(channel) || account.channel;
|
|
477
|
+
const target = to.trim();
|
|
478
|
+
if (isTwitchDirectMessageTarget(target)) throw new Error("Delivering to Twitch requires target <channel-name>");
|
|
479
|
+
const deliveryChannel = normalizeTwitchMessagingTarget(target) || normalizeTwitchChannel(account.channel);
|
|
456
480
|
if (!deliveryChannel) throw new Error("No channel specified and no default channel in account config");
|
|
481
|
+
if (!configured) throw new Error(`Account ${normalizedAccountId} is not properly configured. Required: username, clientId, and accessToken (config or env for default account).`);
|
|
457
482
|
const result = await sendMessageTwitchInternal({
|
|
458
|
-
channel:
|
|
483
|
+
channel: deliveryChannel,
|
|
459
484
|
text,
|
|
460
485
|
cfg,
|
|
461
486
|
account,
|
|
@@ -698,14 +723,6 @@ function collectTwitchStatusIssues(accounts) {
|
|
|
698
723
|
}
|
|
699
724
|
//#endregion
|
|
700
725
|
//#region extensions/twitch/src/plugin.ts
|
|
701
|
-
function normalizeTwitchMessagingTarget(target) {
|
|
702
|
-
const providerTarget = stripChannelTargetPrefix(target, "twitch", "twitch-chat");
|
|
703
|
-
const kindMatch = /^(user|dm|channel|group|conversation|room):/i.exec(providerTarget);
|
|
704
|
-
const kind = kindMatch?.[1]?.toLowerCase();
|
|
705
|
-
if (kind === "user" || kind === "dm") return "";
|
|
706
|
-
const channelTarget = kindMatch ? providerTarget.slice(kindMatch[0].length) : providerTarget;
|
|
707
|
-
return normalizeTwitchChannel(channelTarget);
|
|
708
|
-
}
|
|
709
726
|
const twitchPlugin = createChatChannelPlugin({
|
|
710
727
|
pairing: {
|
|
711
728
|
idLabel: "twitchUserId",
|
|
@@ -820,7 +837,7 @@ const twitchPlugin = createChatChannelPlugin({
|
|
|
820
837
|
await runPassiveAccountLifecycle({
|
|
821
838
|
abortSignal: ctx.abortSignal,
|
|
822
839
|
start: async () => {
|
|
823
|
-
const { monitorTwitchProvider } = await import("./monitor-
|
|
840
|
+
const { monitorTwitchProvider } = await import("./monitor-CbTcN0HN.mjs");
|
|
824
841
|
return monitorTwitchProvider({
|
|
825
842
|
account,
|
|
826
843
|
accountId,
|
|
@@ -0,0 +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-CbTcN0HN.mjs","sha256":"d0cac15100de52f1f187a8b1f0997f0ad2a66eebdce741bb55dde203e32f800e","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-Dq8hlYYf.mjs","sha256":"bec6510fdc0631d69361cae6f95c5868db471cab5ad80c4efd1f971d123b2752","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-B5If4b0g.mjs","sha256":"1482ac52cae0fbaa600d2f622bf66feec37434646264743bd3d70529f4129317","facadeSource":null,"sources":["extensions/twitch/src/runtime.ts"]},{"output":".setup/setup-plugin-api-VbVHO_SG.mjs","sha256":"01c62c46acd12ec5144b6c1aaa60122efb60606652269a6a77c785eed24bc9d5","facadeSource":"extensions/twitch/setup-plugin-api.ts","sources":[]},{"output":".setup/setup-surface-BHuTmMZL.mjs","sha256":"22d501bd048dcef00597aed0b5ed02560416d6b97fd3a5bee45560deda7971bc","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":"a76c883c02a965f092c4579dd38c3cd426da3d8ca7eda7df09f9feb59513f83d","facadeSource":"extensions/twitch/api.ts","sources":[]},{"output":"channel-plugin-api.js","sha256":"2141d98d9a404df18084fc8f6324dc54582c86d0a1e38318c1c629d2cde6cef7","facadeSource":"extensions/twitch/channel-plugin-api.ts","sources":[]},{"output":"index.js","sha256":"4abcaf190b4f945d2c7547c73893858486037a13c2a40ae97a3d59688ca41527","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":"bb76ee8b720de1462ab57f1f4651fe6adfa7e5b85af938fdb187edc6d639a827","facadeSource":"extensions/twitch/setup-entry.ts","sources":["extensions/twitch/setup-entry.ts"]},{"output":"setup-plugin-api.js","sha256":"c706977485ac4fe748e1bcfa1e2aa890b37622a2b48ddaf00b9d6aa99554f75a","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 +1 @@
|
|
|
1
|
-
export { t as twitchPlugin } from "./.setup/plugin-
|
|
1
|
+
export { t as twitchPlugin } from "./.setup/plugin-Dq8hlYYf.mjs";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/twitch",
|
|
3
|
-
"version": "2026.10.
|
|
3
|
+
"version": "2026.10.9",
|
|
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.
|
|
34
|
+
"pluginApi": ">=2026.10.9"
|
|
35
35
|
},
|
|
36
36
|
"build": {
|
|
37
|
-
"openclawVersion": "2026.10.
|
|
37
|
+
"openclawVersion": "2026.10.9"
|
|
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.
|
|
77
|
+
"openclaw": ">=2026.10.9"
|
|
78
78
|
},
|
|
79
79
|
"peerDependenciesMeta": {
|
|
80
80
|
"openclaw": {
|