@openclaw/tlon 2026.10.6 → 2026.10.8
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.
- package/dist/.setup/{api-D_HRM5yM.mjs → api-nhcWIDbt.mjs} +1 -1
- package/dist/.setup/{channel-cZo0ECaC.mjs → channel-CEod6b5Y.mjs} +1 -1
- package/dist/.setup/{channel.runtime-BuDLFazV.mjs → channel.runtime-CWZfpV0E.mjs} +70 -17
- package/dist/.source-module-urls/219ea9f09fb313a73daa9d49cae583628627d248b038afb8d4cbf4dbf34fd43c.json +1 -0
- package/dist/api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/setup-entry.js +1 -1
- package/package.json +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SsrFBlockedError, createDedupeCache, createLoggerBackedRuntime, fetchWithSsrFGuard, isBlockedHostnameOrIp, ssrfPolicyFromDangerouslyAllowPrivateNetwork } from "../runtime-api.js";
|
|
2
|
-
import { t as tlonPlugin } from "./channel-
|
|
2
|
+
import { t as tlonPlugin } from "./channel-CEod6b5Y.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-
|
|
97
|
+
const loadTlonChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-CWZfpV0E.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,
|
|
@@ -4,7 +4,7 @@ import { c as resolveTlonAccount, d as parseChannelNest, f as parseTlonTarget, l
|
|
|
4
4
|
import { t as getTlonRuntime } from "./runtime-Ck3lNvST.mjs";
|
|
5
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";
|
|
@@ -877,6 +877,7 @@ async function ensureUrbitChannelOpen(deps, params) {
|
|
|
877
877
|
//#region extensions/tlon/src/urbit/sse-client.ts
|
|
878
878
|
const MAX_SSE_PAYLOAD_BYTES = 16777216;
|
|
879
879
|
const MAX_RECONNECT_ATTEMPTS = 10;
|
|
880
|
+
const SSE_STALL_TIMEOUT_MS = 6e4;
|
|
880
881
|
function parseUrbitSsePayload(data) {
|
|
881
882
|
if (Buffer.byteLength(data, "utf8") > MAX_SSE_PAYLOAD_BYTES) throw new Error("Tlon Urbit SSE payload exceeds 16 MiB limit");
|
|
882
883
|
try {
|
|
@@ -1028,6 +1029,17 @@ var UrbitSSEClient = class {
|
|
|
1028
1029
|
async processStream(body) {
|
|
1029
1030
|
if (!body) return;
|
|
1030
1031
|
const stream = body instanceof ReadableStream ? Readable.fromWeb(body) : body;
|
|
1032
|
+
const streamController = this.streamController;
|
|
1033
|
+
const watchdog = createArmableStallWatchdog({
|
|
1034
|
+
label: "tlon-sse",
|
|
1035
|
+
timeoutMs: SSE_STALL_TIMEOUT_MS,
|
|
1036
|
+
onTimeout: ({ idleMs }) => {
|
|
1037
|
+
const error = /* @__PURE__ */ new Error(`Tlon Urbit SSE stream stalled: no data for ${Math.round(idleMs / 1e3)}s`);
|
|
1038
|
+
streamController?.abort(error);
|
|
1039
|
+
if (stream instanceof Readable) stream.destroy(error);
|
|
1040
|
+
}
|
|
1041
|
+
});
|
|
1042
|
+
watchdog.arm();
|
|
1031
1043
|
const decoder = new TextDecoder();
|
|
1032
1044
|
let buffer = "";
|
|
1033
1045
|
let bufferBytes = 0;
|
|
@@ -1075,13 +1087,16 @@ var UrbitSSEClient = class {
|
|
|
1075
1087
|
try {
|
|
1076
1088
|
for await (const chunk of stream) {
|
|
1077
1089
|
if (this.aborted) break;
|
|
1090
|
+
watchdog.disarm();
|
|
1078
1091
|
if (typeof chunk === "string") {
|
|
1079
1092
|
await consumeText(decoder.decode());
|
|
1080
1093
|
await consumeText(chunk);
|
|
1081
1094
|
} else await consumeText(decoder.decode(chunk, { stream: true }));
|
|
1095
|
+
watchdog.arm();
|
|
1082
1096
|
}
|
|
1083
1097
|
await consumeText(decoder.decode());
|
|
1084
1098
|
} finally {
|
|
1099
|
+
watchdog.stop();
|
|
1085
1100
|
if (this.streamRelease) {
|
|
1086
1101
|
const release = this.streamRelease;
|
|
1087
1102
|
this.streamRelease = null;
|
|
@@ -1708,7 +1723,8 @@ function isGroupInviteAllowed(inviterShip, allowlist) {
|
|
|
1708
1723
|
}]
|
|
1709
1724
|
}).allowed;
|
|
1710
1725
|
}
|
|
1711
|
-
|
|
1726
|
+
const MAX_INLINE_DEPTH = 100;
|
|
1727
|
+
function renderInlineItem(item, topLevel = false, depth = 0) {
|
|
1712
1728
|
if (typeof item === "string") return item;
|
|
1713
1729
|
const record = asNullableRecord(item);
|
|
1714
1730
|
if (!record) return "";
|
|
@@ -1728,14 +1744,29 @@ function renderInlineItem(item, topLevel = false) {
|
|
|
1728
1744
|
const linkContent = readStringField(link, "content");
|
|
1729
1745
|
return topLevel ? linkHref : linkContent || linkHref;
|
|
1730
1746
|
}
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1747
|
+
const bold = Array.isArray(record.bold) ? record.bold : void 0;
|
|
1748
|
+
const italics = Array.isArray(record.italics) ? record.italics : void 0;
|
|
1749
|
+
const strike = Array.isArray(record.strike) ? record.strike : void 0;
|
|
1750
|
+
const blockquote = topLevel && Array.isArray(record.blockquote) ? record.blockquote : void 0;
|
|
1751
|
+
const nested = bold ?? italics ?? strike ?? blockquote;
|
|
1752
|
+
if (!nested) return "";
|
|
1753
|
+
if (depth >= MAX_INLINE_DEPTH) return "";
|
|
1754
|
+
const inner = extractInlineText(nested, depth + 1);
|
|
1755
|
+
if (bold) return `**${inner}**`;
|
|
1756
|
+
if (italics) return `*${inner}*`;
|
|
1757
|
+
if (strike) return `~~${inner}~~`;
|
|
1758
|
+
return `> ${inner}`;
|
|
1759
|
+
}
|
|
1760
|
+
function extractInlineText(items, depth = 0) {
|
|
1761
|
+
return items.map((item) => renderInlineItem(item, false, depth)).join("");
|
|
1762
|
+
}
|
|
1763
|
+
function extractMessageTextSafely(content, runtime) {
|
|
1764
|
+
try {
|
|
1765
|
+
return extractMessageText(content);
|
|
1766
|
+
} catch (error) {
|
|
1767
|
+
runtime.log?.(`[tlon] Failed to extract message text: ${formatErrorMessage(error)}`);
|
|
1768
|
+
return "";
|
|
1769
|
+
}
|
|
1739
1770
|
}
|
|
1740
1771
|
function extractMessageText(content) {
|
|
1741
1772
|
if (!Array.isArray(content)) return "";
|
|
@@ -2032,6 +2063,20 @@ async function fetchThreadHistory(api, channelNest, parentId, count = 50, runtim
|
|
|
2032
2063
|
const TLON_INGRESS_PAYLOAD_VERSION = 1;
|
|
2033
2064
|
const TLON_INGRESS_POLL_INTERVAL_MS = 1e3;
|
|
2034
2065
|
const TlonIngressPermanentError = createChannelIngressError("TlonIngressPermanentError", { withReason: true });
|
|
2066
|
+
var TlonIngressUnserializableEventError = class extends Error {
|
|
2067
|
+
constructor(cause) {
|
|
2068
|
+
super("Tlon firehose event is too deeply nested to store.", { cause });
|
|
2069
|
+
this.name = "TlonIngressUnserializableEventError";
|
|
2070
|
+
}
|
|
2071
|
+
};
|
|
2072
|
+
function serializeTlonIngressEvent(event) {
|
|
2073
|
+
try {
|
|
2074
|
+
return JSON.stringify(event);
|
|
2075
|
+
} catch (error) {
|
|
2076
|
+
if (error instanceof RangeError) throw new TlonIngressUnserializableEventError(error);
|
|
2077
|
+
throw error;
|
|
2078
|
+
}
|
|
2079
|
+
}
|
|
2035
2080
|
function inspectChannelsEvent(event) {
|
|
2036
2081
|
const envelope = asNullableRecord(event);
|
|
2037
2082
|
const nest = normalizeNullableString(envelope?.nest);
|
|
@@ -2109,7 +2154,7 @@ function createTlonIngressMonitor(options) {
|
|
|
2109
2154
|
serialize: (raw, { receivedAt }) => ({
|
|
2110
2155
|
receivedAt,
|
|
2111
2156
|
source: raw.source,
|
|
2112
|
-
rawEvent:
|
|
2157
|
+
rawEvent: serializeTlonIngressEvent(raw.event)
|
|
2113
2158
|
}),
|
|
2114
2159
|
deserialize: (body, { claim }) => deserializeTlonIngressEvent(body, claim.id),
|
|
2115
2160
|
encode: ({ body }) => ({
|
|
@@ -2138,10 +2183,18 @@ function createTlonIngressMonitor(options) {
|
|
|
2138
2183
|
});
|
|
2139
2184
|
return {
|
|
2140
2185
|
receive: async ({ source, event }) => {
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2186
|
+
try {
|
|
2187
|
+
return { kind: (await monitor.admit({
|
|
2188
|
+
source,
|
|
2189
|
+
event
|
|
2190
|
+
})).kind === "durable" ? "accepted" : "ignored" };
|
|
2191
|
+
} catch (error) {
|
|
2192
|
+
if (error instanceof TlonIngressUnserializableEventError) {
|
|
2193
|
+
options.runtime.log?.(`tlon dropped ${source} event: ${error.message}`);
|
|
2194
|
+
return { kind: "dropped" };
|
|
2195
|
+
}
|
|
2196
|
+
throw error;
|
|
2197
|
+
}
|
|
2145
2198
|
},
|
|
2146
2199
|
start: monitor.start,
|
|
2147
2200
|
stop: monitor.stop,
|
|
@@ -2835,7 +2888,7 @@ async function monitorTlonProvider(opts) {
|
|
|
2835
2888
|
if (!messageId) return;
|
|
2836
2889
|
const senderShip = normalizeShip(readStringField(content, "author") ?? "");
|
|
2837
2890
|
if (!senderShip || senderShip === botShipName) return;
|
|
2838
|
-
const rawText =
|
|
2891
|
+
const rawText = extractMessageTextSafely(content.content, runtime);
|
|
2839
2892
|
if (!rawText.trim()) return;
|
|
2840
2893
|
const contentBody = content.content;
|
|
2841
2894
|
const sentAt = asFiniteNumber(content?.sent) ?? Date.now();
|
|
@@ -2970,7 +3023,7 @@ async function monitorTlonProvider(opts) {
|
|
|
2970
3023
|
if (authorShip === botShipName) return;
|
|
2971
3024
|
if (!senderShip || senderShip === botShipName) return;
|
|
2972
3025
|
if (authorShip && partnerShip && authorShip !== partnerShip) runtime.log?.(`[tlon] DM ship mismatch (author=${authorShip}, partner=${partnerShip}) - routing to partner`);
|
|
2973
|
-
const rawText =
|
|
3026
|
+
const rawText = extractMessageTextSafely(essay.content, runtime);
|
|
2974
3027
|
if (!rawText.trim()) return;
|
|
2975
3028
|
const messageText = rawText;
|
|
2976
3029
|
const ownerDm = !isClubMessage && isOwner(senderShip);
|
|
@@ -0,0 +1 @@
|
|
|
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-nhcWIDbt.mjs","sha256":"1eeffb98f747aca303414b1942346809bed49e3891bbe112ff2c304c6d6be754","facadeSource":"extensions/tlon/api.ts","sources":[]},{"output":".setup/channel-CEod6b5Y.mjs","sha256":"27320b1196ee62e38d24e912363b4a3934f998c345a3c5c15699ba4923cd963a","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-CWZfpV0E.mjs","sha256":"5cf02a277ce882ab8da4a9d07bcb35d5d92942524c534719f379b5005186b255","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-bInPRAQZ.mjs","sha256":"ba06bce97c984451581c990c9cfebbc69f70f3087e0eae04f07659084b6b16ba","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-Ck3lNvST.mjs","sha256":"b47fecb040ffb94da7eaa7ea1f026897d4b982aad8459b1da6f42878f0af2fcd","facadeSource":null,"sources":["extensions/tlon/src/runtime.ts"]},{"output":".setup/setup-core-kO8u8noA.mjs","sha256":"6a73177e64d17ac8c5ea5b62931c7f4eda0a13ba5d527a9c77500d6a4aa06dde","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-Byac6RoF.mjs","sha256":"0df0c9298fc374fa1f9a7b2cb25dc9e86a9350ef4490a4a7df595430fc8dff2f","facadeSource":null,"sources":["extensions/tlon/src/setup-surface.ts"]},{"output":"api.js","sha256":"423370b032cb3a0bc04bcd58364bb54b3d040d00e84418a852ecc3f7fe669382","facadeSource":"extensions/tlon/api.ts","sources":[]},{"output":"channel-plugin-api.js","sha256":"ec50bc55eacc351e957517c0a8c291dd6d9d67ea3a0db6565e831f3c427478d0","facadeSource":"extensions/tlon/channel-plugin-api.ts","sources":[]},{"output":"doctor-contract-api.js","sha256":"d8bfd31033274b1d661f7320b7d4ccaba6321d47ed309409003928b72403cb2f","facadeSource":"extensions/tlon/doctor-contract-api.ts","sources":[]},{"output":"index.js","sha256":"40ecbe760d30b082e1a5a9eb2590c33ef411f287fa5b655373df7d5126005654","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":"70fece625b2ba840a50e3083004da46aad994368321104bce289df624c5fbb93","facadeSource":"extensions/tlon/setup-api.ts","sources":[]},{"output":"setup-entry.js","sha256":"8b36a7d9738872396e49da2608137309f31e48b78ae11cefebb4ea9516b129d4","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"]}
|
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-
|
|
2
|
+
import { t as tlonPlugin } from "./.setup/channel-CEod6b5Y.mjs";
|
|
3
3
|
import { n as setTlonRuntime } from "./.setup/runtime-Ck3lNvST.mjs";
|
|
4
4
|
export { SsrFBlockedError, createDedupeCache, createLoggerBackedRuntime, fetchWithSsrFGuard, isBlockedHostnameOrIp, setTlonRuntime, ssrfPolicyFromDangerouslyAllowPrivateNetwork, tlonPlugin };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as tlonPlugin } from "./.setup/channel-
|
|
1
|
+
export { t as tlonPlugin } from "./.setup/channel-CEod6b5Y.mjs";
|
package/dist/setup-entry.js
CHANGED
|
@@ -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-
|
|
7
|
+
specifier: fileURLToPath(new URL(".setup/api-nhcWIDbt.mjs", import.meta.url).href),
|
|
8
8
|
exportName: "tlonPlugin"
|
|
9
9
|
}
|
|
10
10
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/tlon",
|
|
3
|
-
"version": "2026.10.
|
|
3
|
+
"version": "2026.10.8",
|
|
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.
|
|
22
|
+
"openclaw": ">=2026.10.8"
|
|
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.
|
|
124
|
+
"pluginApi": ">=2026.10.8"
|
|
125
125
|
},
|
|
126
126
|
"build": {
|
|
127
|
-
"openclawVersion": "2026.10.
|
|
127
|
+
"openclawVersion": "2026.10.8"
|
|
128
128
|
},
|
|
129
129
|
"release": {
|
|
130
130
|
"bundleRuntimeDependencies": false,
|