@openclaw/tlon 2026.8.1 → 2026.8.2
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-DNfdPgst.js";
|
|
3
3
|
import { n as setTlonRuntime } from "./runtime-Ck3lNvST.js";
|
|
4
4
|
export { SsrFBlockedError, createDedupeCache, createLoggerBackedRuntime, fetchWithSsrFGuard, isBlockedHostnameOrIp, setTlonRuntime, ssrfPolicyFromDangerouslyAllowPrivateNetwork, tlonPlugin };
|
|
@@ -41,13 +41,14 @@ const tlonCommonConfigFields = {
|
|
|
41
41
|
ownerShip: ShipSchema.optional()
|
|
42
42
|
};
|
|
43
43
|
const TlonAccountSchema = z.object({ ...tlonCommonConfigFields });
|
|
44
|
-
const
|
|
44
|
+
const TlonConfigSchema = z.object({
|
|
45
45
|
...tlonCommonConfigFields,
|
|
46
46
|
historyLimit: z.number().int().min(0).optional(),
|
|
47
47
|
authorization: TlonAuthorizationSchema.optional(),
|
|
48
48
|
defaultAuthorizedShips: z.array(ShipSchema).optional(),
|
|
49
49
|
accounts: z.record(z.string(), TlonAccountSchema).optional()
|
|
50
|
-
})
|
|
50
|
+
});
|
|
51
|
+
const tlonChannelConfigSchema = buildChannelConfigSchema(TlonConfigSchema, { uiHints: createChannelConfigUiHints({
|
|
51
52
|
channelLabel: "Tlon",
|
|
52
53
|
implicitMentions: true
|
|
53
54
|
}) });
|
|
@@ -94,7 +95,7 @@ function resolveTlonOutboundSessionRoute(params) {
|
|
|
94
95
|
//#endregion
|
|
95
96
|
//#region extensions/tlon/src/channel.ts
|
|
96
97
|
const TLON_CHANNEL_ID = "tlon";
|
|
97
|
-
const loadTlonChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-
|
|
98
|
+
const loadTlonChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-B9iTxLl0.js"));
|
|
98
99
|
const tlonSetupWizardProxy = createTlonSetupWizardBase({
|
|
99
100
|
resolveConfigured: async ({ cfg, accountId }) => await (await loadTlonChannelRuntime()).tlonSetupWizard.status.resolveConfigured({
|
|
100
101
|
cfg,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as tlonPlugin } from "./channel-
|
|
1
|
+
import { t as tlonPlugin } from "./channel-DNfdPgst.js";
|
|
2
2
|
export { tlonPlugin };
|
|
@@ -161,9 +161,7 @@ function applySettingsUpdate(current, key, value) {
|
|
|
161
161
|
case "ownerShip":
|
|
162
162
|
next.ownerShip = typeof value === "string" ? value : void 0;
|
|
163
163
|
break;
|
|
164
|
-
case "pendingApprovals":
|
|
165
|
-
next.pendingApprovals = parsePendingApprovals(value);
|
|
166
|
-
break;
|
|
164
|
+
case "pendingApprovals": next.pendingApprovals = parsePendingApprovals(value);
|
|
167
165
|
}
|
|
168
166
|
return next;
|
|
169
167
|
}
|
|
@@ -286,8 +284,9 @@ var UrbitAuthError = class extends UrbitError {
|
|
|
286
284
|
async function urbitFetch(params) {
|
|
287
285
|
const validated = validateUrbitBaseUrl(params.baseUrl);
|
|
288
286
|
if (!validated.ok) throw new UrbitUrlError(validated.error);
|
|
287
|
+
const url = new URL(params.path, validated.baseUrl).toString();
|
|
289
288
|
const guarded = await fetchWithSsrFGuard({
|
|
290
|
-
url
|
|
289
|
+
url,
|
|
291
290
|
fetchImpl: params.fetchImpl,
|
|
292
291
|
init: params.init,
|
|
293
292
|
timeoutMs: params.timeoutMs,
|
|
@@ -308,7 +307,7 @@ async function urbitFetch(params) {
|
|
|
308
307
|
}
|
|
309
308
|
//#endregion
|
|
310
309
|
//#region extensions/tlon/src/urbit/auth.ts
|
|
311
|
-
const MAX_AUTH_BODY_DRAIN_BYTES =
|
|
310
|
+
const MAX_AUTH_BODY_DRAIN_BYTES = 65536;
|
|
312
311
|
async function authenticate(url, code, options = {}) {
|
|
313
312
|
const { response, release } = await urbitFetch({
|
|
314
313
|
baseUrl: url,
|
|
@@ -888,7 +887,7 @@ async function putUrbitChannel(deps, params) {
|
|
|
888
887
|
auditContext: params.auditContext
|
|
889
888
|
});
|
|
890
889
|
}
|
|
891
|
-
const TLON_ERROR_BODY_LIMIT_BYTES =
|
|
890
|
+
const TLON_ERROR_BODY_LIMIT_BYTES = 16384;
|
|
892
891
|
async function pokeUrbitChannel(deps, params) {
|
|
893
892
|
const pokeId = Date.now();
|
|
894
893
|
const { response, release } = await putUrbitChannel(deps, {
|
|
@@ -982,7 +981,7 @@ async function ensureUrbitChannelOpen(deps, params) {
|
|
|
982
981
|
}
|
|
983
982
|
//#endregion
|
|
984
983
|
//#region extensions/tlon/src/urbit/sse-client.ts
|
|
985
|
-
const MAX_SSE_PAYLOAD_BYTES =
|
|
984
|
+
const MAX_SSE_PAYLOAD_BYTES = 16777216;
|
|
986
985
|
function parseUrbitSsePayload(data) {
|
|
987
986
|
if (Buffer.byteLength(data, "utf8") > MAX_SSE_PAYLOAD_BYTES) throw new Error("Tlon Urbit SSE payload exceeds 16 MiB limit");
|
|
988
987
|
try {
|
|
@@ -1078,7 +1077,7 @@ var UrbitSSEClient = class {
|
|
|
1078
1077
|
});
|
|
1079
1078
|
try {
|
|
1080
1079
|
if (!response.ok && response.status !== 204) {
|
|
1081
|
-
const errorText = await readResponseTextLimited(response,
|
|
1080
|
+
const errorText = await readResponseTextLimited(response, 16384).catch(() => "");
|
|
1082
1081
|
throw new Error(`Subscribe failed: ${response.status}${errorText ? ` - ${errorText}` : ""}`);
|
|
1083
1082
|
}
|
|
1084
1083
|
} finally {
|
|
@@ -1720,31 +1719,29 @@ function createTlonApprovalRuntime(params) {
|
|
|
1720
1719
|
}
|
|
1721
1720
|
}
|
|
1722
1721
|
break;
|
|
1723
|
-
case "group":
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1722
|
+
case "group": if (approval.groupFlag) try {
|
|
1723
|
+
await api.poke({
|
|
1724
|
+
app: "groups",
|
|
1725
|
+
mark: "group-join",
|
|
1726
|
+
json: {
|
|
1727
|
+
flag: approval.groupFlag,
|
|
1728
|
+
"join-all": true
|
|
1729
|
+
}
|
|
1730
|
+
});
|
|
1731
|
+
runtime.log?.(`[tlon] Joined group ${approval.groupFlag} after approval`);
|
|
1732
|
+
setTimeout(() => {
|
|
1733
|
+
(async () => {
|
|
1734
|
+
try {
|
|
1735
|
+
const newCount = await refreshWatchedChannels();
|
|
1736
|
+
if (newCount > 0) runtime.log?.(`[tlon] Discovered ${newCount} new channel(s) after joining group`);
|
|
1737
|
+
} catch (err) {
|
|
1738
|
+
runtime.log?.(`[tlon] Channel discovery after group join failed: ${String(err)}`);
|
|
1731
1739
|
}
|
|
1732
|
-
});
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
const newCount = await refreshWatchedChannels();
|
|
1738
|
-
if (newCount > 0) runtime.log?.(`[tlon] Discovered ${newCount} new channel(s) after joining group`);
|
|
1739
|
-
} catch (err) {
|
|
1740
|
-
runtime.log?.(`[tlon] Channel discovery after group join failed: ${String(err)}`);
|
|
1741
|
-
}
|
|
1742
|
-
})();
|
|
1743
|
-
}, 2e3);
|
|
1744
|
-
} catch (err) {
|
|
1745
|
-
runtime.error?.(`[tlon] Failed to join group ${approval.groupFlag}: ${String(err)}`);
|
|
1746
|
-
}
|
|
1747
|
-
break;
|
|
1740
|
+
})();
|
|
1741
|
+
}, 2e3);
|
|
1742
|
+
} catch (err) {
|
|
1743
|
+
runtime.error?.(`[tlon] Failed to join group ${approval.groupFlag}: ${String(err)}`);
|
|
1744
|
+
}
|
|
1748
1745
|
}
|
|
1749
1746
|
await sendOwnerNotification(formatApprovalConfirmation(approval, "approve"));
|
|
1750
1747
|
} else if (parsed.action === "block") {
|
|
@@ -2076,7 +2073,8 @@ function createTlonCitationResolver(params) {
|
|
|
2076
2073
|
try {
|
|
2077
2074
|
const scryPath = `/channels/v4/${cite.nest}/posts/post/${cite.postId}.json`;
|
|
2078
2075
|
runtime.log?.(`[tlon] Fetching cited post: ${scryPath}`);
|
|
2079
|
-
const
|
|
2076
|
+
const data = asNullableRecord(await api.scry(scryPath));
|
|
2077
|
+
const essay = asNullableRecord(data?.essay);
|
|
2080
2078
|
if (essay?.content) return extractMessageText(essay.content) || null;
|
|
2081
2079
|
return null;
|
|
2082
2080
|
} catch (err) {
|
|
@@ -2112,7 +2110,8 @@ async function fetchInitData(api, runtime) {
|
|
|
2112
2110
|
const channels = [];
|
|
2113
2111
|
const groups = asNullableRecord(initData?.groups);
|
|
2114
2112
|
if (groups) for (const groupData of Object.values(groups)) {
|
|
2115
|
-
const
|
|
2113
|
+
const typedGroupData = asNullableRecord(groupData);
|
|
2114
|
+
const groupChannels = asNullableRecord(typedGroupData?.channels);
|
|
2116
2115
|
if (groupChannels) {
|
|
2117
2116
|
for (const channelNest of Object.keys(groupChannels)) if (channelNest.startsWith("chat/")) channels.push(channelNest);
|
|
2118
2117
|
}
|
|
@@ -2187,7 +2186,8 @@ async function fetchChannelHistory(api, channelNest, count = 50, runtime) {
|
|
|
2187
2186
|
}
|
|
2188
2187
|
const messages = posts.map((item) => {
|
|
2189
2188
|
const itemRecord = asNullableRecord(item);
|
|
2190
|
-
const
|
|
2189
|
+
const replyPost = asNullableRecord(itemRecord?.["r-post"]);
|
|
2190
|
+
const replyPostSet = asNullableRecord(replyPost?.set);
|
|
2191
2191
|
const essay = asNullableRecord(itemRecord?.essay) ?? asNullableRecord(replyPostSet?.essay);
|
|
2192
2192
|
const seal = asNullableRecord(itemRecord?.seal) ?? asNullableRecord(replyPostSet?.seal);
|
|
2193
2193
|
return {
|
|
@@ -2239,7 +2239,8 @@ async function fetchThreadHistory(api, channelNest, parentId, count = 50, runtim
|
|
|
2239
2239
|
}
|
|
2240
2240
|
const messages = replies.map((item) => {
|
|
2241
2241
|
const itemRecord = asNullableRecord(item);
|
|
2242
|
-
const
|
|
2242
|
+
const replyRecord = asNullableRecord(itemRecord?.["r-reply"]);
|
|
2243
|
+
const replySet = asNullableRecord(replyRecord?.set);
|
|
2243
2244
|
return createHistoryEntryFromMemo({
|
|
2244
2245
|
memo: asNullableRecord(itemRecord?.memo) ?? asNullableRecord(replySet?.memo) ?? itemRecord,
|
|
2245
2246
|
seal: asNullableRecord(itemRecord?.seal) ?? asNullableRecord(replySet?.seal),
|
|
@@ -2254,7 +2255,8 @@ async function fetchThreadHistory(api, channelNest, parentId, count = 50, runtim
|
|
|
2254
2255
|
const altPath = `/channels/v4/${channelNest}/posts/post/id/${formatUd(parentId)}.json`;
|
|
2255
2256
|
runtime?.log?.(`[tlon] Trying alternate path: ${altPath}`);
|
|
2256
2257
|
const data = asNullableRecord(await api.scry(altPath));
|
|
2257
|
-
const
|
|
2258
|
+
const dataSeal = asNullableRecord(data?.seal);
|
|
2259
|
+
const dataMeta = asNullableRecord(dataSeal?.meta);
|
|
2258
2260
|
const repliesValue = data?.replies;
|
|
2259
2261
|
if (typeof dataMeta?.replyCount === "number" && dataMeta.replyCount > 0 && repliesValue) {
|
|
2260
2262
|
const messages = (Array.isArray(repliesValue) ? repliesValue : Object.values(repliesValue)).map((reply) => {
|
|
@@ -2783,7 +2785,8 @@ async function monitorTlonProvider(opts = {}) {
|
|
|
2783
2785
|
* Returns empty string if whom doesn't contain a valid patp-like value.
|
|
2784
2786
|
*/
|
|
2785
2787
|
function extractDmPartnerShip(whom) {
|
|
2786
|
-
const
|
|
2788
|
+
const raw = typeof whom === "string" ? whom : whom && typeof whom === "object" && "ship" in whom && typeof whom.ship === "string" ? whom.ship : "";
|
|
2789
|
+
const normalized = normalizeShip(raw);
|
|
2787
2790
|
return /^~?[a-z-]+$/i.test(normalized) ? normalized : "";
|
|
2788
2791
|
}
|
|
2789
2792
|
const processMessage = async (params) => {
|
|
@@ -3146,7 +3149,8 @@ async function monitorTlonProvider(opts = {}) {
|
|
|
3146
3149
|
const rPost = asNullableRecord(post?.["r-post"]);
|
|
3147
3150
|
const set = asNullableRecord(rPost?.set);
|
|
3148
3151
|
const reply = asNullableRecord(rPost?.reply);
|
|
3149
|
-
const
|
|
3152
|
+
const replyPayload = asNullableRecord(reply?.["r-reply"]);
|
|
3153
|
+
const replySet = asNullableRecord(replyPayload?.set);
|
|
3150
3154
|
const essay = asNullableRecord(set?.essay);
|
|
3151
3155
|
const memo = asNullableRecord(replySet?.memo);
|
|
3152
3156
|
if (!essay && !memo) return;
|
|
@@ -3441,7 +3445,9 @@ async function monitorTlonProvider(opts = {}) {
|
|
|
3441
3445
|
try {
|
|
3442
3446
|
const eventRecord = asNullableRecord(event);
|
|
3443
3447
|
if (eventRecord?.self) {
|
|
3444
|
-
const
|
|
3448
|
+
const selfUpdate = asNullableRecord(eventRecord.self);
|
|
3449
|
+
const contact = asNullableRecord(selfUpdate?.contact);
|
|
3450
|
+
const nickname = asNullableRecord(contact?.nickname);
|
|
3445
3451
|
if (nickname && "value" in nickname) {
|
|
3446
3452
|
const newNickname = readStringField(nickname, "value") ?? null;
|
|
3447
3453
|
if (newNickname !== botNickname) {
|
|
@@ -3633,7 +3639,7 @@ async function monitorTlonProvider(opts = {}) {
|
|
|
3633
3639
|
runtime.error?.(`[tlon] Channel refresh error: ${formatErrorMessage(error)}`);
|
|
3634
3640
|
}
|
|
3635
3641
|
})();
|
|
3636
|
-
},
|
|
3642
|
+
}, 12e4);
|
|
3637
3643
|
await waitUntilAbort(opts.abortSignal, () => {
|
|
3638
3644
|
clearInterval(pollInterval);
|
|
3639
3645
|
});
|
|
@@ -3651,7 +3657,7 @@ async function monitorTlonProvider(opts = {}) {
|
|
|
3651
3657
|
//#region extensions/tlon/src/tlon-api.ts
|
|
3652
3658
|
const MEMEX_BASE_URL = "https://memex.tlon.network";
|
|
3653
3659
|
/** Max bytes to read from the Memex upload JSON response. */
|
|
3654
|
-
const MEMEX_UPLOAD_RESPONSE_MAX_BYTES =
|
|
3660
|
+
const MEMEX_UPLOAD_RESPONSE_MAX_BYTES = 65536;
|
|
3655
3661
|
/** Total deadline for the Memex upload URL lookup, including DNS and response reading. */
|
|
3656
3662
|
const TLON_MEMEX_UPLOAD_URL_TIMEOUT_MS = 3e4;
|
|
3657
3663
|
/** Total deadline for Memex and custom S3 PUTs, including DNS and the full upload. */
|
|
@@ -3851,13 +3857,14 @@ async function uploadFile(params) {
|
|
|
3851
3857
|
"Content-Type": contentType,
|
|
3852
3858
|
"x-amz-acl": "public-read"
|
|
3853
3859
|
};
|
|
3854
|
-
const
|
|
3860
|
+
const command = new PutObjectCommand({
|
|
3855
3861
|
Bucket: storageConfig.currentBucket,
|
|
3856
3862
|
Key: fileKey,
|
|
3857
3863
|
ContentType: headers["Content-Type"],
|
|
3858
3864
|
CacheControl: headers["Cache-Control"],
|
|
3859
3865
|
ACL: "public-read"
|
|
3860
|
-
})
|
|
3866
|
+
});
|
|
3867
|
+
const signedUrl = await getSignedUrl(client, command, { expiresIn: 3600 });
|
|
3861
3868
|
let guarded;
|
|
3862
3869
|
try {
|
|
3863
3870
|
guarded = await fetchWithSsrFGuard({
|
|
@@ -3949,7 +3956,7 @@ async function createHttpPokeApi(params) {
|
|
|
3949
3956
|
});
|
|
3950
3957
|
try {
|
|
3951
3958
|
if (!response.ok && response.status !== 204) {
|
|
3952
|
-
const errorText = await readResponseTextLimited(response,
|
|
3959
|
+
const errorText = await readResponseTextLimited(response, 16384);
|
|
3953
3960
|
throw new Error(`Poke failed: ${response.status} - ${errorText}`);
|
|
3954
3961
|
}
|
|
3955
3962
|
return pokeId;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/tlon",
|
|
3
|
-
"version": "2026.8.
|
|
3
|
+
"version": "2026.8.2",
|
|
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.8.
|
|
22
|
+
"openclaw": ">=2026.8.2"
|
|
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.8.
|
|
123
|
+
"pluginApi": ">=2026.8.2"
|
|
124
124
|
},
|
|
125
125
|
"build": {
|
|
126
|
-
"openclawVersion": "2026.8.
|
|
126
|
+
"openclawVersion": "2026.8.2"
|
|
127
127
|
},
|
|
128
128
|
"release": {
|
|
129
129
|
"bundleRuntimeDependencies": false,
|