@openclaw/tlon 2026.11.3 → 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-BtaSROL1.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-BfYxNfpN.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
  });
@@ -1864,6 +1867,8 @@ function formatSummarizationHistoryText(history, cfg) {
1864
1867
  //#region extensions/tlon/src/monitor/cites.ts
1865
1868
  const CITE_PATH_SEGMENT_RE = /^[A-Za-z0-9._~-]+$/;
1866
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 {};
1867
1872
  function isSafeCitePathSegment(segment) {
1868
1873
  if (segment === "." || segment === "..") return false;
1869
1874
  return CITE_PATH_SEGMENT_RE.test(segment);
@@ -1883,7 +1888,7 @@ function buildCitedPostScryPath(nest, postId) {
1883
1888
  if (new URL(scryPath, CITE_PATH_NORMALIZATION_BASE).pathname !== scryPath) return null;
1884
1889
  return scryPath;
1885
1890
  }
1886
- async function resolveTlonCitations(content, api, runtime) {
1891
+ async function resolveTlonCitations(content, canExpandNest, api, runtime) {
1887
1892
  if (!Array.isArray(content)) return "";
1888
1893
  const resolved = [];
1889
1894
  for (const verse of content) {
@@ -1893,6 +1898,10 @@ async function resolveTlonCitations(content, api, runtime) {
1893
1898
  const whereMatch = readStringField(chan, "where")?.match(/\/msg\/(~[a-z-]+)\/(.+)/);
1894
1899
  const postId = whereMatch?.[2];
1895
1900
  if (!nest || !postId) continue;
1901
+ if (!canExpandNest(nest)) {
1902
+ runtime.log?.(CITATION_SCOPE_SKIP_LOG);
1903
+ continue;
1904
+ }
1896
1905
  const scryPath = buildCitedPostScryPath(nest, postId);
1897
1906
  if (!scryPath) {
1898
1907
  runtime.log?.("[tlon] Skipping cited post: citation does not name a channel post");
@@ -1900,11 +1909,21 @@ async function resolveTlonCitations(content, api, runtime) {
1900
1909
  }
1901
1910
  try {
1902
1911
  runtime.log?.(`[tlon] Fetching cited post: ${scryPath}`);
1903
- 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
+ }
1904
1919
  const essay = asNullableRecord(data?.essay);
1905
1920
  const text = essay?.content ? extractMessageText(essay.content) : "";
1906
1921
  if (text) resolved.push(`> ${whereMatch?.[1] || "unknown"} wrote: ${text}`);
1907
1922
  } catch (err) {
1923
+ if (err instanceof CitationScopeChangedError) {
1924
+ runtime.log?.(CITATION_SCOPE_SKIP_LOG);
1925
+ continue;
1926
+ }
1908
1927
  runtime.log?.(`[tlon] Failed to fetch cited post: ${String(err)}`);
1909
1928
  }
1910
1929
  }
@@ -2423,6 +2442,7 @@ function applyTlonSettingsOverrides(params) {
2423
2442
  effectiveAutoAcceptDmInvites: settings.autoAcceptDmInvites ?? account.autoAcceptDmInvites ?? false,
2424
2443
  effectiveAutoAcceptGroupInvites: settings.autoAcceptGroupInvites ?? account.autoAcceptGroupInvites ?? false,
2425
2444
  effectiveGroupInviteAllowlist: settings.groupInviteAllowlist ?? account.groupInviteAllowlist,
2445
+ explicitChannels: mergeUniqueStrings(account.groupChannels, settings.groupChannels),
2426
2446
  effectiveAutoDiscoverChannels: settings.autoDiscoverChannels ?? account.autoDiscoverChannels ?? false,
2427
2447
  effectiveOwnerShip,
2428
2448
  pendingApprovals: settings.pendingApprovals?.length ? settings.pendingApprovals : [],
@@ -2432,6 +2452,21 @@ function applyTlonSettingsOverrides(params) {
2432
2452
  function mergeUniqueStrings(base, next) {
2433
2453
  return uniqueStrings([...base, ...next ?? []]);
2434
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
+ }
2435
2470
  //#endregion
2436
2471
  //#region extensions/tlon/src/monitor/tracking.ts
2437
2472
  const TLON_PARTICIPATED_THREAD_LIMIT = 2e3;
@@ -2533,6 +2568,7 @@ async function monitorTlonProvider(opts) {
2533
2568
  account,
2534
2569
  currentSettings: {}
2535
2570
  });
2571
+ const installSettings = createTlonSettingsInstaller(settingsState, account, (message) => runtime.log?.(message));
2536
2572
  const participatedThreads = createParticipatedThreadTracker();
2537
2573
  const channelHistory = createChannelHistoryCache();
2538
2574
  const dmSendersBySession = /* @__PURE__ */ new Map();
@@ -2556,11 +2592,7 @@ async function monitorTlonProvider(opts) {
2556
2592
  } catch (err) {
2557
2593
  runtime.log?.(`[tlon] Failed to migrate ${key}: ${String(err)}`);
2558
2594
  }
2559
- Object.assign(settingsState, applyTlonSettingsOverrides({
2560
- account,
2561
- currentSettings: settingsState.currentSettings,
2562
- log: (message) => runtime.log?.(message)
2563
- }));
2595
+ installSettings(settingsState.currentSettings);
2564
2596
  } catch (err) {
2565
2597
  runtime.log?.(`[tlon] Settings store not available, using file config: ${String(err)}`);
2566
2598
  }
@@ -2827,6 +2859,7 @@ async function monitorTlonProvider(opts) {
2827
2859
  });
2828
2860
  };
2829
2861
  const watchedChannels = new Set(groupChannels);
2862
+ const canExpandCitedNest = (nest) => settingsState.effectiveAutoDiscoverChannels || settingsState.explicitChannels.includes(nest);
2830
2863
  const addWatchedChannels = (channels, logPrefix) => {
2831
2864
  const previousCount = watchedChannels.size;
2832
2865
  for (const channelNest of channels) if (!watchedChannels.has(channelNest)) {
@@ -2952,7 +2985,7 @@ async function monitorTlonProvider(opts) {
2952
2985
  } else runtime.log?.(`[tlon] Access denied: ${senderShip} in ${nest} (allowed: ${allowedShips.join(", ")})`);
2953
2986
  return;
2954
2987
  }
2955
- const messageText = await resolveTlonCitations(contentBody, api, runtime) + rawText;
2988
+ const messageText = await resolveTlonCitations(contentBody, canExpandCitedNest, api, runtime) + rawText;
2956
2989
  await processMessage({
2957
2990
  messageId,
2958
2991
  senderShip,
@@ -3085,7 +3118,8 @@ async function monitorTlonProvider(opts) {
3085
3118
  } else runtime.log?.(`[tlon] Blocked DM from ${senderShip}: not in allowlist`);
3086
3119
  return;
3087
3120
  }
3088
- 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;
3089
3123
  if (ownerDm) runtime.log?.(`[tlon] Processing DM from owner ${senderShip}`);
3090
3124
  await processMessage({
3091
3125
  messageText: resolvedMessageText,
@@ -3180,11 +3214,7 @@ async function monitorTlonProvider(opts) {
3180
3214
  await settingsManager.startSubscription((newSettings) => {
3181
3215
  settingsState.currentSettings = newSettings;
3182
3216
  addWatchedChannels(newSettings.groupChannels ?? [], "[tlon] Settings: now watching channel ");
3183
- Object.assign(settingsState, applyTlonSettingsOverrides({
3184
- account,
3185
- currentSettings: newSettings,
3186
- log: (message) => runtime.log?.(message)
3187
- }));
3217
+ installSettings(newSettings);
3188
3218
  });
3189
3219
  } catch (err) {
3190
3220
  runtime.log?.(`[tlon] Settings subscription not available: ${String(err)}`);
@@ -3202,15 +3232,16 @@ async function monitorTlonProvider(opts) {
3202
3232
  const discoveredChannels = mergeUniqueStrings(Object.keys(asNullableRecord(eventRecord.channels) ?? {}), joinedChannels.filter((channel) => typeof channel === "string")).filter((channel) => channel.startsWith("chat/"));
3203
3233
  addWatchedChannels(discoveredChannels, "[tlon] Auto-detected new channel: ");
3204
3234
  if (!settingsState.effectiveAutoAcceptGroupInvites) return;
3205
- const currentChannels = settingsState.currentSettings.groupChannels ?? [];
3235
+ const settingsSnapshot = settingsState.currentSettings;
3236
+ const currentChannels = settingsSnapshot.groupChannels ?? [];
3206
3237
  const unpersistedChannels = discoveredChannels.filter((channel) => !currentChannels.includes(channel));
3207
3238
  if (unpersistedChannels.length === 0) return;
3208
3239
  const updatedChannels = mergeUniqueStrings(currentChannels, unpersistedChannels);
3209
3240
  await putTlonSetting(api, "groupChannels", updatedChannels);
3210
- settingsState.currentSettings = {
3211
- ...settingsState.currentSettings,
3241
+ if (settingsState.currentSettings === settingsSnapshot) installSettings({
3242
+ ...settingsSnapshot,
3212
3243
  groupChannels: updatedChannels
3213
- };
3244
+ }, true);
3214
3245
  runtime.log?.(`[tlon] Persisted ${unpersistedChannels.join(", ")} to settings store`);
3215
3246
  } catch (error) {
3216
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-BtaSROL1.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-BtaSROL1.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-CjtitEAT.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.3",
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.3"
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.3"
124
+ "pluginApi": ">=2026.11.4"
125
125
  },
126
126
  "build": {
127
- "openclawVersion": "2026.11.3"
127
+ "openclawVersion": "2026.11.4"
128
128
  },
129
129
  "release": {
130
130
  "bundleRuntimeDependencies": false,