@openclaw/tlon 2026.11.2 → 2026.11.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-C3JZ6wZF.mjs";
2
+ import { t as tlonPlugin } from "./channel-C2dWMDrp.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-BzZXbsh4.mjs"));
97
+ const loadTlonChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-DeZaAXos.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,
@@ -1164,8 +1164,11 @@ var UrbitSSEClient = class {
1164
1164
  auditContext: "tlon-urbit-poke"
1165
1165
  });
1166
1166
  }
1167
- async scry(path) {
1168
- return await scryUrbitPath(this.channelRequestContext(), {
1167
+ async scry(path, beforeRequest) {
1168
+ return await scryUrbitPath({
1169
+ ...this.channelRequestContext(),
1170
+ beforeRequest
1171
+ }, {
1169
1172
  path,
1170
1173
  auditContext: "tlon-urbit-scry"
1171
1174
  });
@@ -1305,17 +1308,20 @@ function truncate(text, maxLength) {
1305
1308
  if (text.length <= maxLength) return text;
1306
1309
  return sliceUtf16Safe(text, 0, maxLength - 3) + "...";
1307
1310
  }
1311
+ function formatApprovalInstructions(id) {
1312
+ return `Reply "approve", "deny", or "block" if this is the only pending request. If multiple are pending, reply "approve ${id}", "deny ${id}", or "block ${id}".`;
1313
+ }
1308
1314
  function formatApprovalRequest(approval) {
1309
1315
  const preview = approval.messagePreview ? `\n"${truncate(approval.messagePreview, 100)}"` : "";
1310
1316
  switch (approval.type) {
1311
1317
  case "dm":
1312
1318
  if (approval.clubId !== void 0) {
1313
1319
  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.`;
1314
- 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})`;
1320
+ 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}\n` + formatApprovalInstructions(approval.id);
1315
1321
  }
1316
- return `New DM request from ${approval.requestingShip}:${preview}\n\nReply "approve", "deny", or "block" (ID: ${approval.id})`;
1317
- case "channel": return `${approval.requestingShip} mentioned you in ${approval.channelNest}:${preview}\n\nReply "approve", "deny", or "block"\n(ID: ${approval.id})`;
1318
- case "group": return `Group invite from ${approval.requestingShip} to join ${approval.groupFlag}\n\nReply "approve", "deny", or "block"\n(ID: ${approval.id})`;
1322
+ return `New DM request from ${approval.requestingShip}:${preview}\n\n` + formatApprovalInstructions(approval.id);
1323
+ case "channel": return `${approval.requestingShip} mentioned you in ${approval.channelNest}:${preview}\n\n` + formatApprovalInstructions(approval.id);
1324
+ case "group": return `Group invite from ${approval.requestingShip} to join ${approval.groupFlag}\n\n` + formatApprovalInstructions(approval.id);
1319
1325
  }
1320
1326
  throw new Error("Unsupported approval type");
1321
1327
  }
@@ -1328,8 +1334,7 @@ function parseApprovalResponse(text) {
1328
1334
  };
1329
1335
  }
1330
1336
  function findPendingApproval(pendingApprovals, id) {
1331
- if (id) return pendingApprovals.find((a) => a.id === id);
1332
- return pendingApprovals[pendingApprovals.length - 1];
1337
+ return id ? pendingApprovals.find((approval) => approval.id === id) : pendingApprovals.length === 1 ? pendingApprovals[0] : void 0;
1333
1338
  }
1334
1339
  function removePendingApproval(pendingApprovals, id) {
1335
1340
  return pendingApprovals.filter((a) => a.id !== id);
@@ -1510,7 +1515,7 @@ function createTlonApprovalRuntime(params) {
1510
1515
  runtime.log?.(`[tlon] Pending approval limit reached; ignoring ${approval.type} request from ${approval.requestingShip}`);
1511
1516
  if (!approvalOverflowNoticeSent && approvalOverflowNoticeAttempts < 3) {
1512
1517
  approvalOverflowNoticeAttempts += 1;
1513
- approvalOverflowNoticeSent = await sendOwnerNotification(`Pending approval queue is full (${approvals.length}). Resolve existing requests with approve, deny, or block before asking rejected requesters to retry.`);
1518
+ approvalOverflowNoticeSent = await sendOwnerNotification(`Pending approval queue is full (${approvals.length}). Resolve existing requests by replying with approve, deny, or block followed by the request ID before asking rejected requesters to retry.`);
1514
1519
  }
1515
1520
  return false;
1516
1521
  }
@@ -1527,7 +1532,7 @@ function createTlonApprovalRuntime(params) {
1527
1532
  if (!parsed) return false;
1528
1533
  const approval = findPendingApproval(state.pendingApprovals, parsed.id);
1529
1534
  if (!approval) {
1530
- await sendOwnerNotification(`No pending approval found${parsed.id ? ` for ID: ${parsed.id}` : ""}`);
1535
+ await sendOwnerNotification(parsed.id ? `No pending approval found for ID: ${parsed.id}` : state.pendingApprovals.length > 1 ? `Multiple approvals are pending. Include an approval ID with your decision.\n\n${formatPendingList(state.pendingApprovals)}` : "No pending approval found.");
1531
1536
  return true;
1532
1537
  }
1533
1538
  if (parsed.action === "approve") switch (approval.type) {
@@ -1862,6 +1867,8 @@ function formatSummarizationHistoryText(history, cfg) {
1862
1867
  //#region extensions/tlon/src/monitor/cites.ts
1863
1868
  const CITE_PATH_SEGMENT_RE = /^[A-Za-z0-9._~-]+$/;
1864
1869
  const CITE_PATH_NORMALIZATION_BASE = "https://tlon.invalid";
1870
+ const CITATION_SCOPE_SKIP_LOG = "[tlon] Skipping cited post: citation is outside explicit channel scope";
1871
+ var CitationScopeChangedError = class extends Error {};
1865
1872
  function isSafeCitePathSegment(segment) {
1866
1873
  if (segment === "." || segment === "..") return false;
1867
1874
  return CITE_PATH_SEGMENT_RE.test(segment);
@@ -1881,7 +1888,7 @@ function buildCitedPostScryPath(nest, postId) {
1881
1888
  if (new URL(scryPath, CITE_PATH_NORMALIZATION_BASE).pathname !== scryPath) return null;
1882
1889
  return scryPath;
1883
1890
  }
1884
- async function resolveTlonCitations(content, api, runtime) {
1891
+ async function resolveTlonCitations(content, canExpandNest, api, runtime) {
1885
1892
  if (!Array.isArray(content)) return "";
1886
1893
  const resolved = [];
1887
1894
  for (const verse of content) {
@@ -1891,6 +1898,10 @@ async function resolveTlonCitations(content, api, runtime) {
1891
1898
  const whereMatch = readStringField(chan, "where")?.match(/\/msg\/(~[a-z-]+)\/(.+)/);
1892
1899
  const postId = whereMatch?.[2];
1893
1900
  if (!nest || !postId) continue;
1901
+ if (!canExpandNest(nest)) {
1902
+ runtime.log?.(CITATION_SCOPE_SKIP_LOG);
1903
+ continue;
1904
+ }
1894
1905
  const scryPath = buildCitedPostScryPath(nest, postId);
1895
1906
  if (!scryPath) {
1896
1907
  runtime.log?.("[tlon] Skipping cited post: citation does not name a channel post");
@@ -1898,11 +1909,21 @@ async function resolveTlonCitations(content, api, runtime) {
1898
1909
  }
1899
1910
  try {
1900
1911
  runtime.log?.(`[tlon] Fetching cited post: ${scryPath}`);
1901
- const data = asNullableRecord(await api.scry(scryPath));
1912
+ const data = asNullableRecord(await api.scry(scryPath, () => {
1913
+ if (!canExpandNest(nest)) throw new CitationScopeChangedError();
1914
+ }));
1915
+ if (!canExpandNest(nest)) {
1916
+ runtime.log?.(CITATION_SCOPE_SKIP_LOG);
1917
+ continue;
1918
+ }
1902
1919
  const essay = asNullableRecord(data?.essay);
1903
1920
  const text = essay?.content ? extractMessageText(essay.content) : "";
1904
1921
  if (text) resolved.push(`> ${whereMatch?.[1] || "unknown"} wrote: ${text}`);
1905
1922
  } catch (err) {
1923
+ if (err instanceof CitationScopeChangedError) {
1924
+ runtime.log?.(CITATION_SCOPE_SKIP_LOG);
1925
+ continue;
1926
+ }
1906
1927
  runtime.log?.(`[tlon] Failed to fetch cited post: ${String(err)}`);
1907
1928
  }
1908
1929
  }
@@ -2421,6 +2442,7 @@ function applyTlonSettingsOverrides(params) {
2421
2442
  effectiveAutoAcceptDmInvites: settings.autoAcceptDmInvites ?? account.autoAcceptDmInvites ?? false,
2422
2443
  effectiveAutoAcceptGroupInvites: settings.autoAcceptGroupInvites ?? account.autoAcceptGroupInvites ?? false,
2423
2444
  effectiveGroupInviteAllowlist: settings.groupInviteAllowlist ?? account.groupInviteAllowlist,
2445
+ explicitChannels: mergeUniqueStrings(account.groupChannels, settings.groupChannels),
2424
2446
  effectiveAutoDiscoverChannels: settings.autoDiscoverChannels ?? account.autoDiscoverChannels ?? false,
2425
2447
  effectiveOwnerShip,
2426
2448
  pendingApprovals: settings.pendingApprovals?.length ? settings.pendingApprovals : [],
@@ -2430,6 +2452,21 @@ function applyTlonSettingsOverrides(params) {
2430
2452
  function mergeUniqueStrings(base, next) {
2431
2453
  return uniqueStrings([...base, ...next ?? []]);
2432
2454
  }
2455
+ function createTlonSettingsInstaller(state, account, log) {
2456
+ return (currentSettings, preserveApprovalState = false) => {
2457
+ const pendingApprovals = state.pendingApprovals;
2458
+ const effectiveDmAllowlist = state.effectiveDmAllowlist;
2459
+ Object.assign(state, applyTlonSettingsOverrides({
2460
+ account,
2461
+ currentSettings,
2462
+ log
2463
+ }));
2464
+ if (preserveApprovalState) {
2465
+ state.pendingApprovals = pendingApprovals;
2466
+ state.effectiveDmAllowlist = effectiveDmAllowlist;
2467
+ }
2468
+ };
2469
+ }
2433
2470
  //#endregion
2434
2471
  //#region extensions/tlon/src/monitor/tracking.ts
2435
2472
  const TLON_PARTICIPATED_THREAD_LIMIT = 2e3;
@@ -2531,6 +2568,7 @@ async function monitorTlonProvider(opts) {
2531
2568
  account,
2532
2569
  currentSettings: {}
2533
2570
  });
2571
+ const installSettings = createTlonSettingsInstaller(settingsState, account, (message) => runtime.log?.(message));
2534
2572
  const participatedThreads = createParticipatedThreadTracker();
2535
2573
  const channelHistory = createChannelHistoryCache();
2536
2574
  const dmSendersBySession = /* @__PURE__ */ new Map();
@@ -2554,11 +2592,7 @@ async function monitorTlonProvider(opts) {
2554
2592
  } catch (err) {
2555
2593
  runtime.log?.(`[tlon] Failed to migrate ${key}: ${String(err)}`);
2556
2594
  }
2557
- Object.assign(settingsState, applyTlonSettingsOverrides({
2558
- account,
2559
- currentSettings: settingsState.currentSettings,
2560
- log: (message) => runtime.log?.(message)
2561
- }));
2595
+ installSettings(settingsState.currentSettings);
2562
2596
  } catch (err) {
2563
2597
  runtime.log?.(`[tlon] Settings store not available, using file config: ${String(err)}`);
2564
2598
  }
@@ -2825,6 +2859,7 @@ async function monitorTlonProvider(opts) {
2825
2859
  });
2826
2860
  };
2827
2861
  const watchedChannels = new Set(groupChannels);
2862
+ const canExpandCitedNest = (nest) => settingsState.effectiveAutoDiscoverChannels || settingsState.explicitChannels.includes(nest);
2828
2863
  const addWatchedChannels = (channels, logPrefix) => {
2829
2864
  const previousCount = watchedChannels.size;
2830
2865
  for (const channelNest of channels) if (!watchedChannels.has(channelNest)) {
@@ -2950,7 +2985,7 @@ async function monitorTlonProvider(opts) {
2950
2985
  } else runtime.log?.(`[tlon] Access denied: ${senderShip} in ${nest} (allowed: ${allowedShips.join(", ")})`);
2951
2986
  return;
2952
2987
  }
2953
- const messageText = await resolveTlonCitations(contentBody, api, runtime) + rawText;
2988
+ const messageText = await resolveTlonCitations(contentBody, canExpandCitedNest, api, runtime) + rawText;
2954
2989
  await processMessage({
2955
2990
  messageId,
2956
2991
  senderShip,
@@ -3083,7 +3118,8 @@ async function monitorTlonProvider(opts) {
3083
3118
  } else runtime.log?.(`[tlon] Blocked DM from ${senderShip}: not in allowlist`);
3084
3119
  return;
3085
3120
  }
3086
- const resolvedMessageText = await resolveTlonCitations(essay.content, api, runtime) + rawText;
3121
+ const canExpandDmCitedNest = (nest) => !isClubMessage && isOwner(senderShip) || canExpandCitedNest(nest);
3122
+ const resolvedMessageText = await resolveTlonCitations(essay.content, canExpandDmCitedNest, api, runtime) + rawText;
3087
3123
  if (ownerDm) runtime.log?.(`[tlon] Processing DM from owner ${senderShip}`);
3088
3124
  await processMessage({
3089
3125
  messageText: resolvedMessageText,
@@ -3178,11 +3214,7 @@ async function monitorTlonProvider(opts) {
3178
3214
  await settingsManager.startSubscription((newSettings) => {
3179
3215
  settingsState.currentSettings = newSettings;
3180
3216
  addWatchedChannels(newSettings.groupChannels ?? [], "[tlon] Settings: now watching channel ");
3181
- Object.assign(settingsState, applyTlonSettingsOverrides({
3182
- account,
3183
- currentSettings: newSettings,
3184
- log: (message) => runtime.log?.(message)
3185
- }));
3217
+ installSettings(newSettings);
3186
3218
  });
3187
3219
  } catch (err) {
3188
3220
  runtime.log?.(`[tlon] Settings subscription not available: ${String(err)}`);
@@ -3200,15 +3232,16 @@ async function monitorTlonProvider(opts) {
3200
3232
  const discoveredChannels = mergeUniqueStrings(Object.keys(asNullableRecord(eventRecord.channels) ?? {}), joinedChannels.filter((channel) => typeof channel === "string")).filter((channel) => channel.startsWith("chat/"));
3201
3233
  addWatchedChannels(discoveredChannels, "[tlon] Auto-detected new channel: ");
3202
3234
  if (!settingsState.effectiveAutoAcceptGroupInvites) return;
3203
- const currentChannels = settingsState.currentSettings.groupChannels ?? [];
3235
+ const settingsSnapshot = settingsState.currentSettings;
3236
+ const currentChannels = settingsSnapshot.groupChannels ?? [];
3204
3237
  const unpersistedChannels = discoveredChannels.filter((channel) => !currentChannels.includes(channel));
3205
3238
  if (unpersistedChannels.length === 0) return;
3206
3239
  const updatedChannels = mergeUniqueStrings(currentChannels, unpersistedChannels);
3207
3240
  await putTlonSetting(api, "groupChannels", updatedChannels);
3208
- settingsState.currentSettings = {
3209
- ...settingsState.currentSettings,
3241
+ if (settingsState.currentSettings === settingsSnapshot) installSettings({
3242
+ ...settingsSnapshot,
3210
3243
  groupChannels: updatedChannels
3211
- };
3244
+ }, true);
3212
3245
  runtime.log?.(`[tlon] Persisted ${unpersistedChannels.join(", ")} to settings store`);
3213
3246
  } catch (error) {
3214
3247
  runtime.error?.(`[tlon] Error handling groups-ui event: ${formatErrorMessage(error)}`);
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-C3JZ6wZF.mjs";
2
+ import { t as tlonPlugin } from "./.setup/channel-C2dWMDrp.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-C3JZ6wZF.mjs";
1
+ import { t as tlonPlugin } from "./.setup/channel-C2dWMDrp.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-DCWWT3CU.mjs", import.meta.url).href),
7
+ specifier: fileURLToPath(new URL(".setup/api-BywJShk3.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.11.2",
3
+ "version": "2026.11.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.11.2"
22
+ "openclaw": ">=2026.11.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.11.2"
124
+ "pluginApi": ">=2026.11.4"
125
125
  },
126
126
  "build": {
127
- "openclawVersion": "2026.11.2"
127
+ "openclawVersion": "2026.11.4"
128
128
  },
129
129
  "release": {
130
130
  "bundleRuntimeDependencies": false,