@openclaw/tlon 2026.10.5-beta.3 → 2026.10.5-beta.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-C4naQdox.mjs";
2
+ import { t as tlonPlugin } from "./channel-Dfri5oOT.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-Bbp6_R2T.mjs"));
97
+ const loadTlonChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-U0WASXdh.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,
@@ -73,7 +73,7 @@ function parsePendingApprovals(value) {
73
73
  return parsed.filter((item) => {
74
74
  if (!item || typeof item !== "object") return false;
75
75
  const obj = item;
76
- return typeof obj.id === "string" && (obj.type === "dm" || obj.type === "channel" || obj.type === "group") && typeof obj.requestingShip === "string" && typeof obj.timestamp === "number";
76
+ 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");
77
77
  });
78
78
  }
79
79
  function parseSettingsEvent(event) {
@@ -1260,6 +1260,8 @@ function createPendingApproval(params) {
1260
1260
  id: generateApprovalId(params.type),
1261
1261
  type: params.type,
1262
1262
  requestingShip: params.requestingShip,
1263
+ ...params.clubId !== void 0 ? { clubId: params.clubId } : {},
1264
+ ...params.verifiedDirect === true ? { verifiedDirect: true } : {},
1263
1265
  channelNest: params.channelNest,
1264
1266
  groupFlag: params.groupFlag,
1265
1267
  messagePreview: params.messagePreview != null ? sliceUtf16Safe(params.messagePreview, 0, 100) : void 0,
@@ -1274,7 +1276,12 @@ function truncate(text, maxLength) {
1274
1276
  function formatApprovalRequest(approval) {
1275
1277
  const preview = approval.messagePreview ? `\n"${truncate(approval.messagePreview, 100)}"` : "";
1276
1278
  switch (approval.type) {
1277
- case "dm": return `New DM request from ${approval.requestingShip}:${preview}\n\nReply "approve", "deny", or "block" (ID: ${approval.id})`;
1279
+ case "dm":
1280
+ if (approval.clubId !== void 0) {
1281
+ 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.`;
1282
+ 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})`;
1283
+ }
1284
+ return `New DM request from ${approval.requestingShip}:${preview}\n\nReply "approve", "deny", or "block" (ID: ${approval.id})`;
1278
1285
  case "channel": return `${approval.requestingShip} mentioned you in ${approval.channelNest}:${preview}\n\nReply "approve", "deny", or "block"\n(ID: ${approval.id})`;
1279
1286
  case "group": return `Group invite from ${approval.requestingShip} to join ${approval.groupFlag}\n\nReply "approve", "deny", or "block"\n(ID: ${approval.id})`;
1280
1287
  }
@@ -1295,12 +1302,22 @@ function findPendingApproval(pendingApprovals, id) {
1295
1302
  function removePendingApproval(pendingApprovals, id) {
1296
1303
  return pendingApprovals.filter((a) => a.id !== id);
1297
1304
  }
1305
+ /**
1306
+ * DM requests saved before sender provenance was recorded cannot be told apart from unverified
1307
+ * group DM claims, so their stored message is never replayed; the sender must send it again.
1308
+ */
1309
+ function requiresResendAfterApproval(approval) {
1310
+ return approval.type === "dm" && approval.originalMessage !== void 0 && approval.clubId === void 0 && approval.verifiedDirect !== true;
1311
+ }
1298
1312
  function formatApprovalConfirmation(approval, action) {
1299
1313
  if (action === "block") return `Blocked ${approval.requestingShip}. They will no longer be able to contact the bot.`;
1300
1314
  const actionText = action === "approve" ? "Approved" : "Denied";
1301
1315
  switch (approval.type) {
1302
1316
  case "dm":
1303
- if (action === "approve") return `${actionText} DM access for ${approval.requestingShip}. They can now message the bot.`;
1317
+ if (action === "approve") {
1318
+ 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.`;
1319
+ return `${actionText} DM access for ${approval.requestingShip}. They can now message the bot.`;
1320
+ }
1304
1321
  return `${actionText} DM request from ${approval.requestingShip}.`;
1305
1322
  case "channel":
1306
1323
  if (action === "approve") return `${actionText} ${approval.requestingShip} for ${approval.channelNest}. They can now interact in this channel.`;
@@ -1444,11 +1461,13 @@ function createTlonApprovalRuntime(params) {
1444
1461
  return false;
1445
1462
  }
1446
1463
  const approvals = state.pendingApprovals;
1447
- 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));
1464
+ 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));
1448
1465
  if (existing) {
1449
1466
  if (approval.originalMessage) {
1450
1467
  existing.originalMessage = approval.originalMessage;
1451
1468
  existing.messagePreview = approval.messagePreview;
1469
+ if (approval.verifiedDirect === true) existing.verifiedDirect = true;
1470
+ else delete existing.verifiedDirect;
1452
1471
  }
1453
1472
  runtime.log?.(`[tlon] Updated existing approval for ${approval.requestingShip} (${approval.type}) - re-sending notification`);
1454
1473
  await savePendingApprovals(true);
@@ -1482,7 +1501,8 @@ function createTlonApprovalRuntime(params) {
1482
1501
  if (parsed.action === "approve") switch (approval.type) {
1483
1502
  case "dm":
1484
1503
  await addToDmAllowlist(approval.requestingShip);
1485
- if (approval.originalMessage) {
1504
+ if (requiresResendAfterApproval(approval)) runtime.log?.(`[tlon] Not replaying pre-upgrade DM request from ${approval.requestingShip}: sender provenance unknown; owner told to request a resend`);
1505
+ else if (approval.originalMessage) {
1486
1506
  runtime.log?.(`[tlon] Processing original message from ${approval.requestingShip} after approval`);
1487
1507
  await processApprovedMessage(approval);
1488
1508
  }
@@ -2367,6 +2387,10 @@ function createActiveSnapshotTracker() {
2367
2387
  }
2368
2388
  //#endregion
2369
2389
  //#region extensions/tlon/src/monitor/index.ts
2390
+ /** Identity for an unverified group DM (club) author claim; never matches a bare ship. */
2391
+ function clubSenderId(clubId, claimedShip) {
2392
+ return `club:${clubId}:${claimedShip}`;
2393
+ }
2370
2394
  async function monitorTlonProvider(opts) {
2371
2395
  const discoveryScheduler = opts.scheduler.scope();
2372
2396
  const core = getTlonRuntime();
@@ -2479,9 +2503,17 @@ async function monitorTlonProvider(opts) {
2479
2503
  if (!settingsState.effectiveOwnerShip) return false;
2480
2504
  return normalizeShip(ship) === settingsState.effectiveOwnerShip;
2481
2505
  }
2506
+ /** DM ingress allowlist for one chat event; club claims only match as their club-scoped id. */
2507
+ function resolveChatAllowFrom(params) {
2508
+ if (params.ownerDm) return [params.senderShip];
2509
+ if (!params.isClubMessage) return settingsState.effectiveDmAllowlist;
2510
+ return settingsState.effectiveDmAllowlist.some((ship) => normalizeShip(ship) === params.senderShip) ? [params.senderId] : [];
2511
+ }
2482
2512
  const processMessage = async (params) => {
2483
2513
  const { messageId, senderShip, isGroup, channelNest, timestamp, parentId, isThreadReply, isAdmissionAllowed, messageContent, turnAdoptionLifecycle, resolveChannelIngress } = params;
2484
2514
  let messageText = params.messageText;
2515
+ const clubId = params.clubId;
2516
+ const senderId = clubId === void 0 ? senderShip : clubSenderId(clubId, senderShip);
2485
2517
  let attachments = [];
2486
2518
  let unavailableMediaCount = 0;
2487
2519
  if (messageContent) try {
@@ -2567,13 +2599,13 @@ async function monitorTlonProvider(opts) {
2567
2599
  }
2568
2600
  senders.add(senderShip);
2569
2601
  }
2570
- const senderRole = isOwner(senderShip) ? "owner" : "user";
2571
- const fromLabel = isGroup ? `${senderShip} [${senderRole}] in ${channelNest}` : `${senderShip} [${senderRole}]`;
2602
+ const senderRole = clubId === void 0 && isOwner(senderShip) ? "owner" : "user";
2603
+ const fromLabel = isGroup ? `${senderShip} [${senderRole}] in ${channelNest}` : clubId !== void 0 ? `${senderShip} (unverified) [${senderRole}] in group DM ${clubId}` : `${senderShip} [${senderRole}]`;
2572
2604
  const shouldComputeAuth = core.channel.commands.shouldComputeCommandAuthorized(messageText, cfg);
2573
2605
  let commandAuthorized = false;
2574
2606
  if (shouldComputeAuth) {
2575
2607
  commandAuthorized = (await resolveTlonCommandAuthorizationWithIngress({
2576
- senderShip,
2608
+ senderShip: senderId,
2577
2609
  ownerShip: settingsState.effectiveOwnerShip
2578
2610
  })).commandAccess.authorized;
2579
2611
  if (!commandAuthorized) console.log(`[tlon] Command attempt denied: ${senderShip} is not owner (owner=${settingsState.effectiveOwnerShip ?? "not configured"})`);
@@ -2599,10 +2631,10 @@ async function monitorTlonProvider(opts) {
2599
2631
  accountId: route.accountId,
2600
2632
  messageId,
2601
2633
  timestamp,
2602
- from: isGroup ? `tlon:group:${channelNest}` : `tlon:${senderShip}`,
2634
+ from: isGroup ? `tlon:group:${channelNest}` : `tlon:${senderId}`,
2603
2635
  sender: {
2604
- id: senderShip,
2605
- name: senderShip,
2636
+ id: senderId,
2637
+ name: clubId === void 0 ? senderShip : senderId,
2606
2638
  roles: [senderRole]
2607
2639
  },
2608
2640
  conversation: {
@@ -2734,9 +2766,16 @@ async function monitorTlonProvider(opts) {
2734
2766
  const isGroup = approval.type === "channel";
2735
2767
  const conversationId = isGroup ? approval.channelNest ?? "" : approval.requestingShip;
2736
2768
  if (isGroup && !conversationId) return;
2769
+ const clubId = !isGroup ? approval.clubId : void 0;
2770
+ if (!isGroup && clubId === void 0 && approval.verifiedDirect !== true) {
2771
+ runtime.log?.(`[tlon] Not replaying pre-upgrade DM request from ${approval.requestingShip}: sender provenance unknown`);
2772
+ return;
2773
+ }
2774
+ const replaySenderId = clubId === void 0 ? approval.requestingShip : clubSenderId(clubId, approval.requestingShip);
2737
2775
  await processMessage({
2738
2776
  messageId: approval.originalMessage.messageId,
2739
2777
  senderShip: approval.requestingShip,
2778
+ clubId,
2740
2779
  messageText: approval.originalMessage.messageText,
2741
2780
  messageContent: approval.originalMessage.messageContent,
2742
2781
  timestamp: approval.originalMessage.timestamp,
@@ -2747,13 +2786,13 @@ async function monitorTlonProvider(opts) {
2747
2786
  isThreadReply: approval.originalMessage.isThreadReply
2748
2787
  } : {},
2749
2788
  resolveChannelIngress: async (contextBinding) => await resolveTlonMessageIngress({
2750
- senderShip: approval.requestingShip,
2789
+ senderShip: replaySenderId,
2751
2790
  accountId: account.accountId,
2752
2791
  conversation: {
2753
2792
  kind: isGroup ? "group" : "direct",
2754
2793
  id: conversationId
2755
2794
  },
2756
- allowFrom: [approval.requestingShip],
2795
+ allowFrom: [replaySenderId],
2757
2796
  ...isGroup ? { groupPolicy: "allowlist" } : {},
2758
2797
  contextBinding
2759
2798
  })
@@ -2916,29 +2955,37 @@ async function monitorTlonProvider(opts) {
2916
2955
  const authorShip = normalizeShip(readStringField(essay, "author") ?? "");
2917
2956
  const partnerShip = extractDmPartnerShip(whom);
2918
2957
  const senderShip = partnerShip || authorShip;
2958
+ const clubId = partnerShip ? void 0 : typeof whom === "string" && whom ? whom : "unknown";
2959
+ const isClubMessage = clubId !== void 0;
2960
+ const senderId = isClubMessage ? clubSenderId(clubId, senderShip) : senderShip;
2919
2961
  if (authorShip === botShipName) return;
2920
2962
  if (!senderShip || senderShip === botShipName) return;
2921
2963
  if (authorShip && partnerShip && authorShip !== partnerShip) runtime.log?.(`[tlon] DM ship mismatch (author=${authorShip}, partner=${partnerShip}) - routing to partner`);
2922
2964
  const rawText = extractMessageText(essay.content);
2923
2965
  if (!rawText.trim()) return;
2924
2966
  const messageText = rawText;
2925
- if (isOwner(senderShip) && await handleApprovalResponse(messageText)) {
2967
+ const ownerDm = !isClubMessage && isOwner(senderShip);
2968
+ if (ownerDm && await handleApprovalResponse(messageText)) {
2926
2969
  runtime.log?.(`[tlon] Processed approval response from owner: ${messageText}`);
2927
2970
  return;
2928
2971
  }
2929
- if (isOwner(senderShip) && await handleAdminCommand(messageText)) {
2972
+ if (ownerDm && await handleAdminCommand(messageText)) {
2930
2973
  runtime.log?.(`[tlon] Processed admin command from owner: ${messageText}`);
2931
2974
  return;
2932
2975
  }
2933
- const ownerDm = isOwner(senderShip);
2934
2976
  const resolveChannelIngress = async (contextBinding) => await resolveTlonMessageIngress({
2935
- senderShip,
2977
+ senderShip: senderId,
2936
2978
  accountId: account.accountId,
2937
2979
  conversation: {
2938
2980
  kind: "direct",
2939
2981
  id: senderShip
2940
2982
  },
2941
- allowFrom: ownerDm ? [senderShip] : settingsState.effectiveDmAllowlist,
2983
+ allowFrom: resolveChatAllowFrom({
2984
+ ownerDm,
2985
+ isClubMessage,
2986
+ senderShip,
2987
+ senderId
2988
+ }),
2942
2989
  contextBinding
2943
2990
  });
2944
2991
  if (!ownerDm && !(await resolveChannelIngress()).senderAccess.allowed) {
@@ -2947,12 +2994,13 @@ async function monitorTlonProvider(opts) {
2947
2994
  type: "dm",
2948
2995
  requestingShip: senderShip,
2949
2996
  messagePreview: sliceUtf16Safe(messageText, 0, 100),
2950
- originalMessage: {
2997
+ ...isClubMessage ? { clubId } : { verifiedDirect: true },
2998
+ ...isClubMessage && isOwner(senderShip) ? {} : { originalMessage: {
2951
2999
  messageId,
2952
3000
  messageText,
2953
3001
  messageContent: essay.content,
2954
3002
  timestamp: asFiniteNumber(essay?.sent) ?? Date.now()
2955
- }
3003
+ } }
2956
3004
  });
2957
3005
  await queueApprovalRequest(approval);
2958
3006
  } else runtime.log?.(`[tlon] Blocked DM from ${senderShip}: not in allowlist`);
@@ -2964,6 +3012,7 @@ async function monitorTlonProvider(opts) {
2964
3012
  messageText: resolvedMessageText,
2965
3013
  messageId,
2966
3014
  senderShip,
3015
+ clubId,
2967
3016
  messageContent: essay.content,
2968
3017
  isGroup: false,
2969
3018
  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-C4naQdox.mjs";
2
+ import { t as tlonPlugin } from "./.setup/channel-Dfri5oOT.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,2 @@
1
- import { t as tlonPlugin } from "./.setup/channel-C4naQdox.mjs";
1
+ import { t as tlonPlugin } from "./.setup/channel-Dfri5oOT.mjs";
2
2
  export { tlonPlugin };
@@ -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-CD82bZzj.mjs", import.meta.url).href),
7
+ specifier: fileURLToPath(new URL(".setup/api-B17eS900.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.5-beta.3",
3
+ "version": "2026.10.5-beta.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.5-beta.3"
22
+ "openclaw": ">=2026.10.5-beta.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.5-beta.3"
124
+ "pluginApi": ">=2026.10.5-beta.4"
125
125
  },
126
126
  "build": {
127
- "openclawVersion": "2026.10.5-beta.3"
127
+ "openclawVersion": "2026.10.5-beta.4"
128
128
  },
129
129
  "release": {
130
130
  "bundleRuntimeDependencies": false,