@openclaw/irc 2026.9.1 → 2026.9.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 CHANGED
@@ -1,3 +1,3 @@
1
- import { _ as listIrcAccountIds, g as listEnabledIrcAccounts, n as ircSetupWizard, r as ircSetupAdapter, t as ircPlugin, v as resolveDefaultIrcAccountId, y as resolveIrcAccount } from "./channel-BVYDQ8Fk.js";
1
+ import { _ as listIrcAccountIds, g as listEnabledIrcAccounts, n as ircSetupWizard, r as ircSetupAdapter, t as ircPlugin, v as resolveDefaultIrcAccountId, y as resolveIrcAccount } from "./channel-C0XrtiC0.js";
2
2
  import { n as setIrcRuntime } from "./runtime-xy-FcjJC.js";
3
3
  export { ircPlugin, ircSetupAdapter, ircSetupWizard, listEnabledIrcAccounts, listIrcAccountIds, resolveDefaultIrcAccountId, resolveIrcAccount, setIrcRuntime };
@@ -202,7 +202,7 @@ const collectIrcMutableAllowlistWarnings = createDangerousNameMatchingMutableAll
202
202
  });
203
203
  //#endregion
204
204
  //#region extensions/irc/src/gateway.ts
205
- const loadIrcChannelRuntime$1 = createLazyRuntimeModule(() => import("./channel-runtime-Ywcn0k9_.js"));
205
+ const loadIrcChannelRuntime$1 = createLazyRuntimeModule(() => import("./channel-runtime-Bhm49qnu.js"));
206
206
  async function startIrcGatewayAccount(ctx) {
207
207
  const account = ctx.account;
208
208
  const statusSink = createAccountStatusSink({
@@ -815,35 +815,27 @@ function recordIrcOutboundActivity(accountId) {
815
815
  if (!(error instanceof Error) || error.message !== "IRC runtime not initialized") throw error;
816
816
  }
817
817
  }
818
- function resolveTarget(to, opts) {
819
- const fromArg = normalizeIrcMessagingTarget(to);
820
- if (fromArg) return fromArg;
821
- const fromOpt = normalizeIrcMessagingTarget(opts?.target ?? "");
822
- if (fromOpt) return fromOpt;
823
- throw new Error(`Invalid IRC target: ${to}`);
824
- }
825
- async function sendIrcMessages(to, messages, opts, onDeliveryResult) {
818
+ async function sendIrcMessages(to, text, opts, planMessages = (preparedText) => [{
819
+ text: preparedText,
820
+ replyTo: opts.replyTo
821
+ }], onDeliveryResult) {
826
822
  const cfg = requireRuntimeConfig(opts.cfg, "IRC send");
827
823
  const account = resolveIrcAccount({
828
824
  cfg,
829
825
  accountId: opts.accountId
830
826
  });
831
827
  if (!account.configured) throw new Error(`IRC is not configured for account "${account.accountId}" (need host and nick in channels.irc).`);
832
- const target = resolveTarget(to, opts);
828
+ const target = normalizeIrcMessagingTarget(to);
829
+ if (!target) throw new Error(`Invalid IRC target: ${to}`);
833
830
  const tableMode = resolveMarkdownTableMode({
834
831
  cfg,
835
832
  channel: "irc",
836
833
  accountId: account.accountId
837
834
  });
838
- const preparedMessages = messages.map((message) => {
839
- const prepared = stripMarkdown(convertMarkdownTables(message.text.trim(), tableMode));
840
- if (!prepared.trim()) throw new Error("Message must be non-empty for IRC sends");
841
- return {
842
- payload: message.replyTo ? `${prepared}\n\n[reply:${message.replyTo}]` : prepared,
843
- replyTo: message.replyTo
844
- };
845
- });
846
- if (preparedMessages.length === 0) return [];
835
+ if (!text) return [];
836
+ const prepared = stripMarkdown(convertMarkdownTables(text.trim(), tableMode));
837
+ if (!prepared.trim()) throw new Error("Message must be non-empty for IRC sends");
838
+ const messages = planMessages(prepared);
847
839
  opts.abortSignal?.throwIfAborted();
848
840
  let transient;
849
841
  const client = opts.client?.isReady() ? opts.client : transient = await connectIrcClient(buildIrcConnectOptions(account, {
@@ -854,13 +846,13 @@ async function sendIrcMessages(to, messages, opts, onDeliveryResult) {
854
846
  try {
855
847
  opts.abortSignal?.throwIfAborted();
856
848
  if (transient && (target.startsWith("#") || target.startsWith("&"))) client.join(target);
857
- for (const message of preparedMessages) {
849
+ for (const message of messages) {
858
850
  opts.abortSignal?.throwIfAborted();
859
851
  if (!client.isReady()) throw new Error("IRC connection closed before send");
860
852
  await opts.onPlatformSendDispatch?.();
861
853
  opts.abortSignal?.throwIfAborted();
862
854
  if (!client.isReady()) throw new Error("IRC connection closed before send");
863
- client.sendPrivmsg(target, message.payload);
855
+ client.sendPrivmsg(target, message.replyTo ? `${message.text}\n\n[reply:${message.replyTo}]` : message.text);
864
856
  recordIrcOutboundActivity(account.accountId);
865
857
  const messageId = makeIrcMessageId();
866
858
  const result = {
@@ -885,10 +877,7 @@ async function sendIrcMessages(to, messages, opts, onDeliveryResult) {
885
877
  }
886
878
  }
887
879
  async function sendMessageIrc(to, text, opts) {
888
- const result = (await sendIrcMessages(to, [{
889
- text,
890
- ...opts.replyTo ? { replyTo: opts.replyTo } : {}
891
- }], opts))[0];
880
+ const result = (await sendIrcMessages(to, text, opts))[0];
892
881
  if (!result) throw new Error("Message must be non-empty for IRC sends");
893
882
  return result;
894
883
  }
@@ -903,37 +892,30 @@ function toIrcMessageResult({ target, ...result }) {
903
892
  }
904
893
  };
905
894
  }
906
- async function sendIrcMessage(...args) {
907
- return toIrcMessageResult(await sendMessageIrc(...args));
895
+ async function sendIrcMessage(ctx, text = ctx.text) {
896
+ return toIrcMessageResult(await sendMessageIrc(ctx.to, text, {
897
+ cfg: ctx.cfg,
898
+ accountId: ctx.accountId ?? void 0,
899
+ replyTo: ctx.replyToId ?? void 0,
900
+ abortSignal: ctx.signal,
901
+ onPlatformSendDispatch: ctx.onPlatformSendDispatch
902
+ }));
908
903
  }
909
904
  const sendFormattedIrcText = async (ctx) => {
910
- const { chunkMarkdownTextWithMode, resolveChunkMode, resolveTextChunkLimit } = await import("openclaw/plugin-sdk/reply-chunking");
905
+ const { chunkTextWithMode, resolveChunkMode, resolveTextChunkLimit } = await import("openclaw/plugin-sdk/reply-chunking");
911
906
  const accountId = ctx.accountId ?? void 0;
912
907
  const textLimit = ctx.formatting?.textLimit ?? resolveTextChunkLimit(ctx.cfg, "irc", accountId, { fallbackLimit: ircOutboundBaseAdapter.textChunkLimit });
913
908
  const chunkMode = ctx.formatting?.chunkMode ?? resolveChunkMode(ctx.cfg, "irc", accountId);
914
- const chunkText = (text) => ctx.formatting ? ircOutboundBaseAdapter.chunker(text, textLimit, { formatting: ctx.formatting }) : ircOutboundBaseAdapter.chunker(text, textLimit);
915
- let chunks;
916
- if (chunkMode === "newline") {
917
- const blocks = chunkMarkdownTextWithMode(ctx.text, textLimit, chunkMode);
918
- if (blocks.length === 0 && ctx.text) blocks.push(ctx.text);
919
- chunks = blocks.flatMap((block) => {
920
- const blockChunks = chunkText(block);
921
- return blockChunks.length === 0 && block ? [block] : blockChunks;
922
- });
923
- } else chunks = chunkText(ctx.text);
924
909
  const nextReplyToId = createReplyToFanout(ctx);
925
- return (await sendIrcMessages(ctx.to, chunks.map((text) => {
926
- const replyTo = nextReplyToId();
927
- return replyTo ? {
928
- text,
929
- replyTo
930
- } : { text };
931
- }), {
910
+ return (await sendIrcMessages(ctx.to, ctx.text, {
932
911
  cfg: ctx.cfg,
933
912
  accountId,
934
913
  abortSignal: ctx.abortSignal,
935
914
  onPlatformSendDispatch: ctx.onPlatformSendDispatch
936
- }, async (result) => {
915
+ }, (preparedText) => chunkTextWithMode(preparedText, textLimit, chunkMode).map((text) => ({
916
+ text,
917
+ replyTo: nextReplyToId()
918
+ })), async (result) => {
937
919
  await ctx.onDeliveryResult?.(attachChannelToResult("irc", toIrcMessageResult(result)));
938
920
  })).map((result) => attachChannelToResult("irc", toIrcMessageResult(result)));
939
921
  };
@@ -945,16 +927,8 @@ const ircMessageAdapter = defineChannelMessageAdapter({
945
927
  replyTo: true
946
928
  } },
947
929
  send: {
948
- text: async ({ cfg, to, text, accountId, replyToId }) => await sendIrcMessage(to, text, {
949
- cfg,
950
- accountId: accountId ?? void 0,
951
- replyTo: replyToId ?? void 0
952
- }),
953
- media: async ({ cfg, to, text, mediaUrl, accountId, replyToId }) => await sendIrcMessage(to, mediaUrl ? `${text}\n\nAttachment: ${mediaUrl}` : text, {
954
- cfg,
955
- accountId: accountId ?? void 0,
956
- replyTo: replyToId ?? void 0
957
- })
930
+ text: sendIrcMessage,
931
+ media: (ctx) => sendIrcMessage(ctx, ctx.mediaUrl ? `${ctx.text}\n\nAttachment: ${ctx.mediaUrl}` : ctx.text)
958
932
  }
959
933
  });
960
934
  //#endregion
@@ -1570,7 +1544,7 @@ const meta = {
1570
1544
  systemImage: "number",
1571
1545
  markdownCapable: true
1572
1546
  };
1573
- const loadIrcChannelRuntime = createLazyRuntimeModule(() => import("./channel-runtime-Ywcn0k9_.js"));
1547
+ const loadIrcChannelRuntime = createLazyRuntimeModule(() => import("./channel-runtime-Bhm49qnu.js"));
1574
1548
  function normalizePairingTarget(raw) {
1575
1549
  const normalized = normalizeIrcAllowEntry(raw);
1576
1550
  if (!normalized) return "";
@@ -1662,7 +1636,10 @@ const ircPlugin = createChatChannelPlugin({
1662
1636
  media: true,
1663
1637
  blockStreaming: true
1664
1638
  },
1665
- reload: { configPrefixes: ["channels.irc"] },
1639
+ reload: {
1640
+ configPrefixes: ["channels.irc"],
1641
+ accountScopedRestart: true
1642
+ },
1666
1643
  configSchema: IrcChannelConfigSchema,
1667
1644
  config: {
1668
1645
  ...ircConfigAdapter,
@@ -1,2 +1,2 @@
1
- import { t as ircPlugin } from "./channel-BVYDQ8Fk.js";
1
+ import { t as ircPlugin } from "./channel-C0XrtiC0.js";
2
2
  export { ircPlugin };
@@ -1,4 +1,4 @@
1
- import { a as resolveIrcGroupRequireMention, c as connectIrcClient, d as sanitizeIrcAssistantText, f as createIrcIngressSubject, h as normalizeIrcAllowEntry, i as resolveIrcGroupMatch, l as parseIrcLine, m as isChannelTarget, o as sendMessageIrc, p as ircIngressIdentity, s as buildIrcConnectOptions, u as parseIrcPrefix, y as resolveIrcAccount } from "./channel-BVYDQ8Fk.js";
1
+ import { a as resolveIrcGroupRequireMention, c as connectIrcClient, d as sanitizeIrcAssistantText, f as createIrcIngressSubject, h as normalizeIrcAllowEntry, i as resolveIrcGroupMatch, l as parseIrcLine, m as isChannelTarget, o as sendMessageIrc, p as ircIngressIdentity, s as buildIrcConnectOptions, u as parseIrcPrefix, y as resolveIrcAccount } from "./channel-C0XrtiC0.js";
2
2
  import { t as getIrcRuntime } from "./runtime-xy-FcjJC.js";
3
3
  import { channelIngressRoutes, createChannelIngressResolver } from "openclaw/plugin-sdk/channel-ingress-runtime";
4
4
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
@@ -1,5 +1,7 @@
1
1
  {
2
2
  "id": "irc",
3
+ "name": "IRC",
4
+ "description": "OpenClaw IRC channel plugin.",
3
5
  "doctorContract": {
4
6
  "configRepair": true
5
7
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/irc",
3
- "version": "2026.9.1",
3
+ "version": "2026.9.2",
4
4
  "description": "OpenClaw IRC channel plugin",
5
5
  "type": "module",
6
6
  "openclaw": {
@@ -121,10 +121,10 @@
121
121
  }
122
122
  },
123
123
  "compat": {
124
- "pluginApi": ">=2026.9.1"
124
+ "pluginApi": ">=2026.9.2"
125
125
  },
126
126
  "build": {
127
- "openclawVersion": "2026.9.1",
127
+ "openclawVersion": "2026.9.2",
128
128
  "bundledDist": false
129
129
  },
130
130
  "release": {
@@ -149,7 +149,7 @@
149
149
  "README.md"
150
150
  ],
151
151
  "peerDependencies": {
152
- "openclaw": ">=2026.9.1"
152
+ "openclaw": ">=2026.9.2"
153
153
  },
154
154
  "peerDependenciesMeta": {
155
155
  "openclaw": {