@openclaw/twitch 2026.9.6 → 2026.9.7

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/assets/icon.png CHANGED
Binary file
@@ -1,5 +1,5 @@
1
- import { n as sendMessageTwitchInternal, r as getOrCreateClientManager } from "./plugin-CqPt4cYf.mjs";
2
- import { d as normalizeTwitchChannel } from "./setup-surface-D_5uHrDU.mjs";
1
+ import { n as sendMessageTwitchInternal, r as getOrCreateClientManager } from "./plugin-BbtWQOSW.mjs";
2
+ import { l as normalizeTwitchChannel } from "./setup-surface-KNOOeRU6.mjs";
3
3
  import { t as getTwitchRuntime } from "./runtime-B5If4b0g.mjs";
4
4
  import { createChannelIngressError, createChannelIngressMonitor } from "openclaw/plugin-sdk/channel-outbound";
5
5
  import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
@@ -282,9 +282,6 @@ function createTwitchIngress(options) {
282
282
  }
283
283
  //#endregion
284
284
  //#region extensions/twitch/src/monitor.ts
285
- /**
286
- * Process an incoming Twitch message and dispatch to agent.
287
- */
288
285
  async function processTwitchMessage(params) {
289
286
  const { message, account, accountId, config, runtime, channelRuntime, turnAdoptionLifecycle, statusSink } = params;
290
287
  const cfg = config;
@@ -405,9 +402,6 @@ async function processTwitchMessage(params) {
405
402
  }
406
403
  });
407
404
  }
408
- /**
409
- * Deliver a reply to Twitch chat.
410
- */
411
405
  async function deliverTwitchReply(params) {
412
406
  const { payload, channel, account, accountId, config, runtime } = params;
413
407
  try {
@@ -434,11 +428,6 @@ async function deliverTwitchReply(params) {
434
428
  return { visibleReplySent: false };
435
429
  }
436
430
  }
437
- /**
438
- * Main monitor provider for Twitch.
439
- *
440
- * Sets up message handlers and processes incoming messages.
441
- */
442
431
  async function monitorTwitchProvider(options) {
443
432
  const { account, accountId, channelRuntime, config, runtime, abortSignal, statusSink } = options;
444
433
  const core = getTwitchRuntime();
@@ -1,4 +1,4 @@
1
- import { a as resolveTwitchAccountContext, c as isAccountConfigured, d as normalizeTwitchChannel, f as resolveTwitchToken, i as resolveDefaultTwitchAccountId, l as missingTargetError, n as DEFAULT_ACCOUNT_ID$1, o as resolveTwitchSnapshotAccountId, r as getAccountConfig, s as twitchConfigAdapter, t as twitchSetupPlugin, u as normalizeToken } from "./setup-surface-D_5uHrDU.mjs";
1
+ import { a as resolveTwitchAccountContext, c as normalizeToken, i as resolveDefaultTwitchAccountId, l as normalizeTwitchChannel, n as DEFAULT_ACCOUNT_ID$1, o as twitchConfigAdapter, r as getAccountConfig, s as isAccountConfigured, t as twitchSetupPlugin, u as resolveTwitchToken } from "./setup-surface-KNOOeRU6.mjs";
2
2
  import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
3
3
  import { MarkdownConfigSchema, buildChannelConfigSchema } from "openclaw/plugin-sdk/channel-config-schema";
4
4
  import { buildChannelOutboundSessionRoute, createChatChannelPlugin, stripChannelTargetPrefix } from "openclaw/plugin-sdk/channel-core";
@@ -17,64 +17,20 @@ import { normalizeLowercaseStringOrEmpty, normalizeStringEntries } from "opencla
17
17
  import { z } from "zod";
18
18
  import { HttpStatusCodeError, callTwitchApi } from "@twurple/api-call";
19
19
  //#region extensions/twitch/src/actions.ts
20
- /**
21
- * Read a string parameter from action arguments.
22
- *
23
- * @param args - Action arguments
24
- * @param key - Parameter key
25
- * @param options - Options for reading the parameter
26
- * @returns The parameter value or undefined if not found
27
- */
28
- function readStringParam(args, key, options = {}) {
29
- const value = args[key];
30
- if (value === void 0 || value === null) {
31
- if (options.required) throw new Error(`Missing required parameter: ${key}`);
32
- return;
33
- }
34
- if (typeof value === "string") return options.trim !== false ? value.trim() : value;
35
- if (typeof value === "number" || typeof value === "boolean") {
36
- const str = String(value);
37
- return options.trim !== false ? str.trim() : str;
38
- }
39
- throw new Error(`Parameter ${key} must be a string, number, or boolean`);
20
+ function readSendValue(value) {
21
+ return typeof value === "string" || typeof value === "number" || typeof value === "boolean" ? String(value).trim() : void 0;
40
22
  }
41
- /** Supported Twitch actions */
42
- const TWITCH_ACTIONS = /* @__PURE__ */ new Set(["send"]);
43
- /**
44
- * Twitch message actions adapter.
45
- */
46
23
  const twitchMessageActions = {
47
- /**
48
- * List available actions for this channel.
49
- */
50
- describeMessageTool: () => ({ actions: [...TWITCH_ACTIONS] }),
51
- /**
52
- * Check if an action is supported.
53
- */
54
- supportsAction: ({ action }) => TWITCH_ACTIONS.has(action),
55
- /**
56
- * Extract tool send parameters from action arguments.
57
- *
58
- * Parses and validates the "to" and "message" parameters for sending.
59
- *
60
- * @param params - Arguments from the tool call
61
- * @returns Parsed send parameters or null if invalid
62
- *
63
- * @example
64
- * const result = twitchMessageActions.extractToolSend!({
65
- * args: { to: "#mychannel", message: "Hello!" }
66
- * });
67
- * // Returns: { to: "#mychannel", message: "Hello!" }
68
- */
24
+ describeMessageTool: () => ({ actions: ["send"] }),
25
+ supportsAction: ({ action }) => action === "send",
69
26
  extractToolSend: ({ args }) => {
70
27
  try {
71
- const to = readStringParam(args, "to", { required: true });
72
- const message = readStringParam(args, "message", { required: true });
73
- if (!to || !message) return null;
74
- return {
28
+ const to = readSendValue(args.to);
29
+ const message = readSendValue(args.message);
30
+ return to && message ? {
75
31
  to,
76
32
  message
77
- };
33
+ } : null;
78
34
  } catch {
79
35
  return null;
80
36
  }
@@ -83,9 +39,6 @@ const twitchMessageActions = {
83
39
  //#endregion
84
40
  //#region extensions/twitch/src/twitch-client.ts
85
41
  const TWITCH_CHAT_AUTH_INTENTS = ["chat"];
86
- /**
87
- * Manages Twitch chat client connections
88
- */
89
42
  var TwitchClientManager = class {
90
43
  constructor(logger, statusSink) {
91
44
  this.logger = logger;
@@ -94,7 +47,6 @@ var TwitchClientManager = class {
94
47
  this.pendingClients = /* @__PURE__ */ new Map();
95
48
  this.connectionPromises = /* @__PURE__ */ new Map();
96
49
  this.messageHandlers = /* @__PURE__ */ new Map();
97
- this.messageHandlerTokens = /* @__PURE__ */ new Map();
98
50
  }
99
51
  setStatusSink(statusSink) {
100
52
  if (statusSink) this.statusSink = statusSink;
@@ -109,9 +61,6 @@ var TwitchClientManager = class {
109
61
  lastError
110
62
  });
111
63
  }
112
- /**
113
- * Create an auth provider for the account.
114
- */
115
64
  async createAuthProvider(account, normalizedToken) {
116
65
  if (!account.clientId) throw new Error("Missing Twitch client ID");
117
66
  if (account.clientSecret) {
@@ -143,9 +92,6 @@ var TwitchClientManager = class {
143
92
  this.logger.info(`Using StaticAuthProvider for ${account.username} (no clientSecret provided)`);
144
93
  return new StaticAuthProvider(account.clientId, normalizedToken);
145
94
  }
146
- /**
147
- * Get or create a chat client for an account
148
- */
149
95
  async getClient(account, cfg, accountId) {
150
96
  const key = this.getAccountKey(account);
151
97
  const existing = this.clients.get(key);
@@ -185,8 +131,6 @@ var TwitchClientManager = class {
185
131
  custom: { log: (level, message) => {
186
132
  switch (level) {
187
133
  case LogLevel.CRITICAL:
188
- this.logger.error(message);
189
- break;
190
134
  case LogLevel.ERROR:
191
135
  this.logger.error(message);
192
136
  break;
@@ -197,8 +141,6 @@ var TwitchClientManager = class {
197
141
  this.logger.info(message);
198
142
  break;
199
143
  case LogLevel.DEBUG:
200
- this.logger.debug?.(message);
201
- break;
202
144
  case LogLevel.TRACE: this.logger.debug?.(message);
203
145
  }
204
146
  } }
@@ -211,10 +153,8 @@ var TwitchClientManager = class {
211
153
  client.quit();
212
154
  throw new Error(`Twitch connection cancelled for ${account.username}`);
213
155
  }
214
- this.pendingClients.delete(key);
215
- } catch (error) {
156
+ } finally {
216
157
  if (this.pendingClients.get(key) === client) this.pendingClients.delete(key);
217
- throw error;
218
158
  }
219
159
  this.setupClientHandlers(client, account);
220
160
  this.clients.set(key, client);
@@ -265,13 +205,10 @@ var TwitchClientManager = class {
265
205
  }
266
206
  });
267
207
  }
268
- /**
269
- * Set up message and event handlers for a client
270
- */
271
208
  setupClientHandlers(client, account) {
272
209
  const key = this.getAccountKey(account);
273
210
  client.onMessage((channelName, _user, messageText, msg) => {
274
- const handler = this.messageHandlers.get(key);
211
+ const handler = this.messageHandlers.get(key)?.handler;
275
212
  if (handler) {
276
213
  const from = `twitch:${msg.userInfo.userName}`;
277
214
  const preview = sliceUtf16Safe(messageText, 0, 100).replace(/\n/g, "\\n");
@@ -301,29 +238,14 @@ var TwitchClientManager = class {
301
238
  });
302
239
  this.logger.info(`Set up handlers for ${key}`);
303
240
  }
304
- /**
305
- * Set a message handler for an account
306
- * @returns A function that removes the handler when called
307
- */
308
241
  onMessage(account, handler) {
309
242
  const key = this.getAccountKey(account);
310
- const token = Symbol(key);
311
- this.messageHandlers.set(key, handler);
312
- this.messageHandlerTokens.set(key, token);
243
+ const registration = { handler };
244
+ this.messageHandlers.set(key, registration);
313
245
  return () => {
314
- if (this.messageHandlerTokens.get(key) === token) {
315
- this.messageHandlers.delete(key);
316
- this.messageHandlerTokens.delete(key);
317
- }
246
+ if (this.messageHandlers.get(key) === registration) this.messageHandlers.delete(key);
318
247
  };
319
248
  }
320
- clearMessageHandler(key) {
321
- this.messageHandlers.delete(key);
322
- this.messageHandlerTokens.delete(key);
323
- }
324
- /**
325
- * Disconnect a client
326
- */
327
249
  async disconnect(account) {
328
250
  const key = this.getAccountKey(account);
329
251
  const client = this.clients.get(key);
@@ -338,11 +260,8 @@ var TwitchClientManager = class {
338
260
  this.clients.delete(key);
339
261
  this.logger.info(`Disconnected ${key}`);
340
262
  }
341
- if (pendingConnection || pendingClient || client) this.clearMessageHandler(key);
263
+ if (pendingConnection || pendingClient || client) this.messageHandlers.delete(key);
342
264
  }
343
- /**
344
- * Disconnect all clients
345
- */
346
265
  async disconnectAll() {
347
266
  this.pendingClients.forEach((client) => client.quit());
348
267
  this.clients.forEach((client) => client.quit());
@@ -350,12 +269,8 @@ var TwitchClientManager = class {
350
269
  this.connectionPromises.clear();
351
270
  this.clients.clear();
352
271
  this.messageHandlers.clear();
353
- this.messageHandlerTokens.clear();
354
272
  this.logger.info(" Disconnected all clients");
355
273
  }
356
- /**
357
- * Send a message to a channel
358
- */
359
274
  async sendMessage(account, channel, message, cfg, accountId) {
360
275
  try {
361
276
  const client = await this.getClient(account, cfg, accountId);
@@ -374,33 +289,13 @@ var TwitchClientManager = class {
374
289
  };
375
290
  }
376
291
  }
377
- /**
378
- * Generate a unique key for an account
379
- */
380
292
  getAccountKey(account) {
381
293
  return `${account.username}:${account.channel}`;
382
294
  }
383
295
  };
384
296
  //#endregion
385
297
  //#region extensions/twitch/src/client-manager-registry.ts
386
- /**
387
- * Client manager registry for Twitch plugin.
388
- *
389
- * Manages the lifecycle of TwitchClientManager instances across the plugin,
390
- * ensuring proper cleanup when accounts are stopped or reconfigured.
391
- */
392
- /**
393
- * Global registry of client managers.
394
- * Keyed by account ID.
395
- */
396
298
  const registry = /* @__PURE__ */ new Map();
397
- /**
398
- * Get or create a client manager for an account.
399
- *
400
- * @param accountId - The account ID
401
- * @param logger - Logger instance
402
- * @returns The client manager
403
- */
404
299
  function getOrCreateClientManager(accountId, logger, statusSink) {
405
300
  const existing = registry.get(accountId);
406
301
  if (existing) {
@@ -410,28 +305,14 @@ function getOrCreateClientManager(accountId, logger, statusSink) {
410
305
  const manager = new TwitchClientManager(logger, statusSink);
411
306
  registry.set(accountId, {
412
307
  manager,
413
- accountId,
414
- logger,
415
- createdAt: Date.now()
308
+ logger
416
309
  });
417
310
  logger.info(`Registered client manager for account: ${accountId}`);
418
311
  return manager;
419
312
  }
420
- /**
421
- * Get an existing client manager for an account.
422
- *
423
- * @param accountId - The account ID
424
- * @returns The client manager, or undefined if not registered
425
- */
426
313
  function getClientManager(accountId) {
427
314
  return registry.get(accountId)?.manager;
428
315
  }
429
- /**
430
- * Disconnect and remove a client manager from the registry.
431
- *
432
- * @param accountId - The account ID
433
- * @returns Promise that resolves when cleanup is complete
434
- */
435
316
  async function removeClientManager(accountId) {
436
317
  const entry = registry.get(accountId);
437
318
  if (!entry) return;
@@ -444,9 +325,6 @@ async function removeClientManager(accountId) {
444
325
  }
445
326
  //#endregion
446
327
  //#region extensions/twitch/src/config-schema.ts
447
- /**
448
- * Twitch user roles that can be allowed to interact with the bot
449
- */
450
328
  const TwitchRoleSchema = z.enum([
451
329
  "moderator",
452
330
  "owner",
@@ -455,25 +333,20 @@ const TwitchRoleSchema = z.enum([
455
333
  "all"
456
334
  ]);
457
335
  const TwitchAccountShape = {
458
- /** Twitch username */
459
336
  username: z.string(),
460
337
  /** Twitch OAuth access token (requires chat:read and chat:write scopes) */
461
338
  accessToken: z.string(),
462
339
  /** Twitch client ID (from Twitch Developer Portal or twitchtokengenerator.com) */
463
340
  clientId: z.string().optional(),
464
- /** Channel name to join */
465
341
  channel: z.string().min(1),
466
- /** Enable this account */
467
342
  enabled: z.boolean().optional(),
468
343
  /** Allow channel-initiated configuration writes */
469
344
  configWrites: z.boolean().optional(),
470
345
  /** Allowlist of Twitch user IDs who can interact with the bot (use IDs for safety, not usernames) */
471
346
  allowFrom: z.array(z.string()).optional(),
472
- /** Roles allowed to interact with the bot (e.g., ["moderator", "vip", "subscriber"]) */
473
347
  allowedRoles: z.array(TwitchRoleSchema).optional(),
474
348
  /** Require @mention to trigger bot responses */
475
349
  requireMention: z.boolean().optional(),
476
- /** Outbound response prefix override for this channel/account. */
477
350
  responsePrefix: z.string().optional(),
478
351
  /** Twitch client secret (required for token refresh via RefreshingAuthProvider) */
479
352
  clientSecret: z.string().optional(),
@@ -484,13 +357,7 @@ const TwitchAccountShape = {
484
357
  /** Timestamp when token was obtained (optional, for token refresh tracking) */
485
358
  obtainmentTimestamp: z.number().optional()
486
359
  };
487
- /**
488
- * Twitch account configuration schema
489
- */
490
360
  const TwitchAccountSchema = z.object(TwitchAccountShape);
491
- /**
492
- * Base configuration properties shared by both single and multi-account modes
493
- */
494
361
  const TwitchConfigBaseShape = {
495
362
  name: z.string().optional(),
496
363
  enabled: z.boolean().optional(),
@@ -500,35 +367,14 @@ const TwitchConfigBaseShape = {
500
367
  historyLimit: z.number().int().min(0).optional(),
501
368
  responsePrefix: z.string().optional()
502
369
  };
503
- /**
504
- * Simplified single-account configuration schema
505
- *
506
- * Use this for single-account setups. Properties are at the top level,
507
- * creating an implicit "default" account.
508
- */
509
370
  const SimplifiedSchema = z.object({
510
371
  ...TwitchConfigBaseShape,
511
372
  ...TwitchAccountShape
512
373
  });
513
- /**
514
- * Multi-account configuration schema
515
- *
516
- * Use this for multi-account setups. Each key is an account ID (e.g., "default", "secondary").
517
- */
518
374
  const MultiAccountSchema = z.object({
519
375
  ...TwitchConfigBaseShape,
520
- /** Per-account configuration (for multi-account setups) */
521
376
  accounts: z.record(z.string(), TwitchAccountSchema)
522
- }).refine((val) => Object.keys(val.accounts || {}).length > 0, { message: "accounts must contain at least one entry" });
523
- /**
524
- * Twitch plugin configuration schema
525
- *
526
- * Supports two mutually exclusive patterns:
527
- * 1. Simplified single-account: username, accessToken, clientId, channel at top level
528
- * 2. Multi-account: accounts object with named account configs
529
- *
530
- * The union ensures clear discrimination between the two modes.
531
- */
377
+ }).refine((val) => Object.keys(val.accounts).length > 0, { message: "accounts must contain at least one entry" });
532
378
  const TwitchConfigSchema = z.union([SimplifiedSchema, MultiAccountSchema]);
533
379
  //#endregion
534
380
  //#region extensions/twitch/src/utils/markdown.ts
@@ -571,20 +417,7 @@ async function sendMessageTwitchInternal(params) {
571
417
  }
572
418
  //#endregion
573
419
  //#region extensions/twitch/src/outbound.ts
574
- /**
575
- * Twitch outbound adapter for sending messages.
576
- *
577
- * Implements the ChannelOutboundAdapter interface for Twitch chat.
578
- * Supports text and media (URL) sending with markdown stripping and chunking.
579
- */
580
- /**
581
- * Twitch outbound adapter.
582
- *
583
- * Handles sending text and media to Twitch channels with automatic
584
- * markdown stripping and message chunking.
585
- */
586
420
  const twitchOutbound = {
587
- /** Direct delivery mode - messages are sent immediately */
588
421
  deliveryMode: "direct",
589
422
  deliveryCapabilities: { durableFinal: {
590
423
  text: true,
@@ -592,69 +425,22 @@ const twitchOutbound = {
592
425
  messageSendingHooks: true
593
426
  } },
594
427
  textChunkLimit: 500,
595
- /** Strip internal assistant tool-trace scaffolding before delivery */
596
428
  sanitizeText: ({ text }) => sanitizeAssistantVisibleText(text),
597
- /**
598
- * Resolve target from context.
599
- *
600
- * Handles target resolution with allowlist support for implicit/heartbeat modes.
601
- * For explicit mode, accepts any valid channel name.
602
- *
603
- * @param params - Resolution parameters
604
- * @returns Resolved target or error
605
- */
606
429
  resolveTarget: ({ to, allowFrom, mode }) => {
607
430
  const trimmed = to?.trim() ?? "";
608
431
  const allowListRaw = normalizeStringEntries(allowFrom ?? []);
609
432
  const hasWildcard = allowListRaw.includes("*");
610
433
  const allowList = allowListRaw.filter((entry) => entry !== "*").map((entry) => normalizeTwitchChannel(entry)).filter((entry) => entry.length > 0);
611
- if (trimmed) {
612
- const normalizedTo = normalizeTwitchChannel(trimmed);
613
- if (!normalizedTo) return {
614
- ok: false,
615
- error: missingTargetError("Twitch", "<channel-name>")
616
- };
617
- if (mode === "implicit" || mode === "heartbeat") {
618
- if (hasWildcard || allowList.length === 0) return {
619
- ok: true,
620
- to: normalizedTo
621
- };
622
- if (allowList.includes(normalizedTo)) return {
623
- ok: true,
624
- to: normalizedTo
625
- };
626
- return {
627
- ok: false,
628
- error: missingTargetError("Twitch", "<channel-name>")
629
- };
630
- }
631
- return {
632
- ok: true,
633
- to: normalizedTo
634
- };
635
- }
434
+ const normalizedTo = normalizeTwitchChannel(trimmed);
435
+ if (normalizedTo && (!(mode === "implicit" || mode === "heartbeat") || hasWildcard || allowList.length === 0 || allowList.includes(normalizedTo))) return {
436
+ ok: true,
437
+ to: normalizedTo
438
+ };
636
439
  return {
637
440
  ok: false,
638
- error: missingTargetError("Twitch", "<channel-name>")
441
+ error: /* @__PURE__ */ new Error("Delivering to Twitch requires target <channel-name>")
639
442
  };
640
443
  },
641
- /**
642
- * Send a text message to a Twitch channel.
643
- *
644
- * Strips Markdown, validates account configuration,
645
- * and sends the message via the Twitch client.
646
- *
647
- * @param params - Send parameters including target, text, and config
648
- * @returns Delivery result with message ID and status
649
- *
650
- * @example
651
- * const result = await twitchOutbound.sendText({
652
- * cfg: openclawConfig,
653
- * to: "#mychannel",
654
- * text: "Hello Twitch!",
655
- * accountId: "default",
656
- * });
657
- */
658
444
  sendText: async (params) => {
659
445
  const { cfg, to, text, accountId } = params;
660
446
  if (params.signal?.aborted) throw new Error("Outbound delivery aborted");
@@ -681,29 +467,10 @@ const twitchOutbound = {
681
467
  timestamp: Date.now()
682
468
  };
683
469
  },
684
- /**
685
- * Send media to a Twitch channel.
686
- *
687
- * Note: Twitch chat doesn't support direct media uploads.
688
- * This sends the media URL as text instead.
689
- *
690
- * @param params - Send parameters including media URL
691
- * @returns Delivery result with message ID and status
692
- *
693
- * @example
694
- * const result = await twitchOutbound.sendMedia({
695
- * cfg: openclawConfig,
696
- * to: "#mychannel",
697
- * text: "Check this out!",
698
- * mediaUrl: "https://example.com/image.png",
699
- * accountId: "default",
700
- * });
701
- */
702
470
  sendMedia: async (params) => {
703
471
  const { text, mediaUrl } = params;
704
472
  if (params.signal?.aborted) throw new Error("Outbound delivery aborted");
705
473
  const message = mediaUrl ? `${text || ""} ${mediaUrl}`.trim() : text;
706
- if (!twitchOutbound.sendText) throw new Error("sendText not implemented");
707
474
  return twitchOutbound.sendText({
708
475
  ...params,
709
476
  text: message
@@ -788,32 +555,12 @@ async function probeTwitch(account, timeoutMs) {
788
555
  }
789
556
  //#endregion
790
557
  //#region extensions/twitch/src/resolver.ts
791
- /**
792
- * Twitch resolver adapter for channel/user name resolution.
793
- *
794
- * This module implements the ChannelResolverAdapter interface to resolve
795
- * Twitch usernames to user IDs via the Twitch Helix API.
796
- */
797
558
  const TWITCH_HELIX_USER_LOOKUP_TIMEOUT_MS = 1e4;
798
- /**
799
- * Normalize a Twitch username - strip @ prefix and convert to lowercase
800
- */
801
559
  function normalizeUsername(input) {
802
560
  const trimmed = input.trim();
803
561
  if (trimmed.startsWith("@")) return normalizeLowercaseStringOrEmpty(trimmed.slice(1));
804
562
  return normalizeLowercaseStringOrEmpty(trimmed);
805
563
  }
806
- /**
807
- * Create a logger that includes the Twitch prefix
808
- */
809
- function createLogger(logger) {
810
- return {
811
- info: (msg) => logger?.info(msg),
812
- warn: (msg) => logger?.warn(msg),
813
- error: (msg) => logger?.error(msg),
814
- debug: (msg) => logger?.debug?.(msg) ?? (() => {})
815
- };
816
- }
817
564
  function createHelixUserResolver(clientId, accessToken) {
818
565
  let tokenValidated = false;
819
566
  return async (query) => {
@@ -847,19 +594,9 @@ function createHelixUserResolver(clientId, accessToken) {
847
594
  }
848
595
  };
849
596
  }
850
- /**
851
- * Resolve Twitch usernames to user IDs via the Helix API
852
- *
853
- * @param inputs - Array of usernames or user IDs to resolve
854
- * @param account - Twitch account configuration with auth credentials
855
- * @param kind - Type of target to resolve ("user" or "group")
856
- * @param logger - Optional logger
857
- * @returns Promise resolving to array of ChannelResolveResult
858
- */
859
- async function resolveTwitchTargets(inputs, account, _kind, logger) {
860
- const log = createLogger(logger);
597
+ async function resolveTwitchTargets(inputs, account, _kind, log) {
861
598
  if (!account.clientId || !account.accessToken) {
862
- log.error("Missing Twitch client ID or accessToken");
599
+ log?.error("Missing Twitch client ID or accessToken");
863
600
  return inputs.map((input) => ({
864
601
  input,
865
602
  resolved: false,
@@ -881,43 +618,23 @@ async function resolveTwitchTargets(inputs, account, _kind, logger) {
881
618
  }
882
619
  const looksLikeUserId = /^\d+$/.test(normalized);
883
620
  try {
884
- if (looksLikeUserId) {
885
- const user = await resolveHelixUser({ id: normalized });
886
- if (user) {
887
- results.push({
888
- input,
889
- resolved: true,
890
- id: user.id,
891
- name: user.login
892
- });
893
- log.debug?.(`Resolved user ID ${normalized} -> ${user.login}`);
894
- } else {
895
- results.push({
896
- input,
897
- resolved: false,
898
- note: "user ID not found"
899
- });
900
- log.warn(`User ID ${normalized} not found`);
901
- }
621
+ const user = await resolveHelixUser(looksLikeUserId ? { id: normalized } : { login: normalized });
622
+ if (user) {
623
+ results.push({
624
+ input,
625
+ resolved: true,
626
+ id: user.id,
627
+ name: user.login,
628
+ ...!looksLikeUserId ? { note: user.display_name !== user.login ? `display: ${user.display_name}` : void 0 } : {}
629
+ });
630
+ log?.debug?.(looksLikeUserId ? `Resolved user ID ${normalized} -> ${user.login}` : `Resolved username ${normalized} -> ${user.id} (${user.login})`);
902
631
  } else {
903
- const user = await resolveHelixUser({ login: normalized });
904
- if (user) {
905
- results.push({
906
- input,
907
- resolved: true,
908
- id: user.id,
909
- name: user.login,
910
- note: user.display_name !== user.login ? `display: ${user.display_name}` : void 0
911
- });
912
- log.debug?.(`Resolved username ${normalized} -> ${user.id} (${user.login})`);
913
- } else {
914
- results.push({
915
- input,
916
- resolved: false,
917
- note: "username not found"
918
- });
919
- log.warn(`Username ${normalized} not found`);
920
- }
632
+ results.push({
633
+ input,
634
+ resolved: false,
635
+ note: looksLikeUserId ? "user ID not found" : "username not found"
636
+ });
637
+ log?.warn(`${looksLikeUserId ? "User ID" : "Username"} ${normalized} not found`);
921
638
  }
922
639
  } catch (error) {
923
640
  const errorMessage = formatErrorMessage(error);
@@ -926,30 +643,13 @@ async function resolveTwitchTargets(inputs, account, _kind, logger) {
926
643
  resolved: false,
927
644
  note: `API error: ${errorMessage}`
928
645
  });
929
- log.error(`Failed to resolve ${input}: ${errorMessage}`);
646
+ log?.error(`Failed to resolve ${input}: ${errorMessage}`);
930
647
  }
931
648
  }
932
649
  return results;
933
650
  }
934
651
  //#endregion
935
652
  //#region extensions/twitch/src/status.ts
936
- /**
937
- * Collect status issues for Twitch accounts.
938
- *
939
- * Analyzes account snapshots and detects configuration problems,
940
- * authentication issues, and other potential problems.
941
- *
942
- * @param accounts - Array of account snapshots to analyze
943
- * @param getCfg - Optional function to get full config for additional checks
944
- * @returns Array of detected status issues
945
- *
946
- * @example
947
- * const issues = collectTwitchStatusIssues(accountSnapshots);
948
- * if (issues.length > 0) {
949
- * console.warn("Twitch configuration issues detected:");
950
- * issues.forEach(issue => console.warn(`- ${issue.message}`));
951
- * }
952
- */
953
653
  function collectTwitchStatusIssues(accounts, getCfg) {
954
654
  const issues = [];
955
655
  for (const entry of accounts) {
@@ -1007,13 +707,6 @@ function collectTwitchStatusIssues(accounts, getCfg) {
1007
707
  message: "clientSecret provided without refreshToken",
1008
708
  fix: "For automatic token refresh, provide both clientSecret and refreshToken. Otherwise, clientSecret is not needed."
1009
709
  });
1010
- if (account.allowFrom && account.allowFrom.length === 0) issues.push({
1011
- channel: "twitch",
1012
- accountId,
1013
- kind: "config",
1014
- message: "allowFrom is configured but empty",
1015
- fix: "Either add user IDs to allowFrom, remove the allowFrom field, or use allowedRoles instead."
1016
- });
1017
710
  if (account.allowedRoles?.includes("all") && account.allowFrom && account.allowFrom.length > 0) issues.push({
1018
711
  channel: "twitch",
1019
712
  accountId,
@@ -1051,12 +744,6 @@ function collectTwitchStatusIssues(accounts, getCfg) {
1051
744
  }
1052
745
  //#endregion
1053
746
  //#region extensions/twitch/src/plugin.ts
1054
- /**
1055
- * Twitch channel plugin for OpenClaw.
1056
- *
1057
- * Main plugin export combining all adapters (outbound, actions, status, gateway).
1058
- * This is the primary entry point for the Twitch channel integration.
1059
- */
1060
747
  function normalizeTwitchMessagingTarget(target) {
1061
748
  const providerTarget = stripChannelTargetPrefix(target, "twitch", "twitch-chat");
1062
749
  const kindMatch = /^(user|dm|channel|group|conversation|room):/i.exec(providerTarget);
@@ -1065,13 +752,6 @@ function normalizeTwitchMessagingTarget(target) {
1065
752
  const channelTarget = kindMatch ? providerTarget.slice(kindMatch[0].length) : providerTarget;
1066
753
  return normalizeTwitchChannel(channelTarget);
1067
754
  }
1068
- /**
1069
- * Twitch channel plugin.
1070
- *
1071
- * Implements the ChannelPlugin interface to provide Twitch chat integration
1072
- * for OpenClaw. Supports message sending, receiving, access control, and
1073
- * status monitoring.
1074
- */
1075
755
  const twitchPlugin = createChatChannelPlugin({
1076
756
  pairing: {
1077
757
  idLabel: "twitchUserId",
@@ -1157,10 +837,9 @@ const twitchPlugin = createChatChannelPlugin({
1157
837
  probeAccount: async ({ account, timeoutMs }) => await probeTwitch(account, timeoutMs),
1158
838
  collectStatusIssues: collectTwitchStatusIssues,
1159
839
  resolveAccountSnapshot: ({ account, cfg }) => {
1160
- const resolvedAccountId = account.accountId || resolveTwitchSnapshotAccountId(cfg, account);
1161
- const { configured } = resolveTwitchAccountContext(cfg, resolvedAccountId);
840
+ const { configured } = resolveTwitchAccountContext(cfg, account.accountId);
1162
841
  return {
1163
- accountId: resolvedAccountId,
842
+ accountId: account.accountId,
1164
843
  enabled: account.enabled !== false,
1165
844
  configured
1166
845
  };
@@ -1187,7 +866,7 @@ const twitchPlugin = createChatChannelPlugin({
1187
866
  await runPassiveAccountLifecycle({
1188
867
  abortSignal: ctx.abortSignal,
1189
868
  start: async () => {
1190
- const { monitorTwitchProvider } = await import("./monitor-qX6EbrLJ.mjs");
869
+ const { monitorTwitchProvider } = await import("./monitor-CnvhK43s.mjs");
1191
870
  return monitorTwitchProvider({
1192
871
  account,
1193
872
  accountId,
@@ -1,3 +1,3 @@
1
- import { t as twitchSetupPlugin } from "./setup-surface-D_5uHrDU.mjs";
1
+ import { t as twitchSetupPlugin } from "./setup-surface-KNOOeRU6.mjs";
2
2
  import "../setup-plugin-api.js";
3
3
  export { twitchSetupPlugin };
@@ -7,39 +7,12 @@ import { defineChannelSetupContract } from "openclaw/plugin-sdk/channel-setup";
7
7
  import { getChatChannelMeta } from "openclaw/plugin-sdk/core";
8
8
  import { createSetupTranslator, formatDocsLink, normalizeAccountId as normalizeAccountId$1, patchTopLevelChannelConfigSection, setSetupChannelEnabled } from "openclaw/plugin-sdk/setup";
9
9
  //#region extensions/twitch/src/token.ts
10
- /**
11
- * Twitch access token resolution with environment variable support.
12
- *
13
- * Supports reading Twitch OAuth access tokens from config or environment variable.
14
- * The OPENCLAW_TWITCH_ACCESS_TOKEN env var is only used for the default account.
15
- *
16
- * Token resolution priority:
17
- * 1. Account access token from merged config (accounts.{id} or base-level for default)
18
- * 2. Environment variable: OPENCLAW_TWITCH_ACCESS_TOKEN (default account only)
19
- */
20
- /**
21
- * Normalize a Twitch OAuth token - ensure it has the oauth: prefix
22
- */
23
10
  function normalizeTwitchToken(raw) {
24
11
  if (!raw) return;
25
12
  const trimmed = raw.trim();
26
13
  if (!trimmed) return;
27
14
  return trimmed.startsWith("oauth:") ? trimmed : `oauth:${trimmed}`;
28
15
  }
29
- /**
30
- * Resolve Twitch access token from config or environment variable.
31
- *
32
- * Priority:
33
- * 1. Account access token (from merged config - base-level for default, or accounts.{accountId})
34
- * 2. Environment variable: OPENCLAW_TWITCH_ACCESS_TOKEN (default account only)
35
- *
36
- * The getAccountConfig function handles merging base-level config with accounts.default,
37
- * so this logic works for both simplified and multi-account patterns.
38
- *
39
- * @param cfg - OpenClaw config
40
- * @param opts - Options including accountId and optional envToken override
41
- * @returns Token resolution with source
42
- */
43
16
  function resolveTwitchToken(cfg, opts = {}) {
44
17
  const accountId = normalizeAccountId(opts.accountId);
45
18
  const twitchCfg = cfg?.channels?.twitch;
@@ -64,60 +37,16 @@ function resolveTwitchToken(cfg, opts = {}) {
64
37
  }
65
38
  //#endregion
66
39
  //#region extensions/twitch/src/utils/twitch.ts
67
- /**
68
- * Twitch-specific utility functions
69
- */
70
- /**
71
- * Normalize Twitch channel names.
72
- *
73
- * Removes the '#' prefix if present, converts to lowercase, and trims whitespace.
74
- * Twitch channel names are case-insensitive and don't use the '#' prefix in the API.
75
- *
76
- * @param channel - The channel name to normalize
77
- * @returns Normalized channel name
78
- *
79
- * @example
80
- * normalizeTwitchChannel("#TwitchChannel") // "twitchchannel"
81
- * normalizeTwitchChannel("MyChannel") // "mychannel"
82
- */
83
40
  function normalizeTwitchChannel(channel) {
84
41
  const trimmed = normalizeLowercaseStringOrEmpty(channel);
85
42
  return trimmed.startsWith("#") ? trimmed.slice(1) : trimmed;
86
43
  }
87
- /**
88
- * Create a standardized error message for missing target.
89
- *
90
- * @param provider - The provider name (e.g., "Twitch")
91
- * @param hint - Optional hint for how to fix the issue
92
- * @returns Error object with descriptive message
93
- */
94
- function missingTargetError(provider, hint) {
95
- return /* @__PURE__ */ new Error(`Delivering to ${provider} requires target${hint ? ` ${hint}` : ""}`);
96
- }
97
- /**
98
- * Normalize OAuth token by removing the "oauth:" prefix if present.
99
- *
100
- * Twurple doesn't require the "oauth:" prefix, so we strip it for consistency.
101
- *
102
- * @param token - The OAuth token to normalize
103
- * @returns Normalized token without "oauth:" prefix
104
- *
105
- * @example
106
- * normalizeToken("oauth:abc123") // "abc123"
107
- * normalizeToken("abc123") // "abc123"
108
- */
109
44
  function normalizeToken(token) {
110
45
  return token.startsWith("oauth:") ? token.slice(6) : token;
111
46
  }
112
- /**
113
- * Check if an account is properly configured with required credentials.
114
- *
115
- * @param account - The Twitch account config to check
116
- * @returns true if the account has required credentials
117
- */
118
47
  function isAccountConfigured(account, resolvedToken) {
119
- const token = resolvedToken ?? account?.accessToken;
120
- return Boolean(account?.username && token && account?.clientId);
48
+ const token = resolvedToken ?? account.accessToken;
49
+ return Boolean(account.username && token && account.clientId);
121
50
  }
122
51
  //#endregion
123
52
  //#region extensions/twitch/src/config.ts
@@ -130,14 +59,8 @@ const { listAccountIds, resolveDefaultAccountId: resolveDefaultTwitchAccountId }
130
59
  }
131
60
  });
132
61
  /**
133
- * Get account config from core config
134
- *
135
- * Handles two patterns:
136
- * 1. Simplified single-account: base-level properties create implicit "default" account
137
- * 2. Multi-account: explicit accounts object
138
- *
139
- * For "default" account, base-level properties take precedence over accounts.default
140
- * For other accounts, only the accounts object is checked
62
+ * Root credentials take precedence for the implicit default account; named
63
+ * accounts only read their own account entry.
141
64
  */
142
65
  function getAccountConfig(coreConfig, accountId) {
143
66
  if (!coreConfig || typeof coreConfig !== "object") return null;
@@ -166,12 +89,9 @@ function getAccountConfig(coreConfig, accountId) {
166
89
  ...baseLevel
167
90
  };
168
91
  if (merged.username) return merged;
169
- if (accountFromAccounts) return accountFromAccounts;
170
- return null;
92
+ return accountFromAccounts || null;
171
93
  }
172
- const account = resolveNormalizedAccountEntry(accounts, normalizedAccountId, normalizeAccountId);
173
- if (!account) return null;
174
- return account;
94
+ return resolveNormalizedAccountEntry(accounts, normalizedAccountId, normalizeAccountId) || null;
175
95
  }
176
96
  function resolveTwitchAccountContext(cfg, accountId) {
177
97
  const resolvedAccountId = accountId?.trim() ? normalizeAccountId(accountId) : resolveDefaultTwitchAccountId(cfg);
@@ -210,18 +130,16 @@ const twitchConfigAdapter = {
210
130
  isConfigured: (account, cfg) => resolveTwitchAccountContext(cfg, account.accountId).configured,
211
131
  isEnabled: (account) => account?.enabled !== false
212
132
  };
213
- function resolveTwitchSnapshotAccountId(cfg, account) {
214
- const accountMap = (cfg.channels?.twitch)?.accounts ?? {};
215
- return Object.entries(accountMap).find(([, value]) => value === account)?.[0] ?? DEFAULT_ACCOUNT_ID$1;
216
- }
217
133
  //#endregion
218
134
  //#region extensions/twitch/src/setup-surface.ts
219
- /**
220
- * Twitch setup wizard surface for CLI setup.
221
- */
222
135
  const channel = "twitch";
223
136
  const t = createSetupTranslator();
224
137
  const INVALID_ACCOUNT_ID_MESSAGE = "Invalid Twitch account id";
138
+ const requiredAccountPrompts = {
139
+ username: "wizard.twitch.botUsernamePrompt",
140
+ clientId: "wizard.twitch.clientIdPrompt",
141
+ channel: "wizard.twitch.channelJoinPrompt"
142
+ };
225
143
  function normalizeRequestedSetupAccountId(accountId) {
226
144
  const normalized = normalizeOptionalAccountId(accountId);
227
145
  if (!normalized) throw new Error(INVALID_ACCOUNT_ID_MESSAGE);
@@ -234,7 +152,7 @@ function resolveSetupAccountId(cfg, requestedAccountId) {
234
152
  return preferred ? normalizeAccountId$1(preferred) : resolveDefaultTwitchAccountId(cfg);
235
153
  }
236
154
  function setTwitchAccount(cfg, account, accountId = resolveSetupAccountId(cfg)) {
237
- const resolvedAccountId = accountId.trim() ? normalizeRequestedSetupAccountId(accountId) : resolveSetupAccountId(cfg);
155
+ const resolvedAccountId = resolveSetupAccountId(cfg, accountId.trim());
238
156
  const existing = getAccountConfig(cfg, resolvedAccountId);
239
157
  const merged = {
240
158
  username: account.username ?? existing?.username ?? "",
@@ -289,22 +207,13 @@ async function promptToken(prompter, account) {
289
207
  }
290
208
  })).trim();
291
209
  }
292
- async function promptRequiredTwitchAccountValue(prompter, message, initialValue) {
210
+ async function promptRequiredTwitchAccountValue(prompter, account, key) {
293
211
  return (await prompter.text({
294
- message,
295
- initialValue: initialValue ?? "",
212
+ message: t(requiredAccountPrompts[key]),
213
+ initialValue: account?.[key] ?? "",
296
214
  validate: (value) => value?.trim() ? void 0 : "Required"
297
215
  })).trim();
298
216
  }
299
- async function promptUsername(prompter, account) {
300
- return await promptRequiredTwitchAccountValue(prompter, t("wizard.twitch.botUsernamePrompt"), account?.username);
301
- }
302
- async function promptClientId(prompter, account) {
303
- return await promptRequiredTwitchAccountValue(prompter, t("wizard.twitch.clientIdPrompt"), account?.clientId);
304
- }
305
- async function promptChannelName(prompter, account) {
306
- return await promptRequiredTwitchAccountValue(prompter, t("wizard.twitch.channelJoinPrompt"), account?.channel);
307
- }
308
217
  async function promptRefreshCredential(params) {
309
218
  const existingValue = params.existingValue?.trim();
310
219
  if (existingValue) {
@@ -340,15 +249,15 @@ async function promptRefreshTokenSetup(prompter, account) {
340
249
  };
341
250
  }
342
251
  async function configureWithEnvToken(cfg, prompter, account, envToken, forceAllowFrom, dmPolicy, accountId = resolveSetupAccountId(cfg)) {
343
- const resolvedAccountId = accountId.trim() ? normalizeRequestedSetupAccountId(accountId) : resolveSetupAccountId(cfg);
252
+ const resolvedAccountId = resolveSetupAccountId(cfg, accountId.trim());
344
253
  if (resolvedAccountId !== DEFAULT_ACCOUNT_ID$1) return null;
345
254
  if (!await prompter.confirm({
346
255
  message: t("wizard.twitch.envPrompt"),
347
256
  initialValue: true
348
257
  })) return null;
349
258
  const cfgWithAccount = setTwitchAccount(cfg, {
350
- username: await promptUsername(prompter, account),
351
- clientId: await promptClientId(prompter, account),
259
+ username: await promptRequiredTwitchAccountValue(prompter, account, "username"),
260
+ clientId: await promptRequiredTwitchAccountValue(prompter, account, "clientId"),
352
261
  accessToken: envToken,
353
262
  enabled: true
354
263
  }, resolvedAccountId);
@@ -371,12 +280,43 @@ function setTwitchAccessControl(cfg, allowedRoles, requireMention, accountId) {
371
280
  }
372
281
  function resolveTwitchGroupPolicy(cfg, accountId) {
373
282
  const account = getAccountConfig(cfg, resolveSetupAccountId(cfg, accountId));
374
- if (account?.allowedRoles?.includes("all")) return "open";
375
- if (account?.allowedRoles?.includes("moderator")) return "allowlist";
376
- return "disabled";
283
+ if (!account) return "disabled";
284
+ if (account.allowFrom !== void 0) return account.allowFrom.length > 0 ? "allowlist" : "disabled";
285
+ if (account.allowedRoles?.length) return account.allowedRoles.includes("all") ? "open" : "allowlist";
286
+ return "open";
377
287
  }
378
288
  function setTwitchGroupPolicy(cfg, policy, accountId) {
379
- return setTwitchAccessControl(cfg, policy === "open" ? ["all"] : policy === "allowlist" ? ["moderator", "vip"] : [], true, accountId);
289
+ const resolvedAccountId = resolveSetupAccountId(cfg, accountId);
290
+ const account = getAccountConfig(cfg, resolvedAccountId);
291
+ if (!account) return cfg;
292
+ const patch = {
293
+ allowedRoles: policy === "open" ? ["all"] : policy === "allowlist" ? ["moderator", "vip"] : [],
294
+ requireMention: true
295
+ };
296
+ if (policy === "disabled") patch.allowFrom = [];
297
+ else if (policy === "allowlist" && account.allowFrom?.length) patch.allowFrom = account.allowFrom;
298
+ const twitch = cfg.channels?.twitch;
299
+ if (resolvedAccountId === DEFAULT_ACCOUNT_ID$1 && typeof twitch?.username === "string" && twitch.username) return patchTopLevelChannelConfigSection({
300
+ cfg,
301
+ channel,
302
+ enabled: true,
303
+ clearFields: patch.allowFrom === void 0 ? ["allowFrom"] : void 0,
304
+ patch
305
+ });
306
+ const nextAccount = {
307
+ ...account,
308
+ ...patch
309
+ };
310
+ if (patch.allowFrom === void 0) delete nextAccount.allowFrom;
311
+ return patchTopLevelChannelConfigSection({
312
+ cfg,
313
+ channel,
314
+ enabled: true,
315
+ patch: { accounts: {
316
+ ...twitch?.accounts,
317
+ [resolvedAccountId]: nextAccount
318
+ } }
319
+ });
380
320
  }
381
321
  const twitchDmPolicy = createChannelDmPolicy({
382
322
  label: "Twitch",
@@ -430,7 +370,7 @@ const twitchGroupAccess = {
430
370
  },
431
371
  updatePrompt: ({ cfg, accountId }) => {
432
372
  const account = getAccountConfig(cfg, resolveSetupAccountId(cfg, accountId));
433
- return Boolean(account?.allowedRoles?.length || account?.allowFrom?.length);
373
+ return Boolean(account?.allowedRoles?.length || account?.allowFrom !== void 0);
434
374
  },
435
375
  setPolicy: ({ cfg, accountId, policy }) => setTwitchGroupPolicy(cfg, policy, accountId),
436
376
  resolveAllowlist: async () => [],
@@ -472,10 +412,10 @@ const twitchSetupWizard = {
472
412
  const envResult = await configureWithEnvToken(cfg, prompter, account, envToken, forceAllowFrom, twitchDmPolicy, accountId);
473
413
  if (envResult) return envResult;
474
414
  }
475
- const username = await promptUsername(prompter, account);
415
+ const username = await promptRequiredTwitchAccountValue(prompter, account, "username");
476
416
  const token = await promptToken(prompter, account);
477
- const clientId = await promptClientId(prompter, account);
478
- const channelName = await promptChannelName(prompter, account);
417
+ const clientId = await promptRequiredTwitchAccountValue(prompter, account, "clientId");
418
+ const channelName = await promptRequiredTwitchAccountValue(prompter, account, "channel");
479
419
  const { clientSecret, refreshToken } = await promptRefreshTokenSetup(prompter, account);
480
420
  const cfgWithAccount = setTwitchAccount(cfg, {
481
421
  username,
@@ -506,4 +446,4 @@ const twitchSetupPlugin = {
506
446
  setupWizard: twitchSetupWizard
507
447
  };
508
448
  //#endregion
509
- export { resolveTwitchAccountContext as a, isAccountConfigured as c, normalizeTwitchChannel as d, resolveTwitchToken as f, resolveDefaultTwitchAccountId as i, missingTargetError as l, DEFAULT_ACCOUNT_ID$1 as n, resolveTwitchSnapshotAccountId as o, getAccountConfig as r, twitchConfigAdapter as s, twitchSetupPlugin as t, normalizeToken as u };
449
+ export { resolveTwitchAccountContext as a, normalizeToken as c, resolveDefaultTwitchAccountId as i, normalizeTwitchChannel as l, DEFAULT_ACCOUNT_ID$1 as n, twitchConfigAdapter as o, getAccountConfig as r, isAccountConfigured as s, twitchSetupPlugin as t, resolveTwitchToken as u };
package/dist/api.js CHANGED
@@ -1,3 +1,3 @@
1
- import { t as twitchPlugin } from "./.setup/plugin-CqPt4cYf.mjs";
1
+ import { t as twitchPlugin } from "./.setup/plugin-BbtWQOSW.mjs";
2
2
  import { n as setTwitchRuntime } from "./.setup/runtime-B5If4b0g.mjs";
3
3
  export { setTwitchRuntime, twitchPlugin };
@@ -1,2 +1,2 @@
1
- import { t as twitchPlugin } from "./.setup/plugin-CqPt4cYf.mjs";
1
+ import { t as twitchPlugin } from "./.setup/plugin-BbtWQOSW.mjs";
2
2
  export { twitchPlugin };
@@ -4,7 +4,7 @@ import { fileURLToPath } from "node:url";
4
4
  var setup_entry_default = defineBundledChannelSetupEntry({
5
5
  importMetaUrl: import.meta.url,
6
6
  plugin: {
7
- specifier: fileURLToPath(new URL(".setup/setup-plugin-api-CWMOjn6G.mjs", import.meta.url).href),
7
+ specifier: fileURLToPath(new URL(".setup/setup-plugin-api-B1c86Vpi.mjs", import.meta.url).href),
8
8
  exportName: "twitchSetupPlugin"
9
9
  }
10
10
  });
@@ -1,2 +1,2 @@
1
- import { t as twitchSetupPlugin } from "./.setup/setup-surface-D_5uHrDU.mjs";
1
+ import { t as twitchSetupPlugin } from "./.setup/setup-surface-KNOOeRU6.mjs";
2
2
  export { twitchSetupPlugin };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/twitch",
3
- "version": "2026.9.6",
3
+ "version": "2026.9.7",
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.9.6"
34
+ "pluginApi": ">=2026.9.7"
35
35
  },
36
36
  "build": {
37
- "openclawVersion": "2026.9.6"
37
+ "openclawVersion": "2026.9.7"
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.9.6"
77
+ "openclaw": ">=2026.9.7"
78
78
  },
79
79
  "peerDependenciesMeta": {
80
80
  "openclaw": {