@openclaw/tlon 2026.10.3 → 2026.10.4

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.
@@ -1,5 +1,5 @@
1
1
  import { SsrFBlockedError, createDedupeCache, createLoggerBackedRuntime, fetchWithSsrFGuard, isBlockedHostnameOrIp, ssrfPolicyFromDangerouslyAllowPrivateNetwork } from "../runtime-api.js";
2
- import { t as tlonPlugin } from "./channel-1Iz9bkFT.mjs";
2
+ import { t as tlonPlugin } from "./channel-DO95GoFj.mjs";
3
3
  import { n as setTlonRuntime } from "./runtime-Ck3lNvST.mjs";
4
4
  import "../api.js";
5
5
  export { SsrFBlockedError, createDedupeCache, createLoggerBackedRuntime, fetchWithSsrFGuard, isBlockedHostnameOrIp, setTlonRuntime, ssrfPolicyFromDangerouslyAllowPrivateNetwork, tlonPlugin };
@@ -94,7 +94,7 @@ function resolveTlonOutboundSessionRoute(params) {
94
94
  //#endregion
95
95
  //#region extensions/tlon/src/channel.ts
96
96
  const TLON_CHANNEL_ID = "tlon";
97
- const loadTlonChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-BespHUPW.mjs"));
97
+ const loadTlonChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-fG0sW71Y.mjs"));
98
98
  const tlonSetupWizardProxy = createTlonSetupWizardBase(async (params) => await (await loadTlonChannelRuntime()).tlonSetupWizard.finalize(params));
99
99
  const tlonConfigAdapter = createHybridChannelConfigAdapter({
100
100
  sectionKey: TLON_CHANNEL_ID,
@@ -74,7 +74,7 @@ function parsePendingApprovals(value) {
74
74
  return parsed.filter((item) => {
75
75
  if (!item || typeof item !== "object") return false;
76
76
  const obj = item;
77
- return typeof obj.id === "string" && (obj.type === "dm" || obj.type === "channel" || obj.type === "group") && typeof obj.requestingShip === "string" && typeof obj.timestamp === "number";
77
+ return typeof obj.id === "string" && (obj.type === "dm" || obj.type === "channel" || obj.type === "group") && typeof obj.requestingShip === "string" && typeof obj.timestamp === "number" && (obj.clubId === void 0 || typeof obj.clubId === "string") && (obj.verifiedDirect === void 0 || typeof obj.verifiedDirect === "boolean");
78
78
  });
79
79
  }
80
80
  function parseSettingsEvent(event) {
@@ -1218,6 +1218,8 @@ function createPendingApproval(params) {
1218
1218
  id: generateApprovalId(params.type),
1219
1219
  type: params.type,
1220
1220
  requestingShip: params.requestingShip,
1221
+ ...params.clubId !== void 0 ? { clubId: params.clubId } : {},
1222
+ ...params.verifiedDirect === true ? { verifiedDirect: true } : {},
1221
1223
  channelNest: params.channelNest,
1222
1224
  groupFlag: params.groupFlag,
1223
1225
  messagePreview: params.messagePreview != null ? sliceUtf16Safe(params.messagePreview, 0, 100) : void 0,
@@ -1232,7 +1234,12 @@ function truncate(text, maxLength) {
1232
1234
  function formatApprovalRequest(approval) {
1233
1235
  const preview = approval.messagePreview ? `\n"${truncate(approval.messagePreview, 100)}"` : "";
1234
1236
  switch (approval.type) {
1235
- case "dm": return `New DM request from ${approval.requestingShip}:${preview}\n\nReply "approve", "deny", or "block" (ID: ${approval.id})`;
1237
+ case "dm":
1238
+ if (approval.clubId !== void 0) {
1239
+ const replayLine = approval.originalMessage ? `The message is answered as an unverified group DM sender, never as ${approval.requestingShip}.` : `The message is not kept, so it will not be answered; have ${approval.requestingShip} send it again in a normal direct message to get a reply.`;
1240
+ return `New group DM message claiming to be from ${approval.requestingShip} (unverified; group DM ${approval.clubId}):${preview}\n\nApproving adds ${approval.requestingShip} to the DM allowlist. ${replayLine}\nReply "approve", "deny", or "block" (ID: ${approval.id})`;
1241
+ }
1242
+ return `New DM request from ${approval.requestingShip}:${preview}\n\nReply "approve", "deny", or "block" (ID: ${approval.id})`;
1236
1243
  case "channel": return `${approval.requestingShip} mentioned you in ${approval.channelNest}:${preview}\n\nReply "approve", "deny", or "block"\n(ID: ${approval.id})`;
1237
1244
  case "group": return `Group invite from ${approval.requestingShip} to join ${approval.groupFlag}\n\nReply "approve", "deny", or "block"\n(ID: ${approval.id})`;
1238
1245
  }
@@ -1253,12 +1260,22 @@ function findPendingApproval(pendingApprovals, id) {
1253
1260
  function removePendingApproval(pendingApprovals, id) {
1254
1261
  return pendingApprovals.filter((a) => a.id !== id);
1255
1262
  }
1263
+ /**
1264
+ * DM requests saved before sender provenance was recorded cannot be told apart from unverified
1265
+ * group DM claims, so their stored message is never replayed; the sender must send it again.
1266
+ */
1267
+ function requiresResendAfterApproval(approval) {
1268
+ return approval.type === "dm" && approval.originalMessage !== void 0 && approval.clubId === void 0 && approval.verifiedDirect !== true;
1269
+ }
1256
1270
  function formatApprovalConfirmation(approval, action) {
1257
1271
  if (action === "block") return `Blocked ${approval.requestingShip}. They will no longer be able to contact the bot.`;
1258
1272
  const actionText = action === "approve" ? "Approved" : "Denied";
1259
1273
  switch (approval.type) {
1260
1274
  case "dm":
1261
- if (action === "approve") return `${actionText} DM access for ${approval.requestingShip}. They can now message the bot.`;
1275
+ if (action === "approve") {
1276
+ if (requiresResendAfterApproval(approval)) return `${actionText} DM access for ${approval.requestingShip}. They can now message the bot.\nTheir earlier message was saved before this version and its sender cannot be verified, so it was not processed. Ask ${approval.requestingShip} to send it again.`;
1277
+ return `${actionText} DM access for ${approval.requestingShip}. They can now message the bot.`;
1278
+ }
1262
1279
  return `${actionText} DM request from ${approval.requestingShip}.`;
1263
1280
  case "channel":
1264
1281
  if (action === "approve") return `${actionText} ${approval.requestingShip} for ${approval.channelNest}. They can now interact in this channel.`;
@@ -1414,11 +1431,13 @@ function createTlonApprovalRuntime(params) {
1414
1431
  return false;
1415
1432
  }
1416
1433
  const approvals = getPendingApprovals();
1417
- const existing = approvals.find((item) => item.type === approval.type && item.requestingShip === approval.requestingShip && (approval.type !== "channel" || item.channelNest === approval.channelNest) && (approval.type !== "group" || item.groupFlag === approval.groupFlag));
1434
+ const existing = approvals.find((item) => item.type === approval.type && item.requestingShip === approval.requestingShip && item.clubId === approval.clubId && (approval.type !== "channel" || item.channelNest === approval.channelNest) && (approval.type !== "group" || item.groupFlag === approval.groupFlag));
1418
1435
  if (existing) {
1419
1436
  if (approval.originalMessage) {
1420
1437
  existing.originalMessage = approval.originalMessage;
1421
1438
  existing.messagePreview = approval.messagePreview;
1439
+ if (approval.verifiedDirect === true) existing.verifiedDirect = true;
1440
+ else delete existing.verifiedDirect;
1422
1441
  }
1423
1442
  runtime.log?.(`[tlon] Updated existing approval for ${approval.requestingShip} (${approval.type}) - re-sending notification`);
1424
1443
  await savePendingApprovals(true);
@@ -1453,7 +1472,8 @@ function createTlonApprovalRuntime(params) {
1453
1472
  switch (approval.type) {
1454
1473
  case "dm":
1455
1474
  await addToDmAllowlist(approval.requestingShip);
1456
- if (approval.originalMessage) {
1475
+ if (requiresResendAfterApproval(approval)) runtime.log?.(`[tlon] Not replaying pre-upgrade DM request from ${approval.requestingShip}: sender provenance unknown; owner told to request a resend`);
1476
+ else if (approval.originalMessage) {
1457
1477
  runtime.log?.(`[tlon] Processing original message from ${approval.requestingShip} after approval`);
1458
1478
  await processApprovedMessage(approval);
1459
1479
  }
@@ -2362,6 +2382,10 @@ function createActiveSnapshotTracker() {
2362
2382
  }
2363
2383
  //#endregion
2364
2384
  //#region extensions/tlon/src/monitor/index.ts
2385
+ /** Identity for an unverified group DM (club) author claim; never matches a bare ship. */
2386
+ function clubSenderId(clubId, claimedShip) {
2387
+ return `club:${clubId}:${claimedShip}`;
2388
+ }
2365
2389
  async function monitorTlonProvider(opts) {
2366
2390
  const discoveryScheduler = opts.scheduler.scope();
2367
2391
  const core = getTlonRuntime();
@@ -2482,9 +2506,17 @@ async function monitorTlonProvider(opts) {
2482
2506
  if (!effectiveOwnerShip) return false;
2483
2507
  return normalizeShip(ship) === effectiveOwnerShip;
2484
2508
  }
2509
+ /** DM ingress allowlist for one chat event; club claims only match as their club-scoped id. */
2510
+ function resolveChatAllowFrom(params) {
2511
+ if (params.ownerDm) return [params.senderShip];
2512
+ if (!params.isClubMessage) return effectiveDmAllowlist;
2513
+ return effectiveDmAllowlist.some((ship) => normalizeShip(ship) === params.senderShip) ? [params.senderId] : [];
2514
+ }
2485
2515
  const processMessage = async (params) => {
2486
2516
  const { messageId, senderShip, isGroup, channelNest, timestamp, parentId, isThreadReply, isAdmissionAllowed, messageContent, turnAdoptionLifecycle, resolveChannelIngress } = params;
2487
2517
  let messageText = params.messageText;
2518
+ const clubId = params.clubId;
2519
+ const senderId = clubId === void 0 ? senderShip : clubSenderId(clubId, senderShip);
2488
2520
  let attachments = [];
2489
2521
  let unavailableMediaCount = 0;
2490
2522
  if (messageContent) try {
@@ -2572,13 +2604,13 @@ async function monitorTlonProvider(opts) {
2572
2604
  }
2573
2605
  senders.add(senderShip);
2574
2606
  }
2575
- const senderRole = isOwner(senderShip) ? "owner" : "user";
2576
- const fromLabel = isGroup ? `${senderShip} [${senderRole}] in ${channelNest}` : `${senderShip} [${senderRole}]`;
2607
+ const senderRole = clubId === void 0 && isOwner(senderShip) ? "owner" : "user";
2608
+ const fromLabel = isGroup ? `${senderShip} [${senderRole}] in ${channelNest}` : clubId !== void 0 ? `${senderShip} (unverified) [${senderRole}] in group DM ${clubId}` : `${senderShip} [${senderRole}]`;
2577
2609
  const shouldComputeAuth = core.channel.commands.shouldComputeCommandAuthorized(messageText, cfg);
2578
2610
  let commandAuthorized = false;
2579
2611
  if (shouldComputeAuth) {
2580
2612
  commandAuthorized = (await resolveTlonCommandAuthorizationWithIngress({
2581
- senderShip,
2613
+ senderShip: senderId,
2582
2614
  ownerShip: effectiveOwnerShip
2583
2615
  })).commandAccess.authorized;
2584
2616
  if (!commandAuthorized) console.log(`[tlon] Command attempt denied: ${senderShip} is not owner (owner=${effectiveOwnerShip ?? "not configured"})`);
@@ -2604,10 +2636,10 @@ async function monitorTlonProvider(opts) {
2604
2636
  accountId: route.accountId,
2605
2637
  messageId,
2606
2638
  timestamp,
2607
- from: isGroup ? `tlon:group:${channelNest}` : `tlon:${senderShip}`,
2639
+ from: isGroup ? `tlon:group:${channelNest}` : `tlon:${senderId}`,
2608
2640
  sender: {
2609
- id: senderShip,
2610
- name: senderShip,
2641
+ id: senderId,
2642
+ name: clubId === void 0 ? senderShip : senderId,
2611
2643
  roles: [senderRole]
2612
2644
  },
2613
2645
  conversation: {
@@ -2765,9 +2797,16 @@ async function monitorTlonProvider(opts) {
2765
2797
  const isGroup = approval.type === "channel";
2766
2798
  const conversationId = isGroup ? approval.channelNest ?? "" : approval.requestingShip;
2767
2799
  if (isGroup && !conversationId) return;
2800
+ const clubId = !isGroup ? approval.clubId : void 0;
2801
+ if (!isGroup && clubId === void 0 && approval.verifiedDirect !== true) {
2802
+ runtime.log?.(`[tlon] Not replaying pre-upgrade DM request from ${approval.requestingShip}: sender provenance unknown`);
2803
+ return;
2804
+ }
2805
+ const replaySenderId = clubId === void 0 ? approval.requestingShip : clubSenderId(clubId, approval.requestingShip);
2768
2806
  await processMessage({
2769
2807
  messageId: approval.originalMessage.messageId,
2770
2808
  senderShip: approval.requestingShip,
2809
+ clubId,
2771
2810
  messageText: approval.originalMessage.messageText,
2772
2811
  messageContent: approval.originalMessage.messageContent,
2773
2812
  timestamp: approval.originalMessage.timestamp,
@@ -2778,13 +2817,13 @@ async function monitorTlonProvider(opts) {
2778
2817
  isThreadReply: approval.originalMessage.isThreadReply
2779
2818
  } : {},
2780
2819
  resolveChannelIngress: async (contextBinding) => await resolveTlonMessageIngress({
2781
- senderShip: approval.requestingShip,
2820
+ senderShip: replaySenderId,
2782
2821
  accountId: account.accountId,
2783
2822
  conversation: {
2784
2823
  kind: isGroup ? "group" : "direct",
2785
2824
  id: conversationId
2786
2825
  },
2787
- allowFrom: [approval.requestingShip],
2826
+ allowFrom: [replaySenderId],
2788
2827
  ...isGroup ? { groupPolicy: "allowlist" } : {},
2789
2828
  contextBinding
2790
2829
  })
@@ -2944,29 +2983,37 @@ async function monitorTlonProvider(opts) {
2944
2983
  const authorShip = normalizeShip(readStringField(essay, "author") ?? "");
2945
2984
  const partnerShip = extractDmPartnerShip(whom);
2946
2985
  const senderShip = partnerShip || authorShip;
2986
+ const clubId = partnerShip ? void 0 : typeof whom === "string" && whom ? whom : "unknown";
2987
+ const isClubMessage = clubId !== void 0;
2988
+ const senderId = isClubMessage ? clubSenderId(clubId, senderShip) : senderShip;
2947
2989
  if (authorShip === botShipName) return;
2948
2990
  if (!senderShip || senderShip === botShipName) return;
2949
2991
  if (authorShip && partnerShip && authorShip !== partnerShip) runtime.log?.(`[tlon] DM ship mismatch (author=${authorShip}, partner=${partnerShip}) - routing to partner`);
2950
2992
  const rawText = extractMessageText(essay.content);
2951
2993
  if (!rawText.trim()) return;
2952
2994
  const messageText = rawText;
2953
- if (isOwner(senderShip) && await handleApprovalResponse(messageText)) {
2995
+ const ownerDm = !isClubMessage && isOwner(senderShip);
2996
+ if (ownerDm && await handleApprovalResponse(messageText)) {
2954
2997
  runtime.log?.(`[tlon] Processed approval response from owner: ${messageText}`);
2955
2998
  return;
2956
2999
  }
2957
- if (isOwner(senderShip) && await handleAdminCommand(messageText)) {
3000
+ if (ownerDm && await handleAdminCommand(messageText)) {
2958
3001
  runtime.log?.(`[tlon] Processed admin command from owner: ${messageText}`);
2959
3002
  return;
2960
3003
  }
2961
- const ownerDm = isOwner(senderShip);
2962
3004
  const resolveChannelIngress = async (contextBinding) => await resolveTlonMessageIngress({
2963
- senderShip,
3005
+ senderShip: senderId,
2964
3006
  accountId: account.accountId,
2965
3007
  conversation: {
2966
3008
  kind: "direct",
2967
3009
  id: senderShip
2968
3010
  },
2969
- allowFrom: ownerDm ? [senderShip] : effectiveDmAllowlist,
3011
+ allowFrom: resolveChatAllowFrom({
3012
+ ownerDm,
3013
+ isClubMessage,
3014
+ senderShip,
3015
+ senderId
3016
+ }),
2970
3017
  contextBinding
2971
3018
  });
2972
3019
  if (!ownerDm && !(await resolveChannelIngress()).senderAccess.allowed) {
@@ -2975,12 +3022,13 @@ async function monitorTlonProvider(opts) {
2975
3022
  type: "dm",
2976
3023
  requestingShip: senderShip,
2977
3024
  messagePreview: sliceUtf16Safe(messageText, 0, 100),
2978
- originalMessage: {
3025
+ ...isClubMessage ? { clubId } : { verifiedDirect: true },
3026
+ ...isClubMessage && isOwner(senderShip) ? {} : { originalMessage: {
2979
3027
  messageId,
2980
3028
  messageText,
2981
3029
  messageContent: essay.content,
2982
3030
  timestamp: asFiniteNumber(essay?.sent) ?? Date.now()
2983
- }
3031
+ } }
2984
3032
  });
2985
3033
  await queueApprovalRequest(approval);
2986
3034
  } else runtime.log?.(`[tlon] Blocked DM from ${senderShip}: not in allowlist`);
@@ -2992,6 +3040,7 @@ async function monitorTlonProvider(opts) {
2992
3040
  messageText: resolvedMessageText,
2993
3041
  messageId,
2994
3042
  senderShip,
3043
+ clubId,
2995
3044
  messageContent: essay.content,
2996
3045
  isGroup: false,
2997
3046
  timestamp: asFiniteNumber(essay?.sent) ?? Date.now(),
package/dist/api.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import { SsrFBlockedError, createDedupeCache, createLoggerBackedRuntime, fetchWithSsrFGuard, isBlockedHostnameOrIp, ssrfPolicyFromDangerouslyAllowPrivateNetwork } from "./runtime-api.js";
2
- import { t as tlonPlugin } from "./.setup/channel-1Iz9bkFT.mjs";
2
+ import { t as tlonPlugin } from "./.setup/channel-DO95GoFj.mjs";
3
3
  import { n as setTlonRuntime } from "./.setup/runtime-Ck3lNvST.mjs";
4
4
  export { SsrFBlockedError, createDedupeCache, createLoggerBackedRuntime, fetchWithSsrFGuard, isBlockedHostnameOrIp, setTlonRuntime, ssrfPolicyFromDangerouslyAllowPrivateNetwork, tlonPlugin };
@@ -1,2 +1 @@
1
- import { t as tlonPlugin } from "./.setup/channel-1Iz9bkFT.mjs";
2
- export { tlonPlugin };
1
+ export { t as tlonPlugin } from "./.setup/channel-DO95GoFj.mjs";
@@ -1,2 +1 @@
1
- import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./.setup/doctor-contract-bInPRAQZ.mjs";
2
- export { legacyConfigRules, normalizeCompatibilityConfig };
1
+ export { t as legacyConfigRules, n as normalizeCompatibilityConfig } from "./.setup/doctor-contract-bInPRAQZ.mjs";
@@ -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/api-B1JbxRVg.mjs", import.meta.url).href),
7
+ specifier: fileURLToPath(new URL(".setup/api-DjaW3W4A.mjs", import.meta.url).href),
8
8
  exportName: "tlonPlugin"
9
9
  }
10
10
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/tlon",
3
- "version": "2026.10.3",
3
+ "version": "2026.10.4",
4
4
  "description": "OpenClaw Tlon/Urbit channel plugin for chat workflows.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -19,7 +19,7 @@
19
19
  "openclaw": "workspace:*"
20
20
  },
21
21
  "peerDependencies": {
22
- "openclaw": ">=2026.10.3"
22
+ "openclaw": ">=2026.10.4"
23
23
  },
24
24
  "peerDependenciesMeta": {
25
25
  "openclaw": {
@@ -121,10 +121,10 @@
121
121
  "minHostVersion": ">=2026.4.10"
122
122
  },
123
123
  "compat": {
124
- "pluginApi": ">=2026.10.3"
124
+ "pluginApi": ">=2026.10.4"
125
125
  },
126
126
  "build": {
127
- "openclawVersion": "2026.10.3"
127
+ "openclawVersion": "2026.10.4"
128
128
  },
129
129
  "release": {
130
130
  "bundleRuntimeDependencies": false,