@openclaw/tlon 2026.10.10 → 2026.10.33

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-DwKKUzwx.mjs";
3
- import { n as setTlonRuntime } from "./runtime-ReERXJF_.mjs";
2
+ import { t as tlonPlugin } from "./channel-C2dWMDrp.mjs";
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 };
@@ -1,5 +1,5 @@
1
- import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-CfYeTj9o.mjs";
2
- import { c as resolveTlonAccount, f as parseTlonTarget, i as tlonSetupContract, l as formatTargetHint, n as createTlonSetupWizardBase, p as resolveTlonOutboundTarget, s as listTlonAccountIds, u as normalizeShip } from "./setup-core-DnIfSMDp.mjs";
1
+ import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-bInPRAQZ.mjs";
2
+ import { c as resolveTlonAccount, f as parseTlonTarget, i as tlonSetupContract, l as formatTargetHint, n as createTlonSetupWizardBase, p as resolveTlonOutboundTarget, s as listTlonAccountIds, u as normalizeShip } from "./setup-core-kO8u8noA.mjs";
3
3
  import { buildChannelOutboundSessionRoute } from "openclaw/plugin-sdk/core";
4
4
  import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
5
5
  import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id";
@@ -11,7 +11,7 @@ import { createComputedAccountStatusAdapter, createDefaultChannelRuntimeState }
11
11
  import { chunkTextForOutbound, sanitizeAssistantVisibleText } from "openclaw/plugin-sdk/text-chunking";
12
12
  import { ChannelImplicitMentionsSchema, buildChannelConfigSchema } from "openclaw/plugin-sdk/channel-config-schema";
13
13
  import { z } from "zod";
14
- // extensions/tlon/src/config-schema.ts
14
+ //#region extensions/tlon/src/config-schema.ts
15
15
  const ShipSchema = z.string().min(1);
16
16
  const ChannelNestSchema = z.string().min(1);
17
17
  const TlonChannelRuleSchema = z.object({
@@ -63,12 +63,14 @@ const tlonChannelConfigSchema = buildChannelConfigSchema(TlonConfigSchema, { uiH
63
63
  "accounts.*.requireMentionInBotThreads": botThreadMentionHint,
64
64
  "authorization.channelRules.*.requireMentionInBotThreads": botThreadMentionHint
65
65
  } });
66
- // extensions/tlon/src/doctor.ts
66
+ //#endregion
67
+ //#region extensions/tlon/src/doctor.ts
67
68
  const tlonDoctor = {
68
69
  legacyConfigRules,
69
70
  normalizeCompatibilityConfig
70
71
  };
71
- // extensions/tlon/src/session-route.ts
72
+ //#endregion
73
+ //#region extensions/tlon/src/session-route.ts
72
74
  function resolveTlonOutboundSessionRoute(params) {
73
75
  const parsed = parseTlonTarget(params.target);
74
76
  if (!parsed) return null;
@@ -89,9 +91,10 @@ function resolveTlonOutboundSessionRoute(params) {
89
91
  to: `tlon:${peerId}`
90
92
  });
91
93
  }
92
- // extensions/tlon/src/channel.ts
94
+ //#endregion
95
+ //#region extensions/tlon/src/channel.ts
93
96
  const TLON_CHANNEL_ID = "tlon";
94
- const loadTlonChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-CdWyxE8W.mjs"));
97
+ const loadTlonChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-DeZaAXos.mjs"));
95
98
  const tlonSetupWizardProxy = createTlonSetupWizardBase(async (params) => await (await loadTlonChannelRuntime()).tlonSetupWizard.finalize(params));
96
99
  const tlonConfigAdapter = createHybridChannelConfigAdapter({
97
100
  sectionKey: TLON_CHANNEL_ID,
@@ -237,4 +240,5 @@ const tlonPlugin = createChatChannelPlugin({
237
240
  },
238
241
  outbound: tlonChannelOutbound
239
242
  });
243
+ //#endregion
240
244
  export { tlonPlugin as t };
@@ -1,10 +1,10 @@
1
- import { i as __reExport, r as __exportAll } from "./doctor-contract-CfYeTj9o.mjs";
1
+ import { i as __reExport, r as __exportAll } from "./doctor-contract-bInPRAQZ.mjs";
2
2
  import { createDedupeCache, createLoggerBackedRuntime } from "../runtime-api.js";
3
- import { c as resolveTlonAccount, d as parseChannelNest, f as parseTlonTarget, l as formatTargetHint, o as validateUrbitBaseUrl, u as normalizeShip } from "./setup-core-DnIfSMDp.mjs";
4
- import { t as getTlonRuntime } from "./runtime-ReERXJF_.mjs";
5
- import { t as tlonSetupWizard } from "./setup-surface-CTiMlwQy.mjs";
3
+ import { c as resolveTlonAccount, d as parseChannelNest, f as parseTlonTarget, l as formatTargetHint, o as validateUrbitBaseUrl, u as normalizeShip } from "./setup-core-kO8u8noA.mjs";
4
+ import { t as getTlonRuntime } from "./runtime-Ck3lNvST.mjs";
5
+ import { t as tlonSetupWizard } from "./setup-surface-Byac6RoF.mjs";
6
6
  import { fetchWithSsrFGuard, ssrfPolicyFromDangerouslyAllowPrivateNetwork } from "openclaw/plugin-sdk/ssrf-runtime";
7
- import { bindIngressLifecycleToReplyOptions, createChannelIngressError, createChannelIngressMonitor, createMessageReceiptFromOutboundResults, waitUntilAbort } from "openclaw/plugin-sdk/channel-outbound";
7
+ import { bindIngressLifecycleToReplyOptions, createArmableStallWatchdog, createChannelIngressError, createChannelIngressMonitor, createMessageReceiptFromOutboundResults, waitUntilAbort } from "openclaw/plugin-sdk/channel-outbound";
8
8
  import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
9
9
  import { asBoolean, asFiniteNumber, asNullableRecord, filterStringEntries, normalizeLowercaseStringOrEmpty, normalizeNullableString, readStringField, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
10
10
  import crypto, { randomBytes, randomUUID } from "node:crypto";
@@ -25,7 +25,7 @@ import { bufferToBlobPart } from "openclaw/plugin-sdk/blob-runtime";
25
25
  import { PutObjectCommand, S3Client } from "@aws-sdk/client-s3";
26
26
  import { getSignedUrl } from "@aws-sdk/s3-request-presigner";
27
27
  import { extensionForMime } from "openclaw/plugin-sdk/media-mime";
28
- // extensions/tlon/src/settings.ts
28
+ //#region extensions/tlon/src/settings.ts
29
29
  const SETTINGS_DESK = "moltbot";
30
30
  const SETTINGS_BUCKET = "tlon";
31
31
  function parseJsonSetting(value) {
@@ -147,12 +147,14 @@ function createSettingsManager(api, logger) {
147
147
  }
148
148
  };
149
149
  }
150
- // extensions/tlon/src/urbit/redact.ts
150
+ //#endregion
151
+ //#region extensions/tlon/src/urbit/redact.ts
151
152
  const URBIT_COOKIE_REFLECTION_RE = /\burbauth-[a-z0-9~-]+=[^\s"'(),;]+/gi;
152
153
  function redactUrbitErrorText(text) {
153
154
  return redactToolPayloadText(text).replace(URBIT_COOKIE_REFLECTION_RE, "***");
154
155
  }
155
- // extensions/tlon/src/urbit/errors.ts
156
+ //#endregion
157
+ //#region extensions/tlon/src/urbit/errors.ts
156
158
  var UrbitError = class extends Error {
157
159
  constructor(code, message, options) {
158
160
  super(message, options);
@@ -183,7 +185,8 @@ var UrbitAuthError = class extends UrbitError {
183
185
  this.name = "UrbitAuthError";
184
186
  }
185
187
  };
186
- // extensions/tlon/src/urbit/fetch.ts
188
+ //#endregion
189
+ //#region extensions/tlon/src/urbit/fetch.ts
187
190
  async function urbitFetch(params) {
188
191
  const validated = validateUrbitBaseUrl(params.baseUrl);
189
192
  if (!validated.ok) throw new UrbitUrlError(validated.error);
@@ -208,7 +211,8 @@ async function urbitFetch(params) {
208
211
  }
209
212
  };
210
213
  }
211
- // extensions/tlon/src/urbit/auth.ts
214
+ //#endregion
215
+ //#region extensions/tlon/src/urbit/auth.ts
212
216
  const MAX_AUTH_BODY_DRAIN_BYTES = 65536;
213
217
  async function authenticate(url, code, options = {}) {
214
218
  const { response, release } = await urbitFetch({
@@ -237,7 +241,8 @@ async function authenticate(url, code, options = {}) {
237
241
  await release();
238
242
  }
239
243
  }
240
- // extensions/tlon/src/urbit/context.ts
244
+ //#endregion
245
+ //#region extensions/tlon/src/urbit/context.ts
241
246
  function normalizeUrbitCookie(cookie) {
242
247
  return cookie.split(";")[0] ?? cookie;
243
248
  }
@@ -250,7 +255,8 @@ function getUrbitContext(url, ship) {
250
255
  ship: (ship?.replace(/^~/, "") ?? validated.hostname.split(".")[0] ?? validated.hostname).trim()
251
256
  };
252
257
  }
253
- // extensions/tlon/src/urbit/story.ts
258
+ //#endregion
259
+ //#region extensions/tlon/src/urbit/story.ts
254
260
  function matchMarkdownDestination(text, image) {
255
261
  const prefix = (image ? /^!\[([^\]]*)\]\(/ : /^\[([^\]]+)\]\(/).exec(text);
256
262
  if (!prefix) return null;
@@ -646,7 +652,8 @@ function markdownToStory(markdown) {
646
652
  }
647
653
  return story;
648
654
  }
649
- // extensions/tlon/src/urbit/send.ts
655
+ //#endregion
656
+ //#region extensions/tlon/src/urbit/send.ts
650
657
  function createTlonSendReceipt(params) {
651
658
  return createMessageReceiptFromOutboundResults({
652
659
  results: [{
@@ -754,7 +761,8 @@ function buildMediaStory(text, mediaUrl) {
754
761
  } }] });
755
762
  return story.length > 0 ? story : [{ inline: [""] }];
756
763
  }
757
- // extensions/tlon/src/urbit/channel-ops.ts
764
+ //#endregion
765
+ //#region extensions/tlon/src/urbit/channel-ops.ts
758
766
  async function putUrbitChannel(deps, params) {
759
767
  return await urbitFetch({
760
768
  baseUrl: deps.baseUrl,
@@ -865,9 +873,11 @@ async function ensureUrbitChannelOpen(deps, params) {
865
873
  beforeRequest: params.beforeRequest
866
874
  });
867
875
  }
868
- // extensions/tlon/src/urbit/sse-client.ts
876
+ //#endregion
877
+ //#region extensions/tlon/src/urbit/sse-client.ts
869
878
  const MAX_SSE_PAYLOAD_BYTES = 16777216;
870
879
  const MAX_RECONNECT_ATTEMPTS = 10;
880
+ const SSE_STALL_TIMEOUT_MS = 6e4;
871
881
  function parseUrbitSsePayload(data) {
872
882
  if (Buffer.byteLength(data, "utf8") > MAX_SSE_PAYLOAD_BYTES) throw new Error("Tlon Urbit SSE payload exceeds 16 MiB limit");
873
883
  try {
@@ -1026,6 +1036,17 @@ var UrbitSSEClient = class {
1026
1036
  async processStream(body) {
1027
1037
  if (!body) return;
1028
1038
  const stream = body instanceof ReadableStream ? Readable.fromWeb(body) : body;
1039
+ const streamController = this.streamController;
1040
+ const watchdog = createArmableStallWatchdog({
1041
+ label: "tlon-sse",
1042
+ timeoutMs: SSE_STALL_TIMEOUT_MS,
1043
+ onTimeout: ({ idleMs }) => {
1044
+ const error = /* @__PURE__ */ new Error(`Tlon Urbit SSE stream stalled: no data for ${Math.round(idleMs / 1e3)}s`);
1045
+ streamController?.abort(error);
1046
+ if (stream instanceof Readable) stream.destroy(error);
1047
+ }
1048
+ });
1049
+ watchdog.arm();
1029
1050
  const decoder = new TextDecoder();
1030
1051
  let buffer = "";
1031
1052
  let bufferBytes = 0;
@@ -1073,13 +1094,16 @@ var UrbitSSEClient = class {
1073
1094
  try {
1074
1095
  for await (const chunk of stream) {
1075
1096
  if (this.aborted) break;
1097
+ watchdog.disarm();
1076
1098
  if (typeof chunk === "string") {
1077
1099
  await consumeText(decoder.decode());
1078
1100
  await consumeText(chunk);
1079
1101
  } else await consumeText(decoder.decode(chunk, { stream: true }));
1102
+ watchdog.arm();
1080
1103
  }
1081
1104
  await consumeText(decoder.decode());
1082
1105
  } finally {
1106
+ watchdog.stop();
1083
1107
  if (this.streamRelease) {
1084
1108
  const release = this.streamRelease;
1085
1109
  this.streamRelease = null;
@@ -1140,8 +1164,11 @@ var UrbitSSEClient = class {
1140
1164
  auditContext: "tlon-urbit-poke"
1141
1165
  });
1142
1166
  }
1143
- async scry(path) {
1144
- return await scryUrbitPath(this.channelRequestContext(), {
1167
+ async scry(path, beforeRequest) {
1168
+ return await scryUrbitPath({
1169
+ ...this.channelRequestContext(),
1170
+ beforeRequest
1171
+ }, {
1145
1172
  path,
1146
1173
  auditContext: "tlon-urbit-scry"
1147
1174
  });
@@ -1258,7 +1285,8 @@ var UrbitSSEClient = class {
1258
1285
  }
1259
1286
  }
1260
1287
  };
1261
- // extensions/tlon/src/monitor/approval.ts
1288
+ //#endregion
1289
+ //#region extensions/tlon/src/monitor/approval.ts
1262
1290
  function generateApprovalId(type) {
1263
1291
  return `${type}-${Date.now()}-${randomBytes(3).toString("hex")}`;
1264
1292
  }
@@ -1280,17 +1308,20 @@ function truncate(text, maxLength) {
1280
1308
  if (text.length <= maxLength) return text;
1281
1309
  return sliceUtf16Safe(text, 0, maxLength - 3) + "...";
1282
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
+ }
1283
1314
  function formatApprovalRequest(approval) {
1284
1315
  const preview = approval.messagePreview ? `\n"${truncate(approval.messagePreview, 100)}"` : "";
1285
1316
  switch (approval.type) {
1286
1317
  case "dm":
1287
1318
  if (approval.clubId !== void 0) {
1288
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.`;
1289
- 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);
1290
1321
  }
1291
- return `New DM request from ${approval.requestingShip}:${preview}\n\nReply "approve", "deny", or "block" (ID: ${approval.id})`;
1292
- case "channel": return `${approval.requestingShip} mentioned you in ${approval.channelNest}:${preview}\n\nReply "approve", "deny", or "block"\n(ID: ${approval.id})`;
1293
- 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);
1294
1325
  }
1295
1326
  throw new Error("Unsupported approval type");
1296
1327
  }
@@ -1303,8 +1334,7 @@ function parseApprovalResponse(text) {
1303
1334
  };
1304
1335
  }
1305
1336
  function findPendingApproval(pendingApprovals, id) {
1306
- if (id) return pendingApprovals.find((a) => a.id === id);
1307
- return pendingApprovals[pendingApprovals.length - 1];
1337
+ return id ? pendingApprovals.find((approval) => approval.id === id) : pendingApprovals.length === 1 ? pendingApprovals[0] : void 0;
1308
1338
  }
1309
1339
  function removePendingApproval(pendingApprovals, id) {
1310
1340
  return pendingApprovals.filter((a) => a.id !== id);
@@ -1354,7 +1384,8 @@ function formatPendingList(approvals) {
1354
1384
  if (approvals.length === 0) return "No pending approval requests.";
1355
1385
  return `Pending approvals (${approvals.length}):\n${approvals.map((a) => `• ${a.id}: ${a.type} from ${a.requestingShip}`).join("\n")}`;
1356
1386
  }
1357
- // extensions/tlon/src/monitor/approval-runtime.ts
1387
+ //#endregion
1388
+ //#region extensions/tlon/src/monitor/approval-runtime.ts
1358
1389
  function createTlonApprovalRuntime(params) {
1359
1390
  const { api, runtime, botShipName, state, processApprovedMessage, refreshWatchedChannels } = params;
1360
1391
  let approvalOverflowNoticeSent = false;
@@ -1484,7 +1515,7 @@ function createTlonApprovalRuntime(params) {
1484
1515
  runtime.log?.(`[tlon] Pending approval limit reached; ignoring ${approval.type} request from ${approval.requestingShip}`);
1485
1516
  if (!approvalOverflowNoticeSent && approvalOverflowNoticeAttempts < 3) {
1486
1517
  approvalOverflowNoticeAttempts += 1;
1487
- 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.`);
1488
1519
  }
1489
1520
  return false;
1490
1521
  }
@@ -1501,7 +1532,7 @@ function createTlonApprovalRuntime(params) {
1501
1532
  if (!parsed) return false;
1502
1533
  const approval = findPendingApproval(state.pendingApprovals, parsed.id);
1503
1534
  if (!approval) {
1504
- 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.");
1505
1536
  return true;
1506
1537
  }
1507
1538
  if (parsed.action === "approve") switch (approval.type) {
@@ -1585,7 +1616,8 @@ function createTlonApprovalRuntime(params) {
1585
1616
  handleAdminCommand
1586
1617
  };
1587
1618
  }
1588
- // extensions/tlon/src/monitor/authorization.ts
1619
+ //#endregion
1620
+ //#region extensions/tlon/src/monitor/authorization.ts
1589
1621
  function resolveChannelAuthorization(cfg, channelNest, settings) {
1590
1622
  const tlonConfig = cfg.channels?.tlon;
1591
1623
  const fileRules = tlonConfig?.authorization?.channelRules ?? {};
@@ -1601,7 +1633,8 @@ function resolveChannelAuthorization(cfg, channelNest, settings) {
1601
1633
  requireMentionInBotThreads: typeof requireMentionInBotThreads === "boolean" ? requireMentionInBotThreads : void 0
1602
1634
  };
1603
1635
  }
1604
- // extensions/tlon/src/monitor/utils.ts
1636
+ //#endregion
1637
+ //#region extensions/tlon/src/monitor/utils.ts
1605
1638
  function formatModelName(modelString) {
1606
1639
  if (!modelString) return "AI";
1607
1640
  const modelName = modelString.includes("/") ? expectDefined(modelString.split("/").at(1), "provider/model second segment") : modelString;
@@ -1703,7 +1736,8 @@ function isGroupInviteAllowed(inviterShip, allowlist) {
1703
1736
  }]
1704
1737
  }).allowed;
1705
1738
  }
1706
- function renderInlineItem(item, topLevel = false) {
1739
+ const MAX_INLINE_DEPTH = 100;
1740
+ function renderInlineItem(item, topLevel = false, depth = 0) {
1707
1741
  if (typeof item === "string") return item;
1708
1742
  const record = asNullableRecord(item);
1709
1743
  if (!record) return "";
@@ -1723,14 +1757,29 @@ function renderInlineItem(item, topLevel = false) {
1723
1757
  const linkContent = readStringField(link, "content");
1724
1758
  return topLevel ? linkHref : linkContent || linkHref;
1725
1759
  }
1726
- if (Array.isArray(record.bold)) return `**${extractInlineText(record.bold)}**`;
1727
- if (Array.isArray(record.italics)) return `*${extractInlineText(record.italics)}*`;
1728
- if (Array.isArray(record.strike)) return `~~${extractInlineText(record.strike)}~~`;
1729
- if (topLevel && Array.isArray(record.blockquote)) return `> ${extractInlineText(record.blockquote)}`;
1730
- return "";
1731
- }
1732
- function extractInlineText(items) {
1733
- return items.map((item) => renderInlineItem(item)).join("");
1760
+ const bold = Array.isArray(record.bold) ? record.bold : void 0;
1761
+ const italics = Array.isArray(record.italics) ? record.italics : void 0;
1762
+ const strike = Array.isArray(record.strike) ? record.strike : void 0;
1763
+ const blockquote = topLevel && Array.isArray(record.blockquote) ? record.blockquote : void 0;
1764
+ const nested = bold ?? italics ?? strike ?? blockquote;
1765
+ if (!nested) return "";
1766
+ if (depth >= MAX_INLINE_DEPTH) return "";
1767
+ const inner = extractInlineText(nested, depth + 1);
1768
+ if (bold) return `**${inner}**`;
1769
+ if (italics) return `*${inner}*`;
1770
+ if (strike) return `~~${inner}~~`;
1771
+ return `> ${inner}`;
1772
+ }
1773
+ function extractInlineText(items, depth = 0) {
1774
+ return items.map((item) => renderInlineItem(item, false, depth)).join("");
1775
+ }
1776
+ function extractMessageTextSafely(content, runtime) {
1777
+ try {
1778
+ return extractMessageText(content);
1779
+ } catch (error) {
1780
+ runtime.log?.(`[tlon] Failed to extract message text: ${formatErrorMessage(error)}`);
1781
+ return "";
1782
+ }
1734
1783
  }
1735
1784
  function extractMessageText(content) {
1736
1785
  if (!Array.isArray(content)) return "";
@@ -1814,9 +1863,12 @@ function formatSummarizationHistoryText(history, cfg) {
1814
1863
  envelope: envelopeOptions
1815
1864
  })).join("\n");
1816
1865
  }
1817
- // extensions/tlon/src/monitor/cites.ts
1866
+ //#endregion
1867
+ //#region extensions/tlon/src/monitor/cites.ts
1818
1868
  const CITE_PATH_SEGMENT_RE = /^[A-Za-z0-9._~-]+$/;
1819
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 {};
1820
1872
  function isSafeCitePathSegment(segment) {
1821
1873
  if (segment === "." || segment === "..") return false;
1822
1874
  return CITE_PATH_SEGMENT_RE.test(segment);
@@ -1836,7 +1888,7 @@ function buildCitedPostScryPath(nest, postId) {
1836
1888
  if (new URL(scryPath, CITE_PATH_NORMALIZATION_BASE).pathname !== scryPath) return null;
1837
1889
  return scryPath;
1838
1890
  }
1839
- async function resolveTlonCitations(content, api, runtime) {
1891
+ async function resolveTlonCitations(content, canExpandNest, api, runtime) {
1840
1892
  if (!Array.isArray(content)) return "";
1841
1893
  const resolved = [];
1842
1894
  for (const verse of content) {
@@ -1846,6 +1898,10 @@ async function resolveTlonCitations(content, api, runtime) {
1846
1898
  const whereMatch = readStringField(chan, "where")?.match(/\/msg\/(~[a-z-]+)\/(.+)/);
1847
1899
  const postId = whereMatch?.[2];
1848
1900
  if (!nest || !postId) continue;
1901
+ if (!canExpandNest(nest)) {
1902
+ runtime.log?.(CITATION_SCOPE_SKIP_LOG);
1903
+ continue;
1904
+ }
1849
1905
  const scryPath = buildCitedPostScryPath(nest, postId);
1850
1906
  if (!scryPath) {
1851
1907
  runtime.log?.("[tlon] Skipping cited post: citation does not name a channel post");
@@ -1853,17 +1909,28 @@ async function resolveTlonCitations(content, api, runtime) {
1853
1909
  }
1854
1910
  try {
1855
1911
  runtime.log?.(`[tlon] Fetching cited post: ${scryPath}`);
1856
- 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
+ }
1857
1919
  const essay = asNullableRecord(data?.essay);
1858
1920
  const text = essay?.content ? extractMessageText(essay.content) : "";
1859
1921
  if (text) resolved.push(`> ${whereMatch?.[1] || "unknown"} wrote: ${text}`);
1860
1922
  } catch (err) {
1923
+ if (err instanceof CitationScopeChangedError) {
1924
+ runtime.log?.(CITATION_SCOPE_SKIP_LOG);
1925
+ continue;
1926
+ }
1861
1927
  runtime.log?.(`[tlon] Failed to fetch cited post: ${String(err)}`);
1862
1928
  }
1863
1929
  }
1864
1930
  return resolved.length > 0 ? `${resolved.join("\n")}\n\n` : "";
1865
1931
  }
1866
- // extensions/tlon/src/monitor/discovery.ts
1932
+ //#endregion
1933
+ //#region extensions/tlon/src/monitor/discovery.ts
1867
1934
  /**
1868
1935
  * Fetch groups-ui init data, returning channels and foreigns.
1869
1936
  * This is a single scry that provides both channel discovery and pending invites.
@@ -1893,7 +1960,8 @@ async function fetchInitData(api, runtime) {
1893
1960
  };
1894
1961
  }
1895
1962
  }
1896
- // extensions/tlon/src/monitor/history.ts
1963
+ //#endregion
1964
+ //#region extensions/tlon/src/monitor/history.ts
1897
1965
  /**
1898
1966
  * Format a number as @ud (with dots every 3 digits from the right)
1899
1967
  * e.g., 170141184507799509469114119040828178432 -> 170.141.184.507.799.509.469.114.119.040.828.178.432
@@ -2026,10 +2094,25 @@ async function fetchThreadHistory(api, channelNest, parentId, count = 50, runtim
2026
2094
  return [];
2027
2095
  }
2028
2096
  }
2029
- // extensions/tlon/src/monitor/ingress.ts
2097
+ //#endregion
2098
+ //#region extensions/tlon/src/monitor/ingress.ts
2030
2099
  const TLON_INGRESS_PAYLOAD_VERSION = 1;
2031
2100
  const TLON_INGRESS_POLL_INTERVAL_MS = 1e3;
2032
2101
  const TlonIngressPermanentError = createChannelIngressError("TlonIngressPermanentError", { withReason: true });
2102
+ var TlonIngressUnserializableEventError = class extends Error {
2103
+ constructor(cause) {
2104
+ super("Tlon firehose event is too deeply nested to store.", { cause });
2105
+ this.name = "TlonIngressUnserializableEventError";
2106
+ }
2107
+ };
2108
+ function serializeTlonIngressEvent(event) {
2109
+ try {
2110
+ return JSON.stringify(event);
2111
+ } catch (error) {
2112
+ if (error instanceof RangeError) throw new TlonIngressUnserializableEventError(error);
2113
+ throw error;
2114
+ }
2115
+ }
2033
2116
  function inspectChannelsEvent(event) {
2034
2117
  const envelope = asNullableRecord(event);
2035
2118
  const nest = normalizeNullableString(envelope?.nest);
@@ -2107,7 +2190,7 @@ function createTlonIngressMonitor(options) {
2107
2190
  serialize: (raw, { receivedAt }) => ({
2108
2191
  receivedAt,
2109
2192
  source: raw.source,
2110
- rawEvent: JSON.stringify(raw.event)
2193
+ rawEvent: serializeTlonIngressEvent(raw.event)
2111
2194
  }),
2112
2195
  deserialize: (body, { claim }) => deserializeTlonIngressEvent(body, claim.id),
2113
2196
  encode: ({ body }) => ({
@@ -2136,22 +2219,32 @@ function createTlonIngressMonitor(options) {
2136
2219
  });
2137
2220
  return {
2138
2221
  receive: async ({ source, event }) => {
2139
- return { kind: (await monitor.admit({
2140
- source,
2141
- event
2142
- })).kind === "durable" ? "accepted" : "ignored" };
2222
+ try {
2223
+ return { kind: (await monitor.admit({
2224
+ source,
2225
+ event
2226
+ })).kind === "durable" ? "accepted" : "ignored" };
2227
+ } catch (error) {
2228
+ if (error instanceof TlonIngressUnserializableEventError) {
2229
+ options.runtime.log?.(`tlon dropped ${source} event: ${error.message}`);
2230
+ return { kind: "dropped" };
2231
+ }
2232
+ throw error;
2233
+ }
2143
2234
  },
2144
2235
  start: monitor.start,
2145
2236
  stop: monitor.stop,
2146
2237
  waitForIdle: monitor.waitForIdle
2147
2238
  };
2148
2239
  }
2149
- // extensions/tlon/src/media-fetch-timeouts.ts
2240
+ //#endregion
2241
+ //#region extensions/tlon/src/media-fetch-timeouts.ts
2150
2242
  const TLON_MEDIA_FETCH_TIMEOUTS = {
2151
2243
  responseHeaderTimeoutMs: 12e4,
2152
2244
  readIdleTimeoutMs: 3e4
2153
2245
  };
2154
- // extensions/tlon/src/monitor/media.ts
2246
+ //#endregion
2247
+ //#region extensions/tlon/src/monitor/media.ts
2155
2248
  const MAX_IMAGES_PER_MESSAGE = 8;
2156
2249
  /** Keeps Tlon's shipped path-duplicating prompt bytes paired with ordered facts. */
2157
2250
  function buildTlonInboundMediaPrompt(messageText, attachments) {
@@ -2221,7 +2314,8 @@ async function downloadMessageImages(content, maxBytes) {
2221
2314
  unavailableCount
2222
2315
  };
2223
2316
  }
2224
- // src/channels/mention-gating.ts
2317
+ //#endregion
2318
+ //#region src/channels/mention-gating.ts
2225
2319
  function resolveBotThreadMentionPolicy(params) {
2226
2320
  if (!params.isBotOwnedThread || params.requireMentionInBotThreads === void 0) return {
2227
2321
  requireMention: params.requireMention,
@@ -2232,11 +2326,13 @@ function resolveBotThreadMentionPolicy(params) {
2232
2326
  implicitMentionKinds: params.requireMentionInBotThreads ? params.implicitMentionKinds?.filter((kind) => kind === "native") : params.implicitMentionKinds
2233
2327
  };
2234
2328
  }
2235
- // \0openclaw:bundled-sdk:openclaw/plugin-sdk/channel-mention-gating
2329
+ //#endregion
2330
+ //#region \0openclaw:bundled-sdk:openclaw/plugin-sdk/channel-mention-gating
2236
2331
  var channel_mention_gating_exports = /* @__PURE__ */ __exportAll({ resolveBotThreadMentionPolicy: () => resolveBotThreadMentionPolicy });
2237
2332
  import * as import_openclaw_plugin_sdk_channel_mention_gating from "openclaw/plugin-sdk/channel-mention-gating";
2238
2333
  __reExport(channel_mention_gating_exports, import_openclaw_plugin_sdk_channel_mention_gating);
2239
- // extensions/tlon/src/monitor/mentions.ts
2334
+ //#endregion
2335
+ //#region extensions/tlon/src/monitor/mentions.ts
2240
2336
  function resolveTlonGroupMentionDecision(params) {
2241
2337
  const implicitMentions = resolveChannelImplicitMentions({
2242
2338
  cfg: params.cfg,
@@ -2300,7 +2396,8 @@ async function prepareTlonGroupAdmission(params) {
2300
2396
  }
2301
2397
  };
2302
2398
  }
2303
- // extensions/tlon/src/monitor/settings-helpers.ts
2399
+ //#endregion
2400
+ //#region extensions/tlon/src/monitor/settings-helpers.ts
2304
2401
  function buildTlonSettingsMigrations(account, currentSettings) {
2305
2402
  return [...[
2306
2403
  "dmAllowlist",
@@ -2345,6 +2442,7 @@ function applyTlonSettingsOverrides(params) {
2345
2442
  effectiveAutoAcceptDmInvites: settings.autoAcceptDmInvites ?? account.autoAcceptDmInvites ?? false,
2346
2443
  effectiveAutoAcceptGroupInvites: settings.autoAcceptGroupInvites ?? account.autoAcceptGroupInvites ?? false,
2347
2444
  effectiveGroupInviteAllowlist: settings.groupInviteAllowlist ?? account.groupInviteAllowlist,
2445
+ explicitChannels: mergeUniqueStrings(account.groupChannels, settings.groupChannels),
2348
2446
  effectiveAutoDiscoverChannels: settings.autoDiscoverChannels ?? account.autoDiscoverChannels ?? false,
2349
2447
  effectiveOwnerShip,
2350
2448
  pendingApprovals: settings.pendingApprovals?.length ? settings.pendingApprovals : [],
@@ -2354,7 +2452,23 @@ function applyTlonSettingsOverrides(params) {
2354
2452
  function mergeUniqueStrings(base, next) {
2355
2453
  return uniqueStrings([...base, ...next ?? []]);
2356
2454
  }
2357
- // extensions/tlon/src/monitor/tracking.ts
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
+ }
2470
+ //#endregion
2471
+ //#region extensions/tlon/src/monitor/tracking.ts
2358
2472
  const TLON_PARTICIPATED_THREAD_LIMIT = 2e3;
2359
2473
  function createParticipatedThreadTracker(limit = TLON_PARTICIPATED_THREAD_LIMIT) {
2360
2474
  const cache = createDedupeCache({
@@ -2385,7 +2499,8 @@ function createActiveSnapshotTracker() {
2385
2499
  addIfAccepted: (key, accepted) => accepted && processed.add(key)
2386
2500
  };
2387
2501
  }
2388
- // extensions/tlon/src/monitor/index.ts
2502
+ //#endregion
2503
+ //#region extensions/tlon/src/monitor/index.ts
2389
2504
  /** Identity for an unverified group DM (club) author claim; never matches a bare ship. */
2390
2505
  function clubSenderId(clubId, claimedShip) {
2391
2506
  return `club:${clubId}:${claimedShip}`;
@@ -2453,6 +2568,7 @@ async function monitorTlonProvider(opts) {
2453
2568
  account,
2454
2569
  currentSettings: {}
2455
2570
  });
2571
+ const installSettings = createTlonSettingsInstaller(settingsState, account, (message) => runtime.log?.(message));
2456
2572
  const participatedThreads = createParticipatedThreadTracker();
2457
2573
  const channelHistory = createChannelHistoryCache();
2458
2574
  const dmSendersBySession = /* @__PURE__ */ new Map();
@@ -2476,11 +2592,7 @@ async function monitorTlonProvider(opts) {
2476
2592
  } catch (err) {
2477
2593
  runtime.log?.(`[tlon] Failed to migrate ${key}: ${String(err)}`);
2478
2594
  }
2479
- Object.assign(settingsState, applyTlonSettingsOverrides({
2480
- account,
2481
- currentSettings: settingsState.currentSettings,
2482
- log: (message) => runtime.log?.(message)
2483
- }));
2595
+ installSettings(settingsState.currentSettings);
2484
2596
  } catch (err) {
2485
2597
  runtime.log?.(`[tlon] Settings store not available, using file config: ${String(err)}`);
2486
2598
  }
@@ -2747,6 +2859,7 @@ async function monitorTlonProvider(opts) {
2747
2859
  });
2748
2860
  };
2749
2861
  const watchedChannels = new Set(groupChannels);
2862
+ const canExpandCitedNest = (nest) => settingsState.effectiveAutoDiscoverChannels || settingsState.explicitChannels.includes(nest);
2750
2863
  const addWatchedChannels = (channels, logPrefix) => {
2751
2864
  const previousCount = watchedChannels.size;
2752
2865
  for (const channelNest of channels) if (!watchedChannels.has(channelNest)) {
@@ -2825,7 +2938,7 @@ async function monitorTlonProvider(opts) {
2825
2938
  if (!messageId) return;
2826
2939
  const senderShip = normalizeShip(readStringField(content, "author") ?? "");
2827
2940
  if (!senderShip || senderShip === botShipName) return;
2828
- const rawText = extractMessageText(content.content);
2941
+ const rawText = extractMessageTextSafely(content.content, runtime);
2829
2942
  if (!rawText.trim()) return;
2830
2943
  const contentBody = content.content;
2831
2944
  const sentAt = asFiniteNumber(content?.sent) ?? Date.now();
@@ -2872,7 +2985,7 @@ async function monitorTlonProvider(opts) {
2872
2985
  } else runtime.log?.(`[tlon] Access denied: ${senderShip} in ${nest} (allowed: ${allowedShips.join(", ")})`);
2873
2986
  return;
2874
2987
  }
2875
- const messageText = await resolveTlonCitations(contentBody, api, runtime) + rawText;
2988
+ const messageText = await resolveTlonCitations(contentBody, canExpandCitedNest, api, runtime) + rawText;
2876
2989
  await processMessage({
2877
2990
  messageId,
2878
2991
  senderShip,
@@ -2960,7 +3073,7 @@ async function monitorTlonProvider(opts) {
2960
3073
  if (authorShip === botShipName) return;
2961
3074
  if (!senderShip || senderShip === botShipName) return;
2962
3075
  if (authorShip && partnerShip && authorShip !== partnerShip) runtime.log?.(`[tlon] DM ship mismatch (author=${authorShip}, partner=${partnerShip}) - routing to partner`);
2963
- const rawText = extractMessageText(essay.content);
3076
+ const rawText = extractMessageTextSafely(essay.content, runtime);
2964
3077
  if (!rawText.trim()) return;
2965
3078
  const messageText = rawText;
2966
3079
  const ownerDm = !isClubMessage && isOwner(senderShip);
@@ -3005,7 +3118,8 @@ async function monitorTlonProvider(opts) {
3005
3118
  } else runtime.log?.(`[tlon] Blocked DM from ${senderShip}: not in allowlist`);
3006
3119
  return;
3007
3120
  }
3008
- 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;
3009
3123
  if (ownerDm) runtime.log?.(`[tlon] Processing DM from owner ${senderShip}`);
3010
3124
  await processMessage({
3011
3125
  messageText: resolvedMessageText,
@@ -3100,11 +3214,7 @@ async function monitorTlonProvider(opts) {
3100
3214
  await settingsManager.startSubscription((newSettings) => {
3101
3215
  settingsState.currentSettings = newSettings;
3102
3216
  addWatchedChannels(newSettings.groupChannels ?? [], "[tlon] Settings: now watching channel ");
3103
- Object.assign(settingsState, applyTlonSettingsOverrides({
3104
- account,
3105
- currentSettings: newSettings,
3106
- log: (message) => runtime.log?.(message)
3107
- }));
3217
+ installSettings(newSettings);
3108
3218
  });
3109
3219
  } catch (err) {
3110
3220
  runtime.log?.(`[tlon] Settings subscription not available: ${String(err)}`);
@@ -3122,15 +3232,16 @@ async function monitorTlonProvider(opts) {
3122
3232
  const discoveredChannels = mergeUniqueStrings(Object.keys(asNullableRecord(eventRecord.channels) ?? {}), joinedChannels.filter((channel) => typeof channel === "string")).filter((channel) => channel.startsWith("chat/"));
3123
3233
  addWatchedChannels(discoveredChannels, "[tlon] Auto-detected new channel: ");
3124
3234
  if (!settingsState.effectiveAutoAcceptGroupInvites) return;
3125
- const currentChannels = settingsState.currentSettings.groupChannels ?? [];
3235
+ const settingsSnapshot = settingsState.currentSettings;
3236
+ const currentChannels = settingsSnapshot.groupChannels ?? [];
3126
3237
  const unpersistedChannels = discoveredChannels.filter((channel) => !currentChannels.includes(channel));
3127
3238
  if (unpersistedChannels.length === 0) return;
3128
3239
  const updatedChannels = mergeUniqueStrings(currentChannels, unpersistedChannels);
3129
3240
  await putTlonSetting(api, "groupChannels", updatedChannels);
3130
- settingsState.currentSettings = {
3131
- ...settingsState.currentSettings,
3241
+ if (settingsState.currentSettings === settingsSnapshot) installSettings({
3242
+ ...settingsSnapshot,
3132
3243
  groupChannels: updatedChannels
3133
- };
3244
+ }, true);
3134
3245
  runtime.log?.(`[tlon] Persisted ${unpersistedChannels.join(", ")} to settings store`);
3135
3246
  } catch (error) {
3136
3247
  runtime.error?.(`[tlon] Error handling groups-ui event: ${formatErrorMessage(error)}`);
@@ -3264,7 +3375,8 @@ async function monitorTlonProvider(opts) {
3264
3375
  }
3265
3376
  }
3266
3377
  }
3267
- // extensions/tlon/src/tlon-api.ts
3378
+ //#endregion
3379
+ //#region extensions/tlon/src/tlon-api.ts
3268
3380
  const MEMEX_BASE_URL = "https://memex.tlon.network";
3269
3381
  /** Max bytes to read from the Memex upload JSON response. */
3270
3382
  const MEMEX_UPLOAD_RESPONSE_MAX_BYTES = 65536;
@@ -3470,7 +3582,8 @@ async function uploadFile(params, clientConfig) {
3470
3582
  await uploadBlob(signedUrl, signedUrl.includes("digitaloceanspaces.com") ? headers : void 0);
3471
3583
  return { url: assertSafeUploadResultUrl(storageConfig.publicUrlBase ? new URL(fileKey, storageConfig.publicUrlBase).toString() : expectDefined(signedUrl.split("?").at(0), "signed URL base segment"), "Upload result URL") };
3472
3584
  }
3473
- // extensions/tlon/src/urbit/upload.ts
3585
+ //#endregion
3586
+ //#region extensions/tlon/src/urbit/upload.ts
3474
3587
  /**
3475
3588
  * Fetch an image from a URL and upload it to Tlon storage.
3476
3589
  * Falls back to the original URL on error, but only after a bounded download when a cap is set.
@@ -3516,7 +3629,8 @@ async function uploadImageFromUrl(imageUrl, clientConfig, maxBytes) {
3516
3629
  return imageUrl;
3517
3630
  }
3518
3631
  }
3519
- // extensions/tlon/src/channel.runtime.ts
3632
+ //#endregion
3633
+ //#region extensions/tlon/src/channel.runtime.ts
3520
3634
  async function createHttpPokeApi(params) {
3521
3635
  const ssrfPolicy = ssrfPolicyFromDangerouslyAllowPrivateNetwork(params.dangerouslyAllowPrivateNetwork);
3522
3636
  const cookie = await authenticate(params.url, params.code, {
@@ -3672,4 +3786,5 @@ async function startTlonGatewayAccount(ctx) {
3672
3786
  accountId: account.accountId
3673
3787
  });
3674
3788
  }
3789
+ //#endregion
3675
3790
  export { probeTlonAccount, startTlonGatewayAccount, tlonRuntimeOutbound, tlonSetupWizard };
@@ -1,4 +1,4 @@
1
- // \0rolldown/runtime.js
1
+ //#region \0rolldown/runtime.js
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -23,7 +23,8 @@ var __copyProps = (to, from, except, desc) => {
23
23
  return to;
24
24
  };
25
25
  var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
26
- // packages/normalization-core/src/record-coerce.ts
26
+ //#endregion
27
+ //#region packages/normalization-core/src/record-coerce.ts
27
28
  /** Type guard for non-array object records at browser-safe boundaries. */
28
29
  function isRecord(value) {
29
30
  return value !== null && typeof value === "object" && !Array.isArray(value);
@@ -32,7 +33,8 @@ function isRecord(value) {
32
33
  function asNullableRecord(value) {
33
34
  return isRecord(value) ? value : null;
34
35
  }
35
- // src/config/channel-config-normalization.ts
36
+ //#endregion
37
+ //#region src/config/channel-config-normalization.ts
36
38
  /** Applies one channel-specific doctor migration to every object-shaped account. */
37
39
  function normalizeChannelAccounts(params) {
38
40
  const rawAccounts = asNullableRecord(params.entry.accounts);
@@ -108,7 +110,8 @@ function normalizeChannelConfigEntries(params) {
108
110
  changes
109
111
  };
110
112
  }
111
- // src/plugin-sdk/legacy-webhook-listener-migration.ts
113
+ //#endregion
114
+ //#region src/plugin-sdk/legacy-webhook-listener-migration.ts
112
115
  /** Preserve explicitly configured webhook listeners while moving ingress onto Gateway routes. */
113
116
  function createLegacyWebhookListenerDoctorContract(params) {
114
117
  const portKey = params.portKey ?? "webhookPort";
@@ -178,12 +181,15 @@ function createLegacyWebhookListenerDoctorContract(params) {
178
181
  }
179
182
  };
180
183
  }
181
- // \0openclaw:bundled-sdk:openclaw/plugin-sdk/runtime-doctor-migrations
184
+ //#endregion
185
+ //#region \0openclaw:bundled-sdk:openclaw/plugin-sdk/runtime-doctor-migrations
182
186
  var runtime_doctor_migrations_exports = /* @__PURE__ */ __exportAll({ createLegacyWebhookListenerDoctorContract: () => createLegacyWebhookListenerDoctorContract });
183
187
  import * as import_openclaw_plugin_sdk_runtime_doctor_migrations from "openclaw/plugin-sdk/runtime-doctor-migrations";
184
188
  __reExport(runtime_doctor_migrations_exports, import_openclaw_plugin_sdk_runtime_doctor_migrations);
185
- // extensions/tlon/src/doctor-contract.ts
189
+ //#endregion
190
+ //#region extensions/tlon/src/doctor-contract.ts
186
191
  const contract = (0, runtime_doctor_migrations_exports.createLegacyPrivateNetworkDoctorContract)({ channelKey: "tlon" });
187
192
  const legacyConfigRules = contract.legacyConfigRules;
188
193
  const normalizeCompatibilityConfig = contract.normalizeCompatibilityConfig;
194
+ //#endregion
189
195
  export { __reExport as i, normalizeCompatibilityConfig as n, __exportAll as r, legacyConfigRules as t };
@@ -1,7 +1,8 @@
1
1
  import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
2
- // extensions/tlon/src/runtime.ts
2
+ //#region extensions/tlon/src/runtime.ts
3
3
  const { setRuntime: setTlonRuntime, getRuntime: getTlonRuntime } = createPluginRuntimeStore({
4
4
  pluginId: "tlon",
5
5
  errorMessage: "Tlon runtime not initialized"
6
6
  });
7
+ //#endregion
7
8
  export { setTlonRuntime as n, getTlonRuntime as t };
@@ -5,7 +5,7 @@ import { defineChannelSetupContract } from "openclaw/plugin-sdk/channel-setup";
5
5
  import { DEFAULT_ACCOUNT_ID, createSetupInputPresenceValidator, createSetupTranslator, formatDocsLink, normalizeAccountId, patchScopedAccountConfig, prepareScopedSetupConfig } from "openclaw/plugin-sdk/setup";
6
6
  import { normalizeOptionalString, normalizeStringifiedOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
7
7
  import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1, normalizeAccountId as normalizeAccountId$1 } from "openclaw/plugin-sdk/account-resolution";
8
- // extensions/tlon/src/targets.ts
8
+ //#region extensions/tlon/src/targets.ts
9
9
  const SHIP_RE = /^~?[a-z-]+$/i;
10
10
  const NEST_RE = /^chat\/([^/]+)\/([^/]+)$/i;
11
11
  function normalizeShip(raw) {
@@ -82,7 +82,8 @@ function resolveTlonOutboundTarget(to) {
82
82
  function formatTargetHint() {
83
83
  return "dm/~sampel-palnet | ~sampel-palnet | chat/~host-ship/channel | group:~host-ship/channel";
84
84
  }
85
- // extensions/tlon/src/account-fields.ts
85
+ //#endregion
86
+ //#region extensions/tlon/src/account-fields.ts
86
87
  function buildTlonAccountFields(input) {
87
88
  return {
88
89
  ...input.ship ? { ship: input.ship } : {},
@@ -95,7 +96,8 @@ function buildTlonAccountFields(input) {
95
96
  ...input.ownerShip ? { ownerShip: input.ownerShip } : {}
96
97
  };
97
98
  }
98
- // extensions/tlon/src/types.ts
99
+ //#endregion
100
+ //#region extensions/tlon/src/types.ts
99
101
  function resolveTlonChannelConfig(cfg) {
100
102
  return cfg.channels?.tlon;
101
103
  }
@@ -144,7 +146,8 @@ function resolveTlonAccount(cfg, accountId) {
144
146
  ownerShip: merged.ownerShip ?? null
145
147
  };
146
148
  }
147
- // extensions/tlon/src/urbit/base-url.ts
149
+ //#endregion
150
+ //#region extensions/tlon/src/urbit/base-url.ts
148
151
  function normalizeUrbitHostname(hostname) {
149
152
  return (hostname ?? "").trim().toLowerCase().replace(/\.$/, "");
150
153
  }
@@ -185,7 +188,8 @@ function isBlockedUrbitHostname(hostname) {
185
188
  if (!normalized) return false;
186
189
  return isBlockedHostnameOrIp(normalized);
187
190
  }
188
- // extensions/tlon/src/setup-core.ts
191
+ //#endregion
192
+ //#region extensions/tlon/src/setup-core.ts
189
193
  const t = createSetupTranslator();
190
194
  function createTlonSetupWizardBase(finalize) {
191
195
  return {
@@ -396,4 +400,5 @@ const tlonSetupContract = defineChannelSetupContract({
396
400
  },
397
401
  legacyAdapter: tlonSetupAdapter
398
402
  });
403
+ //#endregion
399
404
  export { isBlockedUrbitHostname as a, resolveTlonAccount as c, parseChannelNest as d, parseTlonTarget as f, tlonSetupContract as i, formatTargetHint as l, createTlonSetupWizardBase as n, validateUrbitBaseUrl as o, resolveTlonOutboundTarget as p, tlonSetupAdapter as r, listTlonAccountIds as s, applyTlonSetupConfig as t, normalizeShip as u };
@@ -1,6 +1,6 @@
1
- import { a as isBlockedUrbitHostname, c as resolveTlonAccount, n as createTlonSetupWizardBase, o as validateUrbitBaseUrl, t as applyTlonSetupConfig, u as normalizeShip } from "./setup-core-DnIfSMDp.mjs";
1
+ import { a as isBlockedUrbitHostname, c as resolveTlonAccount, n as createTlonSetupWizardBase, o as validateUrbitBaseUrl, t as applyTlonSetupConfig, u as normalizeShip } from "./setup-core-kO8u8noA.mjs";
2
2
  import { createSetupTranslator, splitSetupEntries } from "openclaw/plugin-sdk/setup-runtime";
3
- // extensions/tlon/src/setup-surface.ts
3
+ //#region extensions/tlon/src/setup-surface.ts
4
4
  const t = createSetupTranslator();
5
5
  const tlonSetupWizard = createTlonSetupWizardBase(async ({ cfg, accountId, prompter }) => {
6
6
  let next = cfg;
@@ -63,4 +63,5 @@ const tlonSetupWizard = createTlonSetupWizardBase(async ({ cfg, accountId, promp
63
63
  });
64
64
  return { cfg: next };
65
65
  });
66
+ //#endregion
66
67
  export { tlonSetupWizard as t };
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-DwKKUzwx.mjs";
3
- import { n as setTlonRuntime } from "./.setup/runtime-ReERXJF_.mjs";
2
+ import { t as tlonPlugin } from "./.setup/channel-C2dWMDrp.mjs";
3
+ import { n as setTlonRuntime } from "./.setup/runtime-Ck3lNvST.mjs";
4
4
  export { SsrFBlockedError, createDedupeCache, createLoggerBackedRuntime, fetchWithSsrFGuard, isBlockedHostnameOrIp, setTlonRuntime, ssrfPolicyFromDangerouslyAllowPrivateNetwork, tlonPlugin };
@@ -1 +1,2 @@
1
- export { t as tlonPlugin } from "./.setup/channel-DwKKUzwx.mjs";
1
+ import { t as tlonPlugin } from "./.setup/channel-C2dWMDrp.mjs";
2
+ export { tlonPlugin };
@@ -1 +1,2 @@
1
- export { t as legacyConfigRules, n as normalizeCompatibilityConfig } from "./.setup/doctor-contract-CfYeTj9o.mjs";
1
+ import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./.setup/doctor-contract-bInPRAQZ.mjs";
2
+ export { legacyConfigRules, normalizeCompatibilityConfig };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { defineBundledChannelEntry } from "openclaw/plugin-sdk/channel-entry-contract";
2
- // extensions/tlon/index.ts
2
+ //#region extensions/tlon/index.ts
3
3
  var tlon_default = defineBundledChannelEntry({
4
4
  id: "tlon",
5
5
  name: "Tlon",
@@ -14,4 +14,5 @@ var tlon_default = defineBundledChannelEntry({
14
14
  exportName: "setTlonRuntime"
15
15
  }
16
16
  });
17
+ //#endregion
17
18
  export { tlon_default as default };
package/dist/setup-api.js CHANGED
@@ -1,3 +1,3 @@
1
- import { r as tlonSetupAdapter } from "./.setup/setup-core-DnIfSMDp.mjs";
2
- import { t as tlonSetupWizard } from "./.setup/setup-surface-CTiMlwQy.mjs";
1
+ import { r as tlonSetupAdapter } from "./.setup/setup-core-kO8u8noA.mjs";
2
+ import { t as tlonSetupWizard } from "./.setup/setup-surface-Byac6RoF.mjs";
3
3
  export { tlonSetupAdapter, tlonSetupWizard };
@@ -1,11 +1,12 @@
1
1
  import { defineBundledChannelSetupEntry } from "openclaw/plugin-sdk/channel-entry-contract";
2
2
  import { fileURLToPath } from "node:url";
3
- // extensions/tlon/setup-entry.ts
3
+ //#region extensions/tlon/setup-entry.ts
4
4
  var setup_entry_default = defineBundledChannelSetupEntry({
5
5
  importMetaUrl: import.meta.url,
6
6
  plugin: {
7
- specifier: fileURLToPath(new URL(".setup/api-uhQCnWtf.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
  });
11
+ //#endregion
11
12
  export { setup_entry_default as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/tlon",
3
- "version": "2026.10.10",
3
+ "version": "2026.10.33",
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.10"
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.10.10"
124
+ "pluginApi": ">=2026.11.4"
125
125
  },
126
126
  "build": {
127
- "openclawVersion": "2026.10.10"
127
+ "openclawVersion": "2026.10.33"
128
128
  },
129
129
  "release": {
130
130
  "bundleRuntimeDependencies": false,
@@ -1 +0,0 @@
1
- {"version":3,"entries":[{"output":"api.js","source":"extensions/tlon/api.ts"},{"output":"channel-plugin-api.js","source":"extensions/tlon/channel-plugin-api.ts"},{"output":"doctor-contract-api.js","source":"extensions/tlon/doctor-contract-api.ts"},{"output":"index.js","source":"extensions/tlon/index.ts"},{"output":"runtime-api.js","source":"extensions/tlon/runtime-api.ts"},{"output":"setup-api.js","source":"extensions/tlon/setup-api.ts"},{"output":"setup-entry.js","source":"extensions/tlon/setup-entry.ts"}],"chunks":[{"output":".setup/api-uhQCnWtf.mjs","sha256":"796c7ff591841d5b9b82b0ef422bad5e3db23c78a4caaa68846c90aeaeabfb55","facadeSource":"extensions/tlon/api.ts","sources":[]},{"output":".setup/channel-DwKKUzwx.mjs","sha256":"748efd9095a4cdc6563ea418145b1a587d20292f3419ba64f2003986a5758499","facadeSource":null,"sources":["extensions/tlon/src/channel.ts","extensions/tlon/src/config-schema.ts","extensions/tlon/src/doctor.ts","extensions/tlon/src/session-route.ts"]},{"output":".setup/channel.runtime-CdWyxE8W.mjs","sha256":"02c0e151395de86fbaf9b2e1fd4105daf733e30ddc32ab9a75c8a675dc54c055","facadeSource":"extensions/tlon/src/channel.runtime.ts","sources":["extensions/tlon/src/channel.runtime.ts","extensions/tlon/src/media-fetch-timeouts.ts","extensions/tlon/src/monitor/approval-runtime.ts","extensions/tlon/src/monitor/approval.ts","extensions/tlon/src/monitor/authorization.ts","extensions/tlon/src/monitor/cites.ts","extensions/tlon/src/monitor/discovery.ts","extensions/tlon/src/monitor/history.ts","extensions/tlon/src/monitor/index.ts","extensions/tlon/src/monitor/ingress.ts","extensions/tlon/src/monitor/media.ts","extensions/tlon/src/monitor/mentions.ts","extensions/tlon/src/monitor/settings-helpers.ts","extensions/tlon/src/monitor/tracking.ts","extensions/tlon/src/monitor/utils.ts","extensions/tlon/src/settings.ts","extensions/tlon/src/tlon-api.ts","extensions/tlon/src/urbit/auth.ts","extensions/tlon/src/urbit/channel-ops.ts","extensions/tlon/src/urbit/context.ts","extensions/tlon/src/urbit/errors.ts","extensions/tlon/src/urbit/fetch.ts","extensions/tlon/src/urbit/redact.ts","extensions/tlon/src/urbit/send.ts","extensions/tlon/src/urbit/sse-client.ts","extensions/tlon/src/urbit/story.ts","extensions/tlon/src/urbit/upload.ts","src/channels/mention-gating.ts"]},{"output":".setup/doctor-contract-CfYeTj9o.mjs","sha256":"cd414672cef0faa7cc964028ec840a10c720f80b8c416ea4695a16931c249e63","facadeSource":null,"sources":["extensions/tlon/src/doctor-contract.ts","packages/normalization-core/src/record-coerce.ts","src/config/channel-config-normalization.ts","src/plugin-sdk/legacy-webhook-listener-migration.ts"]},{"output":".setup/runtime-ReERXJF_.mjs","sha256":"23ea20b9a79e00a2a761e2c1ee5753526019a34f8a5c9caa26b7f9fed435292e","facadeSource":null,"sources":["extensions/tlon/src/runtime.ts"]},{"output":".setup/setup-core-DnIfSMDp.mjs","sha256":"02128acec62c980ca0c7d904c99a4a6b7ce8604eea03f7b1f5af8f1fc2c56cfc","facadeSource":null,"sources":["extensions/tlon/src/account-fields.ts","extensions/tlon/src/setup-core.ts","extensions/tlon/src/targets.ts","extensions/tlon/src/types.ts","extensions/tlon/src/urbit/base-url.ts"]},{"output":".setup/setup-surface-CTiMlwQy.mjs","sha256":"0786c7d6949cb80b8b4801864ef3b729c43ac19bb102189e3f2e160c5ed5a21f","facadeSource":null,"sources":["extensions/tlon/src/setup-surface.ts"]},{"output":"api.js","sha256":"3f86fd1bbcd52d4cab433a4db80aef921a1186e9f3aba6eda1ec6fb946c17e6b","facadeSource":"extensions/tlon/api.ts","sources":[]},{"output":"channel-plugin-api.js","sha256":"3edd4f585091a8a3f10bb05ad57c4780c65aefad9600d14f9018255b19e24cff","facadeSource":"extensions/tlon/channel-plugin-api.ts","sources":[]},{"output":"doctor-contract-api.js","sha256":"269771e05b29fb710fa0c235a6c197e7bdae2550a2607fae3dcb5befd600a040","facadeSource":"extensions/tlon/doctor-contract-api.ts","sources":[]},{"output":"index.js","sha256":"71964a841ad9ec38d0abc3cbbb090b3d19f452a5070009a62ced5883999abd41","facadeSource":"extensions/tlon/index.ts","sources":["extensions/tlon/index.ts"]},{"output":"runtime-api.js","sha256":"84b5cef46a80daf5dd78edb6afd45310e3877e6d91d56716af7992f38f01e7cb","facadeSource":"extensions/tlon/runtime-api.ts","sources":[]},{"output":"setup-api.js","sha256":"c0e9f3d9df38b6d0f2f90b20a17ef0ed157577889e3bba70c958e89e86a8e87a","facadeSource":"extensions/tlon/setup-api.ts","sources":[]},{"output":"setup-entry.js","sha256":"20865a2ca47412600ff2dbbcf7ffb60bb61c0bcc9904e76b0147e08161c4bbc0","facadeSource":"extensions/tlon/setup-entry.ts","sources":["extensions/tlon/setup-entry.ts"]}],"unrenderedSources":["extensions/tlon/api.ts","extensions/tlon/channel-plugin-api.ts","extensions/tlon/config-doctor-api.ts","extensions/tlon/doctor-contract-api.ts","extensions/tlon/runtime-api.ts","extensions/tlon/setup-api.ts"]}