@openclaw/irc 2026.7.2-beta.1 → 2026.7.2-beta.3
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 +2 -2
- package/dist/{channel-DVkIYl85.js → channel-BC0q2_Tg.js} +55 -48
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel-runtime-DQUHlrj4.js → channel-runtime-DBNGrI_Y.js} +53 -37
- package/dist/{config-schema-nFnbvojz.js → config-schema-BPoye3--.js} +14 -33
- package/dist/runtime-api.js +1 -1
- package/dist/{runtime-DZfYm3vY.js → runtime-xy-FcjJC.js} +1 -1
- package/dist/{secret-contract-PJHaoTSe.js → secret-contract-D_DC3YWj.js} +1 -0
- package/dist/secret-contract-api.js +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +5 -7
- package/dist/configured-state.js +0 -6
package/dist/api.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { g as resolveIrcAccount, h as resolveDefaultIrcAccountId, m as listIrcAccountIds, n as ircSetupWizard, p as listEnabledIrcAccounts, r as ircSetupAdapter, t as ircPlugin } from "./channel-
|
|
2
|
-
import { n as setIrcRuntime } from "./runtime-
|
|
1
|
+
import { g as resolveIrcAccount, h as resolveDefaultIrcAccountId, m as listIrcAccountIds, n as ircSetupWizard, p as listEnabledIrcAccounts, r as ircSetupAdapter, t as ircPlugin } from "./channel-BC0q2_Tg.js";
|
|
2
|
+
import { n as setIrcRuntime } from "./runtime-xy-FcjJC.js";
|
|
3
3
|
export { ircPlugin, ircSetupAdapter, ircSetupWizard, listEnabledIrcAccounts, listIrcAccountIds, resolveDefaultIrcAccountId, resolveIrcAccount, setIrcRuntime };
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { t as IrcChannelConfigSchema } from "./config-schema-
|
|
2
|
-
import { t as getIrcRuntime } from "./runtime-
|
|
3
|
-
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-
|
|
1
|
+
import { t as IrcChannelConfigSchema } from "./config-schema-BPoye3--.js";
|
|
2
|
+
import { t as getIrcRuntime } from "./runtime-xy-FcjJC.js";
|
|
3
|
+
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-D_DC3YWj.js";
|
|
4
4
|
import { createAccountListHelpers, describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
|
|
5
5
|
import { formatNormalizedAllowFromEntries } from "openclaw/plugin-sdk/allow-from";
|
|
6
6
|
import { adaptScopedAccountAccessor, createScopedChannelConfigAdapter, createScopedDmSecurityResolver } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
7
|
-
import { buildChannelOutboundSessionRoute, createChatChannelPlugin, parseOptionalDelimitedEntries
|
|
8
|
-
import { composeAccountWarningCollectors, createAllowlistProviderOpenWarningCollector, createDangerousNameMatchingMutableAllowlistWarningCollector, resolveScopeKeyCaseInsensitive, resolveScopeRequireMention, resolveScopeToolsPolicy } from "openclaw/plugin-sdk/channel-policy";
|
|
7
|
+
import { buildChannelOutboundSessionRoute, createChatChannelPlugin, parseOptionalDelimitedEntries } from "openclaw/plugin-sdk/channel-core";
|
|
8
|
+
import { buildMutableAllowEntryDetector, collectStandardAllowlistLists, composeAccountWarningCollectors, createAllowlistProviderOpenWarningCollector, createDangerousNameMatchingMutableAllowlistWarningCollector, resolveScopeKeyCaseInsensitive, resolveScopeRequireMention, resolveScopeToolsPolicy } from "openclaw/plugin-sdk/channel-policy";
|
|
9
9
|
import { createChannelDirectoryAdapter, createResolvedDirectoryEntriesLister } from "openclaw/plugin-sdk/directory-runtime";
|
|
10
10
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
11
11
|
import { buildBaseChannelStatusSummary, createComputedAccountStatusAdapter, createDefaultChannelRuntimeState } from "openclaw/plugin-sdk/status-helpers";
|
|
12
12
|
import { DEFAULT_ACCOUNT_ID, DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$2, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
13
13
|
import { resolveMergedAccountConfig } from "openclaw/plugin-sdk/account-resolution";
|
|
14
14
|
import { parseStrictPositiveInteger } from "openclaw/plugin-sdk/number-runtime";
|
|
15
|
+
import { tryReadSecretFileSync } from "openclaw/plugin-sdk/secret-file-runtime";
|
|
15
16
|
import { normalizeResolvedSecretInputString } from "openclaw/plugin-sdk/secret-input";
|
|
16
17
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, normalizeStringEntries, normalizeStringifiedOptionalString, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
17
18
|
import { createAccountStatusSink, createMessageReceiptFromOutboundResults, defineChannelMessageAdapter, sanitizeForPlainText } from "openclaw/plugin-sdk/channel-outbound";
|
|
@@ -66,11 +67,25 @@ function resolvePassword(accountId, merged) {
|
|
|
66
67
|
};
|
|
67
68
|
}
|
|
68
69
|
if (merged.passwordFile?.trim()) {
|
|
69
|
-
|
|
70
|
+
let diagnostic;
|
|
71
|
+
const filePassword = tryReadSecretFileSync(merged.passwordFile, "IRC password file", {
|
|
72
|
+
rejectSymlink: true,
|
|
73
|
+
credentialDiagnostic: {
|
|
74
|
+
configPath: `channels.irc.accounts.${accountId}.passwordFile`,
|
|
75
|
+
report: (value) => {
|
|
76
|
+
diagnostic = value;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
});
|
|
70
80
|
if (filePassword) return {
|
|
71
81
|
password: filePassword,
|
|
72
82
|
source: "passwordFile"
|
|
73
83
|
};
|
|
84
|
+
return {
|
|
85
|
+
password: "",
|
|
86
|
+
source: "passwordFile",
|
|
87
|
+
diagnostic
|
|
88
|
+
};
|
|
74
89
|
}
|
|
75
90
|
const configPassword = normalizeResolvedSecretInputString({
|
|
76
91
|
value: merged.password,
|
|
@@ -94,13 +109,25 @@ function resolveNickServConfig(accountId, nickserv) {
|
|
|
94
109
|
value: base.password,
|
|
95
110
|
path: `channels.irc.accounts.${accountId}.nickserv.password`
|
|
96
111
|
}) || envPassword || "";
|
|
97
|
-
|
|
112
|
+
let diagnostic;
|
|
113
|
+
if (!resolvedPassword && passwordFile) resolvedPassword = tryReadSecretFileSync(passwordFile, "IRC NickServ password file", {
|
|
114
|
+
rejectSymlink: true,
|
|
115
|
+
credentialDiagnostic: {
|
|
116
|
+
configPath: `channels.irc.accounts.${accountId}.nickserv.passwordFile`,
|
|
117
|
+
report: (value) => {
|
|
118
|
+
diagnostic = value;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}) ?? "";
|
|
98
122
|
return {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
123
|
+
config: {
|
|
124
|
+
...base,
|
|
125
|
+
service: normalizeOptionalString(base.service),
|
|
126
|
+
passwordFile: passwordFile || void 0,
|
|
127
|
+
password: resolvedPassword || void 0,
|
|
128
|
+
registerEmail: base.registerEmail?.trim() || envRegisterEmail || void 0
|
|
129
|
+
},
|
|
130
|
+
diagnostic
|
|
104
131
|
};
|
|
105
132
|
}
|
|
106
133
|
function resolveIrcAccount(params) {
|
|
@@ -119,7 +146,8 @@ function resolveIrcAccount(params) {
|
|
|
119
146
|
const username = (merged.username?.trim() || (accountId === DEFAULT_ACCOUNT_ID ? process.env.IRC_USERNAME?.trim() : "") || nick || "openclaw").trim();
|
|
120
147
|
const realname = (merged.realname?.trim() || (accountId === DEFAULT_ACCOUNT_ID ? process.env.IRC_REALNAME?.trim() : "") || "OpenClaw").trim();
|
|
121
148
|
const passwordResolution = resolvePassword(accountId, merged);
|
|
122
|
-
const
|
|
149
|
+
const nickservResolution = resolveNickServConfig(accountId, merged.nickserv);
|
|
150
|
+
const diagnostics = [passwordResolution.diagnostic, nickservResolution.diagnostic].filter((diagnostic) => Boolean(diagnostic));
|
|
123
151
|
const config = {
|
|
124
152
|
...merged,
|
|
125
153
|
channels: merged.channels ?? envChannels,
|
|
@@ -129,7 +157,7 @@ function resolveIrcAccount(params) {
|
|
|
129
157
|
nick,
|
|
130
158
|
username,
|
|
131
159
|
realname,
|
|
132
|
-
nickserv
|
|
160
|
+
nickserv: nickservResolution.config
|
|
133
161
|
};
|
|
134
162
|
return {
|
|
135
163
|
accountId,
|
|
@@ -144,6 +172,8 @@ function resolveIrcAccount(params) {
|
|
|
144
172
|
realname,
|
|
145
173
|
password: passwordResolution.password,
|
|
146
174
|
passwordSource: passwordResolution.source,
|
|
175
|
+
tokenStatus: diagnostics.length > 0 ? "configured_unavailable" : passwordResolution.password || nickservResolution.config.password ? "available" : "missing",
|
|
176
|
+
...diagnostics.length > 0 ? { credentialDiagnostics: diagnostics } : {},
|
|
147
177
|
config
|
|
148
178
|
};
|
|
149
179
|
};
|
|
@@ -162,42 +192,17 @@ function listEnabledIrcAccounts(cfg) {
|
|
|
162
192
|
accountId
|
|
163
193
|
})).filter((account) => account.enabled);
|
|
164
194
|
}
|
|
165
|
-
//#endregion
|
|
166
|
-
//#region extensions/irc/src/doctor.ts
|
|
167
|
-
function asObjectRecord(value) {
|
|
168
|
-
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
169
|
-
}
|
|
170
|
-
function isIrcMutableAllowEntry(raw) {
|
|
171
|
-
const text = normalizeLowercaseStringOrEmpty(raw);
|
|
172
|
-
if (!text || text === "*") return false;
|
|
173
|
-
return !text.replace(/^irc:/, "").replace(/^user:/, "").trim().includes("@");
|
|
174
|
-
}
|
|
175
195
|
const collectIrcMutableAllowlistWarnings = createDangerousNameMatchingMutableAllowlistWarningCollector({
|
|
176
196
|
channel: "irc",
|
|
177
|
-
detector:
|
|
178
|
-
collectLists: (scope) => {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
}, {
|
|
183
|
-
pathLabel: `${scope.prefix}.groupAllowFrom`,
|
|
184
|
-
list: scope.account.groupAllowFrom
|
|
185
|
-
}];
|
|
186
|
-
const groups = asObjectRecord(scope.account.groups);
|
|
187
|
-
if (groups) for (const [groupKey, groupRaw] of Object.entries(groups)) {
|
|
188
|
-
const group = asObjectRecord(groupRaw);
|
|
189
|
-
if (!group) continue;
|
|
190
|
-
lists.push({
|
|
191
|
-
pathLabel: `${scope.prefix}.groups.${groupKey}.allowFrom`,
|
|
192
|
-
list: group.allowFrom
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
|
-
return lists;
|
|
196
|
-
}
|
|
197
|
+
detector: buildMutableAllowEntryDetector({ stableIdPattern: /^(?:(?:irc|user):)*[^@]*@/i }),
|
|
198
|
+
collectLists: (scope) => collectStandardAllowlistLists(scope, {
|
|
199
|
+
includeGroups: true,
|
|
200
|
+
groupField: "allowFrom"
|
|
201
|
+
})
|
|
197
202
|
});
|
|
198
203
|
//#endregion
|
|
199
204
|
//#region extensions/irc/src/gateway.ts
|
|
200
|
-
const loadIrcChannelRuntime$1 = createLazyRuntimeModule(() => import("./channel-runtime-
|
|
205
|
+
const loadIrcChannelRuntime$1 = createLazyRuntimeModule(() => import("./channel-runtime-DBNGrI_Y.js"));
|
|
201
206
|
async function startIrcGatewayAccount(ctx) {
|
|
202
207
|
const account = ctx.account;
|
|
203
208
|
const statusSink = createAccountStatusSink({
|
|
@@ -1335,7 +1340,7 @@ const meta = {
|
|
|
1335
1340
|
systemImage: "number",
|
|
1336
1341
|
markdownCapable: true
|
|
1337
1342
|
};
|
|
1338
|
-
const loadIrcChannelRuntime = createLazyRuntimeModule(() => import("./channel-runtime-
|
|
1343
|
+
const loadIrcChannelRuntime = createLazyRuntimeModule(() => import("./channel-runtime-DBNGrI_Y.js"));
|
|
1339
1344
|
function normalizePairingTarget(raw) {
|
|
1340
1345
|
const normalized = normalizeIrcAllowEntry(raw);
|
|
1341
1346
|
if (!normalized) return "";
|
|
@@ -1428,7 +1433,8 @@ const ircPlugin = createChatChannelPlugin({
|
|
|
1428
1433
|
port: account.port,
|
|
1429
1434
|
tls: account.tls,
|
|
1430
1435
|
nick: account.nick,
|
|
1431
|
-
passwordSource: account.passwordSource
|
|
1436
|
+
passwordSource: account.passwordSource,
|
|
1437
|
+
tokenStatus: account.tokenStatus
|
|
1432
1438
|
}
|
|
1433
1439
|
})
|
|
1434
1440
|
},
|
|
@@ -1535,7 +1541,8 @@ const ircPlugin = createChatChannelPlugin({
|
|
|
1535
1541
|
port: account.port,
|
|
1536
1542
|
tls: account.tls,
|
|
1537
1543
|
nick: account.nick,
|
|
1538
|
-
passwordSource: account.passwordSource
|
|
1544
|
+
passwordSource: account.passwordSource,
|
|
1545
|
+
tokenStatus: account.tokenStatus
|
|
1539
1546
|
}
|
|
1540
1547
|
})
|
|
1541
1548
|
}),
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as IrcChannelConfigSchema } from "./config-schema-
|
|
1
|
+
import { t as IrcChannelConfigSchema } from "./config-schema-BPoye3--.js";
|
|
2
2
|
export { IrcChannelConfigSchema };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as ircPlugin } from "./channel-
|
|
1
|
+
import { t as ircPlugin } from "./channel-BC0q2_Tg.js";
|
|
2
2
|
export { ircPlugin };
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { a as resolveIrcGroupRequireMention, c as isChannelTarget, d as connectIrcClient, f as makeIrcMessageId, g as resolveIrcAccount, i as resolveIrcGroupMatch, l as normalizeIrcAllowEntry, o as sendMessageIrc, s as buildIrcAllowlistCandidates, u as buildIrcConnectOptions } from "./channel-
|
|
2
|
-
import { t as getIrcRuntime } from "./runtime-
|
|
1
|
+
import { a as resolveIrcGroupRequireMention, c as isChannelTarget, d as connectIrcClient, f as makeIrcMessageId, g as resolveIrcAccount, i as resolveIrcGroupMatch, l as normalizeIrcAllowEntry, o as sendMessageIrc, s as buildIrcAllowlistCandidates, u as buildIrcConnectOptions } from "./channel-BC0q2_Tg.js";
|
|
2
|
+
import { t as getIrcRuntime } from "./runtime-xy-FcjJC.js";
|
|
3
3
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { resolveChannelStreamingBlockEnabled } from "openclaw/plugin-sdk/channel-outbound";
|
|
5
5
|
import { resolveLoggerBackedRuntime } from "openclaw/plugin-sdk/extension-shared";
|
|
6
|
-
import { logInboundDrop } from "openclaw/plugin-sdk/channel-inbound";
|
|
6
|
+
import { buildChannelInboundEventContext, logInboundDrop, resolveChannelInboundRouteEnvelope } from "openclaw/plugin-sdk/channel-inbound";
|
|
7
7
|
import { channelIngressRoutes, createChannelIngressResolver, defineStableChannelIngressIdentity } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
8
8
|
import { createChannelPairingController } from "openclaw/plugin-sdk/channel-pairing";
|
|
9
9
|
import { isDangerousNameMatchingEnabled } from "openclaw/plugin-sdk/dangerous-name-runtime";
|
|
10
|
-
import { resolveInboundRouteEnvelopeBuilderWithRuntime } from "openclaw/plugin-sdk/inbound-envelope";
|
|
11
10
|
import { deliverFormattedTextWithAttachments } from "openclaw/plugin-sdk/reply-payload";
|
|
12
11
|
import { GROUP_POLICY_BLOCKED_LABEL, resolveAllowlistProviderRuntimeGroupPolicy, resolveDefaultGroupPolicy, warnMissingProviderGroupPolicyFallbackOnce } from "openclaw/plugin-sdk/runtime-group-policy";
|
|
13
12
|
//#region extensions/irc/src/inbound.ts
|
|
@@ -253,19 +252,17 @@ async function handleIrcInbound(params) {
|
|
|
253
252
|
}
|
|
254
253
|
const channelTarget = message.target.startsWith("#") || message.target.startsWith("&") ? message.target : `#${message.target}`;
|
|
255
254
|
const peerId = message.isGroup ? channelTarget : message.senderNick;
|
|
256
|
-
const { route, buildEnvelope } =
|
|
255
|
+
const { route, buildEnvelope } = resolveChannelInboundRouteEnvelope({
|
|
257
256
|
cfg: config,
|
|
258
257
|
channel: CHANNEL_ID,
|
|
259
258
|
accountId: account.accountId,
|
|
260
259
|
peer: {
|
|
261
260
|
kind: message.isGroup ? "group" : "direct",
|
|
262
261
|
id: peerId
|
|
263
|
-
}
|
|
264
|
-
runtime: core.channel,
|
|
265
|
-
sessionStore: config.session?.store
|
|
262
|
+
}
|
|
266
263
|
});
|
|
267
264
|
const fromLabel = message.isGroup ? message.target : senderDisplay;
|
|
268
|
-
const
|
|
265
|
+
const body = buildEnvelope({
|
|
269
266
|
channel: "IRC",
|
|
270
267
|
from: fromLabel,
|
|
271
268
|
timestamp: message.timestamp,
|
|
@@ -273,39 +270,58 @@ async function handleIrcInbound(params) {
|
|
|
273
270
|
});
|
|
274
271
|
const groupSystemPrompt = normalizeOptionalString(groupMatch.groupConfig?.systemPrompt);
|
|
275
272
|
const blockStreamingEnabled = resolveChannelStreamingBlockEnabled(account.config);
|
|
276
|
-
const ctxPayload =
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
273
|
+
const ctxPayload = buildChannelInboundEventContext({
|
|
274
|
+
channel: CHANNEL_ID,
|
|
275
|
+
accountId: route.accountId,
|
|
276
|
+
messageId: message.messageId,
|
|
277
|
+
timestamp: message.timestamp,
|
|
278
|
+
from: message.isGroup ? `channel:${channelTarget}` : `irc:${senderDisplay}`,
|
|
279
|
+
sender: {
|
|
280
|
+
id: senderDisplay,
|
|
281
|
+
name: message.senderNick || void 0
|
|
282
|
+
},
|
|
283
|
+
conversation: {
|
|
284
|
+
kind: message.isGroup ? "group" : "direct",
|
|
285
|
+
id: peerId,
|
|
286
|
+
label: fromLabel
|
|
287
|
+
},
|
|
288
|
+
route: {
|
|
289
|
+
agentId: route.agentId,
|
|
290
|
+
dmScope: route.dmScope,
|
|
291
|
+
accountId: route.accountId,
|
|
292
|
+
routeSessionKey: route.sessionKey
|
|
293
|
+
},
|
|
294
|
+
reply: {
|
|
295
|
+
to: message.isGroup ? `channel:${channelTarget}` : `irc:${peerId}`,
|
|
296
|
+
originatingTo: message.isGroup ? `channel:${channelTarget}` : `irc:${peerId}`
|
|
297
|
+
},
|
|
298
|
+
message: {
|
|
299
|
+
body,
|
|
300
|
+
bodyForAgent: rawBody,
|
|
301
|
+
rawBody,
|
|
302
|
+
commandBody: rawBody
|
|
303
|
+
},
|
|
304
|
+
access: {
|
|
305
|
+
commands: { authorized: commandAuthorized },
|
|
306
|
+
mentions: {
|
|
307
|
+
canDetectMention: message.isGroup,
|
|
308
|
+
wasMentioned
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
extra: {
|
|
312
|
+
GroupSubject: message.isGroup ? message.target : void 0,
|
|
313
|
+
GroupSystemPrompt: message.isGroup ? groupSystemPrompt : void 0
|
|
314
|
+
}
|
|
298
315
|
});
|
|
299
|
-
await core.channel.inbound.
|
|
316
|
+
await core.channel.inbound.dispatch({
|
|
300
317
|
cfg: config,
|
|
301
318
|
channel: CHANNEL_ID,
|
|
302
319
|
accountId: account.accountId,
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
320
|
+
route: {
|
|
321
|
+
agentId: route.agentId,
|
|
322
|
+
sessionKey: route.sessionKey
|
|
323
|
+
},
|
|
306
324
|
ctxPayload,
|
|
307
|
-
recordInboundSession: core.channel.session.recordInboundSession,
|
|
308
|
-
dispatchReplyWithBufferedBlockDispatcher: core.channel.reply.dispatchReplyWithBufferedBlockDispatcher,
|
|
309
325
|
delivery: {
|
|
310
326
|
deliver: async (payload) => {
|
|
311
327
|
await deliverIrcReply({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createChannelConfigUiHints } from "openclaw/plugin-sdk/channel-core";
|
|
2
|
-
import { DmPolicySchema, GroupPolicySchema, MarkdownConfigSchema, ReplyRuntimeConfigSchemaShape,
|
|
2
|
+
import { ChannelGroupEntrySchema, DmPolicySchema, GroupPolicySchema, MarkdownConfigSchema, ReplyRuntimeConfigSchemaShape, buildChannelConfigSchema, buildMultiAccountChannelSchema, requireOpenAllowFrom } from "openclaw/plugin-sdk/channel-config-schema";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region extensions/irc/src/config-ui-hints.ts
|
|
5
5
|
const ircChannelConfigUiHints = {
|
|
@@ -42,15 +42,6 @@ const ircChannelConfigUiHints = {
|
|
|
42
42
|
};
|
|
43
43
|
//#endregion
|
|
44
44
|
//#region extensions/irc/src/config-schema.ts
|
|
45
|
-
const IrcGroupSchema = z.object({
|
|
46
|
-
requireMention: z.boolean().optional(),
|
|
47
|
-
tools: ToolPolicySchema,
|
|
48
|
-
toolsBySender: z.record(z.string(), ToolPolicySchema).optional(),
|
|
49
|
-
skills: z.array(z.string()).optional(),
|
|
50
|
-
enabled: z.boolean().optional(),
|
|
51
|
-
allowFrom: z.array(z.union([z.string(), z.number()])).optional(),
|
|
52
|
-
systemPrompt: z.string().optional()
|
|
53
|
-
}).strict();
|
|
54
45
|
const IrcNickServSchema = z.object({
|
|
55
46
|
enabled: z.boolean().optional(),
|
|
56
47
|
service: z.string().optional(),
|
|
@@ -65,7 +56,7 @@ const IrcNickServSchema = z.object({
|
|
|
65
56
|
message: "channels.irc.nickserv.register=true requires channels.irc.nickserv.registerEmail"
|
|
66
57
|
});
|
|
67
58
|
});
|
|
68
|
-
const
|
|
59
|
+
const IrcChannelConfigSchema = buildChannelConfigSchema(buildMultiAccountChannelSchema(z.object({
|
|
69
60
|
name: z.string().optional(),
|
|
70
61
|
enabled: z.boolean().optional(),
|
|
71
62
|
dangerouslyAllowNameMatching: z.boolean().optional(),
|
|
@@ -82,32 +73,22 @@ const IrcAccountSchemaBase = z.object({
|
|
|
82
73
|
allowFrom: z.array(z.union([z.string(), z.number()])).optional(),
|
|
83
74
|
groupPolicy: GroupPolicySchema.optional().default("allowlist"),
|
|
84
75
|
groupAllowFrom: z.array(z.union([z.string(), z.number()])).optional(),
|
|
85
|
-
groups: z.record(z.string(),
|
|
76
|
+
groups: z.record(z.string(), ChannelGroupEntrySchema.optional()).optional(),
|
|
86
77
|
channels: z.array(z.string()).optional(),
|
|
87
78
|
mentionPatterns: z.array(z.string()).optional(),
|
|
88
79
|
markdown: MarkdownConfigSchema,
|
|
89
80
|
...ReplyRuntimeConfigSchemaShape
|
|
90
|
-
}).strict()
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
accounts: z.record(z.string(), IrcAccountSchema.optional()).optional(),
|
|
102
|
-
defaultAccount: z.string().optional()
|
|
103
|
-
}).superRefine((value, ctx) => {
|
|
104
|
-
requireOpenAllowFrom({
|
|
105
|
-
policy: value.dmPolicy,
|
|
106
|
-
allowFrom: value.allowFrom,
|
|
107
|
-
ctx,
|
|
108
|
-
path: ["allowFrom"],
|
|
109
|
-
message: "channels.irc.dmPolicy=\"open\" requires channels.irc.allowFrom to include \"*\""
|
|
110
|
-
});
|
|
81
|
+
}).strict(), {
|
|
82
|
+
optionalAccount: true,
|
|
83
|
+
refine: (value, ctx) => {
|
|
84
|
+
requireOpenAllowFrom({
|
|
85
|
+
policy: value.dmPolicy,
|
|
86
|
+
allowFrom: value.allowFrom,
|
|
87
|
+
ctx,
|
|
88
|
+
path: ["allowFrom"],
|
|
89
|
+
message: "channels.irc.dmPolicy=\"open\" requires channels.irc.allowFrom to include \"*\""
|
|
90
|
+
});
|
|
91
|
+
}
|
|
111
92
|
}), { uiHints: ircChannelConfigUiHints });
|
|
112
93
|
//#endregion
|
|
113
94
|
export { IrcChannelConfigSchema as t };
|
package/dist/runtime-api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as setIrcRuntime } from "./runtime-
|
|
1
|
+
import { n as setIrcRuntime } from "./runtime-xy-FcjJC.js";
|
|
2
2
|
export { setIrcRuntime };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
|
|
2
2
|
//#region extensions/irc/src/runtime.ts
|
|
3
|
-
const { setRuntime: setIrcRuntime,
|
|
3
|
+
const { setRuntime: setIrcRuntime, getRuntime: getIrcRuntime } = createPluginRuntimeStore({
|
|
4
4
|
pluginId: "irc",
|
|
5
5
|
errorMessage: "IRC runtime not initialized"
|
|
6
6
|
});
|
|
@@ -28,6 +28,7 @@ function collectRuntimeConfigAssignments(params) {
|
|
|
28
28
|
defaults: params.defaults,
|
|
29
29
|
context: params.context,
|
|
30
30
|
topLevelActive: isBaseFieldActiveForChannelSurface(surface, "nickserv") && isRecord(irc.nickserv) && isEnabledFlag(irc.nickserv),
|
|
31
|
+
topLevelInheritedAccountActive: ({ account, enabled }) => enabled && !Object.hasOwn(account, "nickserv") && isEnabledFlag(irc.nickserv),
|
|
31
32
|
topInactiveReason: "no enabled account inherits this top-level IRC nickserv config or NickServ is disabled.",
|
|
32
33
|
accountActive: ({ account, enabled }) => enabled && isRecord(account.nickserv) && isEnabledFlag(account.nickserv),
|
|
33
34
|
accountInactiveReason: "IRC account is disabled or NickServ is disabled for this account."
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries, t as channelSecrets } from "./secret-contract-
|
|
1
|
+
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries, t as channelSecrets } from "./secret-contract-D_DC3YWj.js";
|
|
2
2
|
export { channelSecrets, collectRuntimeConfigAssignments, secretTargetRegistryEntries };
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/irc",
|
|
3
|
-
"version": "2026.7.2-beta.
|
|
3
|
+
"version": "2026.7.2-beta.3",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@openclaw/irc",
|
|
9
|
-
"version": "2026.7.2-beta.
|
|
9
|
+
"version": "2026.7.2-beta.3",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"zod": "4.4.3"
|
|
12
12
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/irc",
|
|
3
|
-
"version": "2026.7.2-beta.
|
|
3
|
+
"version": "2026.7.2-beta.3",
|
|
4
4
|
"description": "OpenClaw IRC channel plugin",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"openclaw": {
|
|
@@ -33,16 +33,14 @@
|
|
|
33
33
|
"IRC_HOST",
|
|
34
34
|
"IRC_NICK"
|
|
35
35
|
]
|
|
36
|
-
}
|
|
37
|
-
"specifier": "./configured-state",
|
|
38
|
-
"exportName": "hasIrcConfiguredState"
|
|
36
|
+
}
|
|
39
37
|
}
|
|
40
38
|
},
|
|
41
39
|
"compat": {
|
|
42
|
-
"pluginApi": ">=2026.7.2-beta.
|
|
40
|
+
"pluginApi": ">=2026.7.2-beta.3"
|
|
43
41
|
},
|
|
44
42
|
"build": {
|
|
45
|
-
"openclawVersion": "2026.7.2-beta.
|
|
43
|
+
"openclawVersion": "2026.7.2-beta.3",
|
|
46
44
|
"bundledDist": false
|
|
47
45
|
},
|
|
48
46
|
"release": {
|
|
@@ -68,7 +66,7 @@
|
|
|
68
66
|
"README.md"
|
|
69
67
|
],
|
|
70
68
|
"peerDependencies": {
|
|
71
|
-
"openclaw": ">=2026.7.2-beta.
|
|
69
|
+
"openclaw": ">=2026.7.2-beta.3"
|
|
72
70
|
},
|
|
73
71
|
"peerDependenciesMeta": {
|
|
74
72
|
"openclaw": {
|
package/dist/configured-state.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
//#region extensions/irc/configured-state.ts
|
|
2
|
-
function hasIrcConfiguredState(params) {
|
|
3
|
-
return typeof params.env?.IRC_HOST === "string" && params.env.IRC_HOST.trim().length > 0 && typeof params.env?.IRC_NICK === "string" && params.env.IRC_NICK.trim().length > 0;
|
|
4
|
-
}
|
|
5
|
-
//#endregion
|
|
6
|
-
export { hasIrcConfiguredState };
|