@openclaw/twitch 2026.5.14-beta.2 → 2026.5.16-beta.2
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/api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{monitor-DAM8hrYU.js → monitor-d1yhkO1M.js} +1 -1
- package/dist/{plugin-6H4HbNEm.js → plugin-CEhzoRMh.js} +14 -9
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{setup-surface-B7FlQUTK.js → setup-surface-BiDFQV9J.js} +24 -23
- package/package.json +4 -4
package/dist/api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as twitchPlugin } from "./plugin-
|
|
1
|
+
import { t as twitchPlugin } from "./plugin-CEhzoRMh.js";
|
|
2
2
|
export { twitchPlugin };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as stripMarkdownForTwitch, r as getOrCreateClientManager } from "./plugin-
|
|
1
|
+
import { n as stripMarkdownForTwitch, r as getOrCreateClientManager } from "./plugin-CEhzoRMh.js";
|
|
2
2
|
import { t as getTwitchRuntime } from "./runtime-C5O5cqdz.js";
|
|
3
3
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
4
4
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { a as getAccountConfig, c as resolveTwitchAccountContext, d as isAccountConfigured, f as missingTargetError, h as resolveTwitchToken, i as DEFAULT_ACCOUNT_ID, l as resolveTwitchSnapshotAccountId, m as normalizeTwitchChannel, o as listAccountIds, p as normalizeToken, r as twitchSetupWizard, s as resolveDefaultTwitchAccountId, t as twitchSetupAdapter, u as generateMessageId } from "./setup-surface-
|
|
1
|
+
import { a as getAccountConfig, c as resolveTwitchAccountContext, d as isAccountConfigured, f as missingTargetError, h as resolveTwitchToken, i as DEFAULT_ACCOUNT_ID, l as resolveTwitchSnapshotAccountId, m as normalizeTwitchChannel, o as listAccountIds, p as normalizeToken, r as twitchSetupWizard, s as resolveDefaultTwitchAccountId, t as twitchSetupAdapter, u as generateMessageId } from "./setup-surface-BiDFQV9J.js";
|
|
2
2
|
import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
|
|
3
3
|
import { buildChannelConfigSchema } from "openclaw/plugin-sdk/channel-config-schema";
|
|
4
4
|
import { createChatChannelPlugin } from "openclaw/plugin-sdk/channel-core";
|
|
5
5
|
import { createLoggedPairingApprovalNotifier, createPairingPrefixStripper } from "openclaw/plugin-sdk/channel-pairing";
|
|
6
|
-
import { buildPassiveProbedChannelStatusSummary } from "openclaw/plugin-sdk/extension-shared";
|
|
6
|
+
import { buildPassiveProbedChannelStatusSummary, runStoppablePassiveMonitor } from "openclaw/plugin-sdk/extension-shared";
|
|
7
7
|
import { createComputedAccountStatusAdapter, createDefaultChannelRuntimeState } from "openclaw/plugin-sdk/status-helpers";
|
|
8
8
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
9
9
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -1253,13 +1253,18 @@ const twitchPlugin = createChatChannelPlugin({
|
|
|
1253
1253
|
lastError: null
|
|
1254
1254
|
});
|
|
1255
1255
|
ctx.log?.info(`Starting Twitch connection for ${account.username}`);
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1256
|
+
await runStoppablePassiveMonitor({
|
|
1257
|
+
abortSignal: ctx.abortSignal,
|
|
1258
|
+
start: async () => {
|
|
1259
|
+
const { monitorTwitchProvider } = await import("./monitor-d1yhkO1M.js");
|
|
1260
|
+
return monitorTwitchProvider({
|
|
1261
|
+
account,
|
|
1262
|
+
accountId,
|
|
1263
|
+
config: ctx.cfg,
|
|
1264
|
+
runtime: ctx.runtime,
|
|
1265
|
+
abortSignal: ctx.abortSignal
|
|
1266
|
+
});
|
|
1267
|
+
}
|
|
1263
1268
|
});
|
|
1264
1269
|
},
|
|
1265
1270
|
stopAccount: async (ctx) => {
|
package/dist/setup-plugin-api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as twitchSetupPlugin } from "./setup-surface-
|
|
1
|
+
import { n as twitchSetupPlugin } from "./setup-surface-BiDFQV9J.js";
|
|
2
2
|
export { twitchSetupPlugin };
|
|
@@ -3,7 +3,7 @@ import { randomUUID } from "node:crypto";
|
|
|
3
3
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { normalizeOptionalAccountId } from "openclaw/plugin-sdk/account-id";
|
|
5
5
|
import { getChatChannelMeta } from "openclaw/plugin-sdk/core";
|
|
6
|
-
import { formatDocsLink, normalizeAccountId as normalizeAccountId$1 } from "openclaw/plugin-sdk/setup";
|
|
6
|
+
import { createSetupTranslator, formatDocsLink, normalizeAccountId as normalizeAccountId$1 } from "openclaw/plugin-sdk/setup";
|
|
7
7
|
//#region extensions/twitch/src/token.ts
|
|
8
8
|
/**
|
|
9
9
|
* Twitch access token resolution with environment variable support.
|
|
@@ -222,6 +222,7 @@ function resolveTwitchSnapshotAccountId(cfg, account) {
|
|
|
222
222
|
* Twitch setup wizard surface for CLI setup.
|
|
223
223
|
*/
|
|
224
224
|
const channel = "twitch";
|
|
225
|
+
const t = createSetupTranslator();
|
|
225
226
|
const INVALID_ACCOUNT_ID_MESSAGE = "Invalid Twitch account id";
|
|
226
227
|
function normalizeRequestedSetupAccountId(accountId) {
|
|
227
228
|
const normalized = normalizeOptionalAccountId(accountId);
|
|
@@ -268,25 +269,25 @@ function setTwitchAccount(cfg, account, accountId = resolveSetupAccountId(cfg))
|
|
|
268
269
|
}
|
|
269
270
|
async function noteTwitchSetupHelp(prompter) {
|
|
270
271
|
await prompter.note([
|
|
271
|
-
"
|
|
272
|
-
"
|
|
273
|
-
"
|
|
274
|
-
"
|
|
275
|
-
"
|
|
276
|
-
"
|
|
272
|
+
t("wizard.twitch.helpRequiresBot"),
|
|
273
|
+
t("wizard.twitch.helpCreateApp"),
|
|
274
|
+
t("wizard.twitch.helpGenerateToken"),
|
|
275
|
+
t("wizard.twitch.helpTokenTools"),
|
|
276
|
+
t("wizard.twitch.helpCopyToken"),
|
|
277
|
+
t("wizard.twitch.helpEnvVars"),
|
|
277
278
|
`Docs: ${formatDocsLink("/channels/twitch", "channels/twitch")}`
|
|
278
|
-
].join("\n"), "
|
|
279
|
+
].join("\n"), t("wizard.twitch.setupTitle"));
|
|
279
280
|
}
|
|
280
281
|
async function promptToken(prompter, account, envToken) {
|
|
281
282
|
const existingToken = account?.accessToken ?? "";
|
|
282
283
|
if (existingToken && !envToken) {
|
|
283
284
|
if (await prompter.confirm({
|
|
284
|
-
message: "
|
|
285
|
+
message: t("wizard.twitch.accessTokenKeep"),
|
|
285
286
|
initialValue: true
|
|
286
287
|
})) return existingToken;
|
|
287
288
|
}
|
|
288
289
|
return (await prompter.text({
|
|
289
|
-
message: "
|
|
290
|
+
message: t("wizard.twitch.oauthTokenPrompt"),
|
|
290
291
|
initialValue: envToken ?? "",
|
|
291
292
|
validate: (value) => {
|
|
292
293
|
const raw = value?.trim() ?? "";
|
|
@@ -297,38 +298,38 @@ async function promptToken(prompter, account, envToken) {
|
|
|
297
298
|
}
|
|
298
299
|
async function promptUsername(prompter, account) {
|
|
299
300
|
return (await prompter.text({
|
|
300
|
-
message: "
|
|
301
|
+
message: t("wizard.twitch.botUsernamePrompt"),
|
|
301
302
|
initialValue: account?.username ?? "",
|
|
302
303
|
validate: (value) => value?.trim() ? void 0 : "Required"
|
|
303
304
|
})).trim();
|
|
304
305
|
}
|
|
305
306
|
async function promptClientId(prompter, account) {
|
|
306
307
|
return (await prompter.text({
|
|
307
|
-
message: "
|
|
308
|
+
message: t("wizard.twitch.clientIdPrompt"),
|
|
308
309
|
initialValue: account?.clientId ?? "",
|
|
309
310
|
validate: (value) => value?.trim() ? void 0 : "Required"
|
|
310
311
|
})).trim();
|
|
311
312
|
}
|
|
312
313
|
async function promptChannelName(prompter, account) {
|
|
313
314
|
return (await prompter.text({
|
|
314
|
-
message: "
|
|
315
|
+
message: t("wizard.twitch.channelJoinPrompt"),
|
|
315
316
|
initialValue: account?.channel ?? "",
|
|
316
317
|
validate: (value) => value?.trim() ? void 0 : "Required"
|
|
317
318
|
})).trim();
|
|
318
319
|
}
|
|
319
320
|
async function promptRefreshTokenSetup(prompter, account) {
|
|
320
321
|
if (!await prompter.confirm({
|
|
321
|
-
message: "
|
|
322
|
+
message: t("wizard.twitch.refreshTokenPrompt"),
|
|
322
323
|
initialValue: Boolean(account?.clientSecret && account?.refreshToken)
|
|
323
324
|
})) return {};
|
|
324
325
|
return {
|
|
325
326
|
clientSecret: (await prompter.text({
|
|
326
|
-
message: "
|
|
327
|
+
message: t("wizard.twitch.clientSecretPrompt"),
|
|
327
328
|
initialValue: account?.clientSecret ?? "",
|
|
328
329
|
validate: (value) => value?.trim() ? void 0 : "Required"
|
|
329
330
|
})).trim() || void 0,
|
|
330
331
|
refreshToken: (await prompter.text({
|
|
331
|
-
message: "
|
|
332
|
+
message: t("wizard.twitch.refreshTokenInputPrompt"),
|
|
332
333
|
initialValue: account?.refreshToken ?? "",
|
|
333
334
|
validate: (value) => value?.trim() ? void 0 : "Required"
|
|
334
335
|
})).trim() || void 0
|
|
@@ -338,7 +339,7 @@ async function configureWithEnvToken(cfg, prompter, account, envToken, forceAllo
|
|
|
338
339
|
const resolvedAccountId = accountId.trim() ? normalizeRequestedSetupAccountId(accountId) : resolveSetupAccountId(cfg);
|
|
339
340
|
if (resolvedAccountId !== "default") return null;
|
|
340
341
|
if (!await prompter.confirm({
|
|
341
|
-
message: "
|
|
342
|
+
message: t("wizard.twitch.envPrompt"),
|
|
342
343
|
initialValue: true
|
|
343
344
|
})) return null;
|
|
344
345
|
const cfgWithAccount = setTwitchAccount(cfg, {
|
|
@@ -399,7 +400,7 @@ const twitchDmPolicy = {
|
|
|
399
400
|
const account = getAccountConfig(cfg, resolvedAccountId);
|
|
400
401
|
const existingAllowFrom = account?.allowFrom ?? [];
|
|
401
402
|
const allowFrom = (await prompter.text({
|
|
402
|
-
message: "
|
|
403
|
+
message: t("wizard.twitch.allowFromPrompt"),
|
|
403
404
|
placeholder: "123456789",
|
|
404
405
|
initialValue: existingAllowFrom[0] || void 0
|
|
405
406
|
}) ?? "").split(/[\n,;]+/g).map((s) => s.trim()).filter(Boolean);
|
|
@@ -434,17 +435,17 @@ const twitchSetupWizard = {
|
|
|
434
435
|
resolveAccountIdForConfigure: ({ cfg, accountOverride }) => resolveSetupAccountId(cfg, accountOverride),
|
|
435
436
|
resolveShouldPromptAccountIds: () => false,
|
|
436
437
|
status: {
|
|
437
|
-
configuredLabel: "
|
|
438
|
-
unconfiguredLabel: "
|
|
439
|
-
configuredHint: "
|
|
440
|
-
unconfiguredHint: "
|
|
438
|
+
configuredLabel: t("wizard.channels.statusConfigured"),
|
|
439
|
+
unconfiguredLabel: t("wizard.channels.statusNeedsUsernameTokenClientId"),
|
|
440
|
+
configuredHint: t("wizard.channels.statusConfigured"),
|
|
441
|
+
unconfiguredHint: t("wizard.channels.statusNeedsSetup"),
|
|
441
442
|
resolveConfigured: ({ cfg, accountId }) => {
|
|
442
443
|
return resolveTwitchAccountContext(cfg, resolveSetupAccountId(cfg, accountId)).configured;
|
|
443
444
|
},
|
|
444
445
|
resolveStatusLines: ({ cfg, accountId }) => {
|
|
445
446
|
const resolvedAccountId = resolveSetupAccountId(cfg, accountId);
|
|
446
447
|
const configured = resolveTwitchAccountContext(cfg, resolvedAccountId).configured;
|
|
447
|
-
return [`Twitch${resolvedAccountId !== "default" ? ` (${resolvedAccountId})` : ""}: ${configured ? "
|
|
448
|
+
return [`Twitch${resolvedAccountId !== "default" ? ` (${resolvedAccountId})` : ""}: ${configured ? t("wizard.channels.statusConfigured") : t("wizard.channels.statusNeedsUsernameTokenClientId")}`];
|
|
448
449
|
}
|
|
449
450
|
},
|
|
450
451
|
credentials: [],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/twitch",
|
|
3
|
-
"version": "2026.5.
|
|
3
|
+
"version": "2026.5.16-beta.2",
|
|
4
4
|
"description": "OpenClaw Twitch channel plugin",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
"minHostVersion": ">=2026.4.10"
|
|
28
28
|
},
|
|
29
29
|
"compat": {
|
|
30
|
-
"pluginApi": ">=2026.5.
|
|
30
|
+
"pluginApi": ">=2026.5.16-beta.2"
|
|
31
31
|
},
|
|
32
32
|
"build": {
|
|
33
|
-
"openclawVersion": "2026.5.
|
|
33
|
+
"openclawVersion": "2026.5.16-beta.2"
|
|
34
34
|
},
|
|
35
35
|
"channel": {
|
|
36
36
|
"id": "twitch",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"README.md"
|
|
58
58
|
],
|
|
59
59
|
"peerDependencies": {
|
|
60
|
-
"openclaw": ">=2026.5.
|
|
60
|
+
"openclaw": ">=2026.5.16-beta.2"
|
|
61
61
|
},
|
|
62
62
|
"peerDependenciesMeta": {
|
|
63
63
|
"openclaw": {
|