@openclaw/tlon 2026.7.2-beta.5 → 2026.7.2-beta.7
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 ssrfPolicyFromDangerouslyAllowPrivateNetwork, i as isBlockedHostnameOrIp, n as createDedupeCache, o as createLoggerBackedRuntime, r as fetchWithSsrFGuard, t as SsrFBlockedError } from "./runtime-api-BXVe40nS.js";
|
|
2
|
-
import { t as tlonPlugin } from "./channel-
|
|
2
|
+
import { t as tlonPlugin } from "./channel-DqQ3r1FI.js";
|
|
3
3
|
import { n as setTlonRuntime } from "./runtime-Ck3lNvST.js";
|
|
4
4
|
export { SsrFBlockedError, createDedupeCache, createLoggerBackedRuntime, fetchWithSsrFGuard, isBlockedHostnameOrIp, setTlonRuntime, ssrfPolicyFromDangerouslyAllowPrivateNetwork, tlonPlugin };
|
|
@@ -91,7 +91,7 @@ function resolveTlonOutboundSessionRoute(params) {
|
|
|
91
91
|
//#endregion
|
|
92
92
|
//#region extensions/tlon/src/channel.ts
|
|
93
93
|
const TLON_CHANNEL_ID = "tlon";
|
|
94
|
-
const loadTlonChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-
|
|
94
|
+
const loadTlonChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-D9SOTGdH.js"));
|
|
95
95
|
const tlonSetupWizardProxy = createTlonSetupWizardBase({
|
|
96
96
|
resolveConfigured: async ({ cfg, accountId }) => await (await loadTlonChannelRuntime()).tlonSetupWizard.status.resolveConfigured({
|
|
97
97
|
cfg,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as tlonPlugin } from "./channel-
|
|
1
|
+
import { t as tlonPlugin } from "./channel-DqQ3r1FI.js";
|
|
2
2
|
export { tlonPlugin };
|
|
@@ -3,9 +3,9 @@ import { c as normalizeUrbitHostname, d as resolveTlonAccount, f as formatTarget
|
|
|
3
3
|
import { t as getTlonRuntime } from "./runtime-Ck3lNvST.js";
|
|
4
4
|
import { t as tlonSetupWizard } from "./setup-surface-1WtsAw4R.js";
|
|
5
5
|
import { fetchWithSsrFGuard, ssrfPolicyFromDangerouslyAllowPrivateNetwork } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
6
|
-
import { bindIngressLifecycleToReplyOptions, createChannelIngressMonitor, createMessageReceiptFromOutboundResults } from "openclaw/plugin-sdk/channel-outbound";
|
|
6
|
+
import { bindIngressLifecycleToReplyOptions, createChannelIngressError, createChannelIngressMonitor, createMessageReceiptFromOutboundResults, waitUntilAbort } from "openclaw/plugin-sdk/channel-outbound";
|
|
7
7
|
import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
|
|
8
|
-
import { asFiniteNumber, normalizeLowercaseStringOrEmpty, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
|
+
import { asFiniteNumber, normalizeLowercaseStringOrEmpty, normalizeNullableString, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
9
9
|
import crypto, { randomBytes, randomUUID } from "node:crypto";
|
|
10
10
|
import { readProviderJsonResponse, readResponseTextLimited } from "openclaw/plugin-sdk/provider-http";
|
|
11
11
|
import { runChannelProbe, sliceUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
@@ -18,6 +18,7 @@ import { resolveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
|
|
|
18
18
|
import { resolveAllowlistMatchByCandidates } from "openclaw/plugin-sdk/allow-from";
|
|
19
19
|
import { resolveChannelImplicitMentions, resolveStableChannelMessageIngress } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
20
20
|
import { collectErrorGraphCandidates, formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
21
|
+
import { isRecord } from "openclaw/plugin-sdk/channel-secret-basic-runtime";
|
|
21
22
|
import { mkdir, writeFile } from "node:fs/promises";
|
|
22
23
|
import * as path from "node:path";
|
|
23
24
|
import { extensionForMime } from "openclaw/plugin-sdk/media-mime";
|
|
@@ -992,6 +993,7 @@ var UrbitSSEClient = class {
|
|
|
992
993
|
this.lastHeardEventId = -1;
|
|
993
994
|
this.lastAcknowledgedEventId = -1;
|
|
994
995
|
this.ackThreshold = 20;
|
|
996
|
+
this.reconnectAbortController = new AbortController();
|
|
995
997
|
const ctx = getUrbitContext(url, options.ship);
|
|
996
998
|
this.url = ctx.baseUrl;
|
|
997
999
|
this.cookie = normalizeUrbitCookie(cookie);
|
|
@@ -1268,20 +1270,14 @@ var UrbitSSEClient = class {
|
|
|
1268
1270
|
}
|
|
1269
1271
|
if (this.reconnectAttempts >= this.maxReconnectAttempts) {
|
|
1270
1272
|
this.logger.log?.(`[SSE] Max reconnection attempts (${this.maxReconnectAttempts}) reached. Waiting 10s before resetting...`);
|
|
1271
|
-
|
|
1272
|
-
await new Promise((resolve) => {
|
|
1273
|
-
setTimeout(resolve, extendedBackoff);
|
|
1274
|
-
});
|
|
1273
|
+
if (!await this.waitForReconnectDelay(1e4) || this.aborted) return;
|
|
1275
1274
|
this.reconnectAttempts = 0;
|
|
1276
1275
|
this.logger.log?.("[SSE] Reconnection attempts reset, resuming reconnection...");
|
|
1277
1276
|
}
|
|
1278
1277
|
this.reconnectAttempts += 1;
|
|
1279
1278
|
const delay = Math.min(this.reconnectDelay * 2 ** (this.reconnectAttempts - 1), this.maxReconnectDelay);
|
|
1280
1279
|
this.logger.log?.(`[SSE] Reconnection attempt ${this.reconnectAttempts}/${this.maxReconnectAttempts} in ${delay}ms...`);
|
|
1281
|
-
await
|
|
1282
|
-
setTimeout(resolve, delay);
|
|
1283
|
-
});
|
|
1284
|
-
if (this.aborted || !this.autoReconnect) return;
|
|
1280
|
+
if (!await this.waitForReconnectDelay(delay) || this.aborted || !this.autoReconnect) return;
|
|
1285
1281
|
try {
|
|
1286
1282
|
if (this.onReconnect) await this.onReconnect(this);
|
|
1287
1283
|
try {
|
|
@@ -1303,6 +1299,7 @@ var UrbitSSEClient = class {
|
|
|
1303
1299
|
stopReceiving() {
|
|
1304
1300
|
this.aborted = true;
|
|
1305
1301
|
this.isConnected = false;
|
|
1302
|
+
this.reconnectAbortController.abort();
|
|
1306
1303
|
this.streamController?.abort();
|
|
1307
1304
|
}
|
|
1308
1305
|
async close() {
|
|
@@ -1353,6 +1350,15 @@ var UrbitSSEClient = class {
|
|
|
1353
1350
|
await release();
|
|
1354
1351
|
}
|
|
1355
1352
|
}
|
|
1353
|
+
async waitForReconnectDelay(delayMs) {
|
|
1354
|
+
try {
|
|
1355
|
+
await sleepWithAbort(delayMs, this.reconnectAbortController.signal);
|
|
1356
|
+
return true;
|
|
1357
|
+
} catch (error) {
|
|
1358
|
+
if (this.reconnectAbortController.signal.aborted) return false;
|
|
1359
|
+
throw error;
|
|
1360
|
+
}
|
|
1361
|
+
}
|
|
1356
1362
|
async putChannelPayload(payload, params) {
|
|
1357
1363
|
return await urbitFetch({
|
|
1358
1364
|
baseUrl: this.url,
|
|
@@ -2246,31 +2252,16 @@ async function fetchThreadHistory(api, channelNest, parentId, count = 50, runtim
|
|
|
2246
2252
|
//#region extensions/tlon/src/monitor/ingress.ts
|
|
2247
2253
|
const TLON_INGRESS_PAYLOAD_VERSION = 1;
|
|
2248
2254
|
const TLON_INGRESS_POLL_INTERVAL_MS = 1e3;
|
|
2249
|
-
const
|
|
2250
|
-
const TLON_INGRESS_FAILED_TTL_MS = 720 * 60 * 60 * 1e3;
|
|
2251
|
-
const TLON_INGRESS_TOMBSTONE_MAX_ENTRIES = 2e3;
|
|
2252
|
-
var TlonIngressPermanentError = class extends Error {
|
|
2253
|
-
constructor(reason, message, options) {
|
|
2254
|
-
super(message, options);
|
|
2255
|
-
this.reason = reason;
|
|
2256
|
-
this.name = "TlonIngressPermanentError";
|
|
2257
|
-
}
|
|
2258
|
-
};
|
|
2255
|
+
const TlonIngressPermanentError = createChannelIngressError("TlonIngressPermanentError", { withReason: true });
|
|
2259
2256
|
var TlonIngressShutdownError = class extends Error {
|
|
2260
2257
|
constructor() {
|
|
2261
2258
|
super("Tlon ingress stopped before dispatch adoption.");
|
|
2262
2259
|
this.name = "TlonIngressShutdownError";
|
|
2263
2260
|
}
|
|
2264
2261
|
};
|
|
2265
|
-
function isRecord(value) {
|
|
2266
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
2267
|
-
}
|
|
2268
|
-
function nonEmptyString(value) {
|
|
2269
|
-
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
2270
|
-
}
|
|
2271
2262
|
function inspectChannelsEvent(event) {
|
|
2272
2263
|
const envelope = isRecord(event) ? event : null;
|
|
2273
|
-
const nest =
|
|
2264
|
+
const nest = normalizeNullableString(envelope?.nest);
|
|
2274
2265
|
const response = isRecord(envelope?.response) ? envelope.response : null;
|
|
2275
2266
|
const post = isRecord(response?.post) ? response.post : null;
|
|
2276
2267
|
const rPost = isRecord(post?.["r-post"]) ? post["r-post"] : null;
|
|
@@ -2279,7 +2270,7 @@ function inspectChannelsEvent(event) {
|
|
|
2279
2270
|
const rReply = isRecord(reply?.["r-reply"]) ? reply["r-reply"] : null;
|
|
2280
2271
|
const replySet = isRecord(rReply?.set) ? rReply.set : null;
|
|
2281
2272
|
if (!nest || !isRecord(set?.essay) && !isRecord(replySet?.memo)) return null;
|
|
2282
|
-
const eventId =
|
|
2273
|
+
const eventId = normalizeNullableString(isRecord(replySet?.memo) ? reply?.id : post?.id);
|
|
2283
2274
|
return eventId ? {
|
|
2284
2275
|
eventId,
|
|
2285
2276
|
laneKey: `group:${nest}`
|
|
@@ -2290,10 +2281,10 @@ function inspectChatEvent(event) {
|
|
|
2290
2281
|
const response = isRecord(envelope?.response) ? envelope.response : null;
|
|
2291
2282
|
const add = isRecord(response?.add) ? response.add : null;
|
|
2292
2283
|
const essay = isRecord(add?.essay) ? add.essay : null;
|
|
2293
|
-
const eventId =
|
|
2284
|
+
const eventId = normalizeNullableString(envelope?.id);
|
|
2294
2285
|
if (!essay || !eventId) return null;
|
|
2295
|
-
const whom = isRecord(envelope?.whom) ?
|
|
2296
|
-
const peer =
|
|
2286
|
+
const whom = isRecord(envelope?.whom) ? normalizeNullableString(envelope.whom.ship) : null;
|
|
2287
|
+
const peer = normalizeNullableString(envelope?.whom) ?? whom ?? normalizeNullableString(essay.author);
|
|
2297
2288
|
return {
|
|
2298
2289
|
eventId,
|
|
2299
2290
|
laneKey: peer ? `direct:${peer}` : `event:${eventId}`
|
|
@@ -2358,10 +2349,9 @@ function createTlonIngressMonitor(options) {
|
|
|
2358
2349
|
deliver: (raw, lifecycle) => options.dispatch(raw.source, raw.event, lifecycle),
|
|
2359
2350
|
pollIntervalMs: options.pollIntervalMs ?? TLON_INGRESS_POLL_INTERVAL_MS,
|
|
2360
2351
|
retention: {
|
|
2361
|
-
|
|
2362
|
-
completedMaxEntries:
|
|
2363
|
-
|
|
2364
|
-
failedMaxEntries: TLON_INGRESS_TOMBSTONE_MAX_ENTRIES
|
|
2352
|
+
completedTtlMs: void 0,
|
|
2353
|
+
completedMaxEntries: 2e3,
|
|
2354
|
+
failedMaxEntries: 2e3
|
|
2365
2355
|
},
|
|
2366
2356
|
appendRetryDelaysMs: [0],
|
|
2367
2357
|
drain: {
|
|
@@ -3613,15 +3603,9 @@ async function monitorTlonProvider(opts = {}) {
|
|
|
3613
3603
|
}
|
|
3614
3604
|
})();
|
|
3615
3605
|
}, 120 * 1e3);
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
signal.addEventListener("abort", () => {
|
|
3620
|
-
clearInterval(pollInterval);
|
|
3621
|
-
resolve(null);
|
|
3622
|
-
}, { once: true });
|
|
3623
|
-
});
|
|
3624
|
-
} else await new Promise(() => {});
|
|
3606
|
+
await waitUntilAbort(opts.abortSignal, () => {
|
|
3607
|
+
clearInterval(pollInterval);
|
|
3608
|
+
});
|
|
3625
3609
|
} finally {
|
|
3626
3610
|
api?.stopReceiving();
|
|
3627
3611
|
await ingress.stop();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/tlon",
|
|
3
|
-
"version": "2026.7.2-beta.
|
|
3
|
+
"version": "2026.7.2-beta.7",
|
|
4
4
|
"description": "OpenClaw Tlon/Urbit channel plugin for chat workflows.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
},
|
|
9
9
|
"type": "module",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@aws-sdk/client-s3": "3.
|
|
12
|
-
"@aws-sdk/s3-request-presigner": "3.
|
|
13
|
-
"@tloncorp/tlon-skill": "0.4.
|
|
11
|
+
"@aws-sdk/client-s3": "3.1095.0",
|
|
12
|
+
"@aws-sdk/s3-request-presigner": "3.1095.0",
|
|
13
|
+
"@tloncorp/tlon-skill": "0.4.4",
|
|
14
14
|
"@urbit/aura": "3.0.0",
|
|
15
15
|
"zod": "4.4.3"
|
|
16
16
|
},
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"openclaw": "workspace:*"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
|
-
"openclaw": ">=2026.7.2-beta.
|
|
22
|
+
"openclaw": ">=2026.7.2-beta.7"
|
|
23
23
|
},
|
|
24
24
|
"peerDependenciesMeta": {
|
|
25
25
|
"openclaw": {
|
|
@@ -120,10 +120,10 @@
|
|
|
120
120
|
"minHostVersion": ">=2026.4.10"
|
|
121
121
|
},
|
|
122
122
|
"compat": {
|
|
123
|
-
"pluginApi": ">=2026.7.2-beta.
|
|
123
|
+
"pluginApi": ">=2026.7.2-beta.7"
|
|
124
124
|
},
|
|
125
125
|
"build": {
|
|
126
|
-
"openclawVersion": "2026.7.2-beta.
|
|
126
|
+
"openclawVersion": "2026.7.2-beta.7"
|
|
127
127
|
},
|
|
128
128
|
"release": {
|
|
129
129
|
"bundleRuntimeDependencies": false,
|