@openclaw/tlon 2026.5.31-beta.3 → 2026.5.31-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/api.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { a as ssrfPolicyFromAllowPrivateNetwork, i as isBlockedHostnameOrIp, n as createDedupeCache, o as ssrfPolicyFromDangerouslyAllowPrivateNetwork, r as fetchWithSsrFGuard, s as createLoggerBackedRuntime, t as SsrFBlockedError } from "./runtime-api-C5wXFh-q.js";
|
|
2
|
-
import { t as tlonPlugin } from "./channel-
|
|
2
|
+
import { t as tlonPlugin } from "./channel-CKKTYJLK.js";
|
|
3
3
|
import { n as setTlonRuntime } from "./runtime-Ck3lNvST.js";
|
|
4
4
|
export { SsrFBlockedError, createDedupeCache, createLoggerBackedRuntime, fetchWithSsrFGuard, isBlockedHostnameOrIp, setTlonRuntime, ssrfPolicyFromAllowPrivateNetwork, ssrfPolicyFromDangerouslyAllowPrivateNetwork, tlonPlugin };
|
|
@@ -84,7 +84,7 @@ function resolveTlonOutboundSessionRoute(params) {
|
|
|
84
84
|
//#endregion
|
|
85
85
|
//#region extensions/tlon/src/channel.ts
|
|
86
86
|
const TLON_CHANNEL_ID = "tlon";
|
|
87
|
-
const loadTlonChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-
|
|
87
|
+
const loadTlonChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-Cs7aibpm.js"));
|
|
88
88
|
const tlonSetupWizardProxy = createTlonSetupWizardBase({
|
|
89
89
|
resolveConfigured: async ({ cfg, accountId }) => await (await loadTlonChannelRuntime()).tlonSetupWizard.status.resolveConfigured({
|
|
90
90
|
cfg,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as tlonPlugin } from "./channel-
|
|
1
|
+
import { t as tlonPlugin } from "./channel-CKKTYJLK.js";
|
|
2
2
|
export { tlonPlugin };
|
|
@@ -1006,14 +1006,18 @@ var UrbitSSEClient = class {
|
|
|
1006
1006
|
if (this.reconnectAttempts >= this.maxReconnectAttempts) {
|
|
1007
1007
|
this.logger.log?.(`[SSE] Max reconnection attempts (${this.maxReconnectAttempts}) reached. Waiting 10s before resetting...`);
|
|
1008
1008
|
const extendedBackoff = 1e4;
|
|
1009
|
-
await new Promise((resolve) =>
|
|
1009
|
+
await new Promise((resolve) => {
|
|
1010
|
+
setTimeout(resolve, extendedBackoff);
|
|
1011
|
+
});
|
|
1010
1012
|
this.reconnectAttempts = 0;
|
|
1011
1013
|
this.logger.log?.("[SSE] Reconnection attempts reset, resuming reconnection...");
|
|
1012
1014
|
}
|
|
1013
1015
|
this.reconnectAttempts += 1;
|
|
1014
1016
|
const delay = Math.min(this.reconnectDelay * 2 ** (this.reconnectAttempts - 1), this.maxReconnectDelay);
|
|
1015
1017
|
this.logger.log?.(`[SSE] Reconnection attempt ${this.reconnectAttempts}/${this.maxReconnectAttempts} in ${delay}ms...`);
|
|
1016
|
-
await new Promise((resolve) =>
|
|
1018
|
+
await new Promise((resolve) => {
|
|
1019
|
+
setTimeout(resolve, delay);
|
|
1020
|
+
});
|
|
1017
1021
|
try {
|
|
1018
1022
|
this.channelId = `${Math.floor(Date.now() / 1e3)}-${randomUUID()}`;
|
|
1019
1023
|
this.channelUrl = new URL(`/~/channel/${this.channelId}`, this.url).toString();
|
|
@@ -2212,7 +2216,7 @@ async function monitorTlonProvider(opts = {}) {
|
|
|
2212
2216
|
const accountUrl = account.url;
|
|
2213
2217
|
const accountCode = account.code;
|
|
2214
2218
|
async function authenticateWithRetry(maxAttempts = 10) {
|
|
2215
|
-
for (
|
|
2219
|
+
for (const attempt of Array.from({ length: Math.max(1, maxAttempts) }, (_, index) => index + 1)) {
|
|
2216
2220
|
if (opts.abortSignal?.aborted) throw new Error("Aborted while waiting to authenticate");
|
|
2217
2221
|
try {
|
|
2218
2222
|
runtime.log?.(`[tlon] Attempting authentication to ${accountUrl}...`);
|
|
@@ -2234,6 +2238,7 @@ async function monitorTlonProvider(opts = {}) {
|
|
|
2234
2238
|
});
|
|
2235
2239
|
}
|
|
2236
2240
|
}
|
|
2241
|
+
throw new Error("unreachable Tlon authentication retry loop exit");
|
|
2237
2242
|
}
|
|
2238
2243
|
let api = null;
|
|
2239
2244
|
const cookie = await authenticateWithRetry();
|
|
@@ -2425,7 +2430,7 @@ async function monitorTlonProvider(opts = {}) {
|
|
|
2425
2430
|
fromShip: botShipName,
|
|
2426
2431
|
toShip: effectiveOwnerShip,
|
|
2427
2432
|
text: "⚠️ Security Warning: Multiple users are sharing a DM session with this bot. This can leak conversation context between users.\n\nFix: Add to your OpenClaw config:\nsession:\n dmScope: \"per-channel-peer\"\n\nDocs: https://docs.openclaw.ai/concepts/session#secure-dm-mode"
|
|
2428
|
-
}).catch((err) => runtime.error?.(`[tlon] Failed to send security warning to owner: ${err}`));
|
|
2433
|
+
}).catch((err) => runtime.error?.(`[tlon] Failed to send security warning to owner: ${formatErrorMessage$1(err)}`));
|
|
2429
2434
|
}
|
|
2430
2435
|
}
|
|
2431
2436
|
senders.add(senderShip);
|
|
@@ -2878,7 +2883,9 @@ async function monitorTlonProvider(opts = {}) {
|
|
|
2878
2883
|
await api.subscribe({
|
|
2879
2884
|
app: "channels",
|
|
2880
2885
|
path: "/v2",
|
|
2881
|
-
event:
|
|
2886
|
+
event: (event) => {
|
|
2887
|
+
handleChannelsFirehose(event);
|
|
2888
|
+
},
|
|
2882
2889
|
err: (error) => {
|
|
2883
2890
|
runtime.error?.(`[tlon] Channels firehose error: ${String(error)}`);
|
|
2884
2891
|
},
|
|
@@ -2890,7 +2897,9 @@ async function monitorTlonProvider(opts = {}) {
|
|
|
2890
2897
|
await api.subscribe({
|
|
2891
2898
|
app: "chat",
|
|
2892
2899
|
path: "/v3",
|
|
2893
|
-
event:
|
|
2900
|
+
event: (event) => {
|
|
2901
|
+
handleChatFirehose(event);
|
|
2902
|
+
},
|
|
2894
2903
|
err: (error) => {
|
|
2895
2904
|
runtime.error?.(`[tlon] Chat firehose error: ${String(error)}`);
|
|
2896
2905
|
},
|
|
@@ -2951,46 +2960,17 @@ async function monitorTlonProvider(opts = {}) {
|
|
|
2951
2960
|
await api.subscribe({
|
|
2952
2961
|
app: "groups",
|
|
2953
2962
|
path: "/groups/ui",
|
|
2954
|
-
event:
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
if (
|
|
2961
|
-
if (!watchedChannels.has(channelNest)) {
|
|
2962
|
-
watchedChannels.add(channelNest);
|
|
2963
|
-
runtime.log?.(`[tlon] Auto-detected new channel (invite accepted): ${channelNest}`);
|
|
2964
|
-
if (effectiveAutoAcceptGroupInvites) try {
|
|
2965
|
-
const currentChannels = currentSettings.groupChannels || [];
|
|
2966
|
-
if (!currentChannels.includes(channelNest)) {
|
|
2967
|
-
const updatedChannels = [...currentChannels, channelNest];
|
|
2968
|
-
await api.poke({
|
|
2969
|
-
app: "settings",
|
|
2970
|
-
mark: "settings-event",
|
|
2971
|
-
json: { "put-entry": {
|
|
2972
|
-
"bucket-key": "tlon",
|
|
2973
|
-
"entry-key": "groupChannels",
|
|
2974
|
-
value: updatedChannels,
|
|
2975
|
-
desk: "moltbot"
|
|
2976
|
-
} }
|
|
2977
|
-
});
|
|
2978
|
-
runtime.log?.(`[tlon] Persisted ${channelNest} to settings store`);
|
|
2979
|
-
}
|
|
2980
|
-
} catch (err) {
|
|
2981
|
-
runtime.error?.(`[tlon] Failed to persist channel to settings: ${String(err)}`);
|
|
2982
|
-
}
|
|
2983
|
-
}
|
|
2984
|
-
}
|
|
2985
|
-
const join = asRecord(eventRecord.join);
|
|
2986
|
-
if (join) {
|
|
2987
|
-
const joinChannels = Array.isArray(join.channels) ? join.channels : [];
|
|
2988
|
-
if (joinChannels.length > 0) for (const channelNest of joinChannels) {
|
|
2989
|
-
if (typeof channelNest !== "string") continue;
|
|
2963
|
+
event: (event) => {
|
|
2964
|
+
(async () => {
|
|
2965
|
+
try {
|
|
2966
|
+
const eventRecord = asRecord(event);
|
|
2967
|
+
if (eventRecord) {
|
|
2968
|
+
const channels = asRecord(eventRecord.channels);
|
|
2969
|
+
if (channels) for (const [channelNest, _channelData] of Object.entries(channels)) {
|
|
2990
2970
|
if (!channelNest.startsWith("chat/")) continue;
|
|
2991
2971
|
if (!watchedChannels.has(channelNest)) {
|
|
2992
2972
|
watchedChannels.add(channelNest);
|
|
2993
|
-
runtime.log?.(`[tlon] Auto-detected
|
|
2973
|
+
runtime.log?.(`[tlon] Auto-detected new channel (invite accepted): ${channelNest}`);
|
|
2994
2974
|
if (effectiveAutoAcceptGroupInvites) try {
|
|
2995
2975
|
const currentChannels = currentSettings.groupChannels || [];
|
|
2996
2976
|
if (!currentChannels.includes(channelNest)) {
|
|
@@ -3012,11 +2992,42 @@ async function monitorTlonProvider(opts = {}) {
|
|
|
3012
2992
|
}
|
|
3013
2993
|
}
|
|
3014
2994
|
}
|
|
2995
|
+
const join = asRecord(eventRecord.join);
|
|
2996
|
+
if (join) {
|
|
2997
|
+
const joinChannels = Array.isArray(join.channels) ? join.channels : [];
|
|
2998
|
+
if (joinChannels.length > 0) for (const channelNest of joinChannels) {
|
|
2999
|
+
if (typeof channelNest !== "string") continue;
|
|
3000
|
+
if (!channelNest.startsWith("chat/")) continue;
|
|
3001
|
+
if (!watchedChannels.has(channelNest)) {
|
|
3002
|
+
watchedChannels.add(channelNest);
|
|
3003
|
+
runtime.log?.(`[tlon] Auto-detected joined channel: ${channelNest}`);
|
|
3004
|
+
if (effectiveAutoAcceptGroupInvites) try {
|
|
3005
|
+
const currentChannels = currentSettings.groupChannels || [];
|
|
3006
|
+
if (!currentChannels.includes(channelNest)) {
|
|
3007
|
+
const updatedChannels = [...currentChannels, channelNest];
|
|
3008
|
+
await api.poke({
|
|
3009
|
+
app: "settings",
|
|
3010
|
+
mark: "settings-event",
|
|
3011
|
+
json: { "put-entry": {
|
|
3012
|
+
"bucket-key": "tlon",
|
|
3013
|
+
"entry-key": "groupChannels",
|
|
3014
|
+
value: updatedChannels,
|
|
3015
|
+
desk: "moltbot"
|
|
3016
|
+
} }
|
|
3017
|
+
});
|
|
3018
|
+
runtime.log?.(`[tlon] Persisted ${channelNest} to settings store`);
|
|
3019
|
+
}
|
|
3020
|
+
} catch (err) {
|
|
3021
|
+
runtime.error?.(`[tlon] Failed to persist channel to settings: ${String(err)}`);
|
|
3022
|
+
}
|
|
3023
|
+
}
|
|
3024
|
+
}
|
|
3025
|
+
}
|
|
3015
3026
|
}
|
|
3027
|
+
} catch (error) {
|
|
3028
|
+
runtime.error?.(`[tlon] Error handling groups-ui event: ${formatErrorMessage$1(error)}`);
|
|
3016
3029
|
}
|
|
3017
|
-
}
|
|
3018
|
-
runtime.error?.(`[tlon] Error handling groups-ui event: ${formatErrorMessage$1(error)}`);
|
|
3019
|
-
}
|
|
3030
|
+
})();
|
|
3020
3031
|
},
|
|
3021
3032
|
err: (error) => {
|
|
3022
3033
|
runtime.error?.(`[tlon] Groups-ui subscription error: ${String(error)}`);
|
|
@@ -3132,18 +3143,20 @@ async function monitorTlonProvider(opts = {}) {
|
|
|
3132
3143
|
runtime.log?.("[tlon] All subscriptions registered, connecting to SSE stream...");
|
|
3133
3144
|
await api.connect();
|
|
3134
3145
|
runtime.log?.("[tlon] Connected! Firehose subscriptions active");
|
|
3135
|
-
const pollInterval = setInterval(
|
|
3136
|
-
|
|
3137
|
-
if (
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
watchedChannels.
|
|
3141
|
-
|
|
3146
|
+
const pollInterval = setInterval(() => {
|
|
3147
|
+
(async () => {
|
|
3148
|
+
if (!opts.abortSignal?.aborted) try {
|
|
3149
|
+
if (effectiveAutoDiscoverChannels) {
|
|
3150
|
+
const discoveredChannels = await fetchAllChannels(api, runtime);
|
|
3151
|
+
for (const channelNest of discoveredChannels) if (!watchedChannels.has(channelNest)) {
|
|
3152
|
+
watchedChannels.add(channelNest);
|
|
3153
|
+
runtime.log?.(`[tlon] Now watching new channel: ${channelNest}`);
|
|
3154
|
+
}
|
|
3142
3155
|
}
|
|
3156
|
+
} catch (error) {
|
|
3157
|
+
runtime.error?.(`[tlon] Channel refresh error: ${formatErrorMessage$1(error)}`);
|
|
3143
3158
|
}
|
|
3144
|
-
}
|
|
3145
|
-
runtime.error?.(`[tlon] Channel refresh error: ${formatErrorMessage$1(error)}`);
|
|
3146
|
-
}
|
|
3159
|
+
})();
|
|
3147
3160
|
}, 120 * 1e3);
|
|
3148
3161
|
if (opts.abortSignal) {
|
|
3149
3162
|
const signal = opts.abortSignal;
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/tlon",
|
|
3
|
-
"version": "2026.5.31-beta.
|
|
3
|
+
"version": "2026.5.31-beta.4",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@openclaw/tlon",
|
|
9
|
-
"version": "2026.5.31-beta.
|
|
9
|
+
"version": "2026.5.31-beta.4",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@aws-sdk/client-s3": "3.1056.0",
|
|
12
12
|
"@aws-sdk/s3-request-presigner": "3.1056.0",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"zod": "4.4.3"
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
|
-
"openclaw": ">=2026.5.31-beta.
|
|
18
|
+
"openclaw": ">=2026.5.31-beta.4"
|
|
19
19
|
},
|
|
20
20
|
"peerDependenciesMeta": {
|
|
21
21
|
"openclaw": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/tlon",
|
|
3
|
-
"version": "2026.5.31-beta.
|
|
3
|
+
"version": "2026.5.31-beta.4",
|
|
4
4
|
"description": "OpenClaw Tlon/Urbit channel plugin for chat workflows.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"openclaw": "2026.5.28"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
|
-
"openclaw": ">=2026.5.31-beta.
|
|
22
|
+
"openclaw": ">=2026.5.31-beta.4"
|
|
23
23
|
},
|
|
24
24
|
"peerDependenciesMeta": {
|
|
25
25
|
"openclaw": {
|
|
@@ -73,10 +73,10 @@
|
|
|
73
73
|
"minHostVersion": ">=2026.4.10"
|
|
74
74
|
},
|
|
75
75
|
"compat": {
|
|
76
|
-
"pluginApi": ">=2026.5.31-beta.
|
|
76
|
+
"pluginApi": ">=2026.5.31-beta.4"
|
|
77
77
|
},
|
|
78
78
|
"build": {
|
|
79
|
-
"openclawVersion": "2026.5.31-beta.
|
|
79
|
+
"openclawVersion": "2026.5.31-beta.4"
|
|
80
80
|
},
|
|
81
81
|
"release": {
|
|
82
82
|
"bundleRuntimeDependencies": false,
|