@openclaw/tlon 2026.8.2 → 2026.9.1
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-kxGvWAPU.js";
|
|
3
3
|
import { n as setTlonRuntime } from "./runtime-Ck3lNvST.js";
|
|
4
4
|
export { SsrFBlockedError, createDedupeCache, createLoggerBackedRuntime, fetchWithSsrFGuard, isBlockedHostnameOrIp, setTlonRuntime, ssrfPolicyFromDangerouslyAllowPrivateNetwork, tlonPlugin };
|
|
@@ -95,7 +95,7 @@ function resolveTlonOutboundSessionRoute(params) {
|
|
|
95
95
|
//#endregion
|
|
96
96
|
//#region extensions/tlon/src/channel.ts
|
|
97
97
|
const TLON_CHANNEL_ID = "tlon";
|
|
98
|
-
const loadTlonChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-
|
|
98
|
+
const loadTlonChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-C-K7iVvC.js"));
|
|
99
99
|
const tlonSetupWizardProxy = createTlonSetupWizardBase({
|
|
100
100
|
resolveConfigured: async ({ cfg, accountId }) => await (await loadTlonChannelRuntime()).tlonSetupWizard.status.resolveConfigured({
|
|
101
101
|
cfg,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as tlonPlugin } from "./channel-
|
|
1
|
+
import { t as tlonPlugin } from "./channel-kxGvWAPU.js";
|
|
2
2
|
export { tlonPlugin };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { n as createDedupeCache, o as createLoggerBackedRuntime } from "./runtime-api-BXVe40nS.js";
|
|
2
|
-
import { c as normalizeUrbitHostname, d as resolveTlonAccount, f as formatTargetHint,
|
|
2
|
+
import { c as normalizeUrbitHostname, d as resolveTlonAccount, f as formatTargetHint, h as parseTlonTarget, l as validateUrbitBaseUrl, m as parseChannelNest, p as normalizeShip } from "./setup-core-CYiZjoTI.js";
|
|
3
3
|
import { t as getTlonRuntime } from "./runtime-Ck3lNvST.js";
|
|
4
4
|
import { t as tlonSetupWizard } from "./setup-surface-35N3bJMh.js";
|
|
5
5
|
import { fetchWithSsrFGuard, ssrfPolicyFromDangerouslyAllowPrivateNetwork } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
6
6
|
import { bindIngressLifecycleToReplyOptions, createChannelIngressError, createChannelIngressMonitor, createMessageReceiptFromOutboundResults, waitUntilAbort } from "openclaw/plugin-sdk/channel-outbound";
|
|
7
|
-
import { chunkTextForOutbound } from "openclaw/plugin-sdk/text-chunking";
|
|
8
7
|
import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
|
|
9
8
|
import { asFiniteNumber, asNullableRecord, filterStringEntries, normalizeLowercaseStringOrEmpty, normalizeNullableString, readStringField, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
10
9
|
import crypto, { randomBytes, randomUUID } from "node:crypto";
|
|
@@ -27,6 +26,7 @@ import { extensionForMime } from "openclaw/plugin-sdk/media-mime";
|
|
|
27
26
|
import { MAX_IMAGE_BYTES, readRemoteMediaBuffer, saveRemoteMedia } from "openclaw/plugin-sdk/media-runtime";
|
|
28
27
|
import { PutObjectCommand, S3Client } from "@aws-sdk/client-s3";
|
|
29
28
|
import { getSignedUrl } from "@aws-sdk/s3-request-presigner";
|
|
29
|
+
import { bufferToBlobPart } from "openclaw/plugin-sdk/blob-runtime";
|
|
30
30
|
//#region extensions/tlon/src/settings.ts
|
|
31
31
|
/**
|
|
32
32
|
* Settings Store integration for hot-reloading Tlon plugin config.
|
|
@@ -726,7 +726,7 @@ function markdownToStory(markdown) {
|
|
|
726
726
|
const paragraphLines = [];
|
|
727
727
|
while (true) {
|
|
728
728
|
const paragraphLine = lines.at(i);
|
|
729
|
-
if (paragraphLine === void 0 || paragraphLine.trim() === "" ||
|
|
729
|
+
if (paragraphLine === void 0 || paragraphLine.trim() === "" || startsTopLevelStoryBlock(paragraphLine)) break;
|
|
730
730
|
if (!preserveListText && MARKDOWN_LIST_ITEM_PATTERN.test(paragraphLine)) {
|
|
731
731
|
const item = parseMarkdownListItem(paragraphLine);
|
|
732
732
|
const candidate = parseListingBlock(lines, i);
|
|
@@ -3912,7 +3912,7 @@ async function uploadImageFromUrl(imageUrl, maxBytes) {
|
|
|
3912
3912
|
sourceSizeVerified = true;
|
|
3913
3913
|
const contentType = fetched.contentType || "image/png";
|
|
3914
3914
|
return (await uploadFile({
|
|
3915
|
-
blob: new Blob([
|
|
3915
|
+
blob: new Blob([bufferToBlobPart(fetched.buffer)], { type: contentType }),
|
|
3916
3916
|
fileName: new URL(imageUrl).pathname.split("/").pop() || `upload-${Date.now()}.png`,
|
|
3917
3917
|
contentType
|
|
3918
3918
|
})).url;
|
|
@@ -3929,43 +3929,40 @@ async function createHttpPokeApi(params) {
|
|
|
3929
3929
|
const cookie = await authenticate(params.url, params.code, { ssrfPolicy });
|
|
3930
3930
|
const channelPath = `/~/channel/${`${Math.floor(Date.now() / 1e3)}-${crypto.randomUUID()}`}`;
|
|
3931
3931
|
const shipName = params.ship.replace(/^~/, "");
|
|
3932
|
-
return {
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
Cookie: expectDefined(cookie.split(";").at(0), "cookie first segment")
|
|
3951
|
-
},
|
|
3952
|
-
body: JSON.stringify([pokeData])
|
|
3932
|
+
return { poke: async (pokeParams) => {
|
|
3933
|
+
const pokeId = Date.now();
|
|
3934
|
+
const pokeData = {
|
|
3935
|
+
id: pokeId,
|
|
3936
|
+
action: "poke",
|
|
3937
|
+
ship: shipName,
|
|
3938
|
+
app: pokeParams.app,
|
|
3939
|
+
mark: pokeParams.mark,
|
|
3940
|
+
json: pokeParams.json
|
|
3941
|
+
};
|
|
3942
|
+
const { response, release } = await urbitFetch({
|
|
3943
|
+
baseUrl: params.url,
|
|
3944
|
+
path: channelPath,
|
|
3945
|
+
init: {
|
|
3946
|
+
method: "PUT",
|
|
3947
|
+
headers: {
|
|
3948
|
+
"Content-Type": "application/json",
|
|
3949
|
+
Cookie: expectDefined(cookie.split(";").at(0), "cookie first segment")
|
|
3953
3950
|
},
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
} finally {
|
|
3964
|
-
await release();
|
|
3951
|
+
body: JSON.stringify([pokeData])
|
|
3952
|
+
},
|
|
3953
|
+
ssrfPolicy,
|
|
3954
|
+
auditContext: "tlon-poke"
|
|
3955
|
+
});
|
|
3956
|
+
try {
|
|
3957
|
+
if (!response.ok && response.status !== 204) {
|
|
3958
|
+
const errorText = await readResponseTextLimited(response, 16384);
|
|
3959
|
+
throw new Error(`Poke failed: ${response.status} - ${errorText}`);
|
|
3965
3960
|
}
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3961
|
+
return pokeId;
|
|
3962
|
+
} finally {
|
|
3963
|
+
await release();
|
|
3964
|
+
}
|
|
3965
|
+
} };
|
|
3969
3966
|
}
|
|
3970
3967
|
function resolveOutboundContext(params) {
|
|
3971
3968
|
const account = resolveTlonAccount(params.cfg, params.accountId ?? void 0);
|
|
@@ -3980,64 +3977,16 @@ function resolveOutboundContext(params) {
|
|
|
3980
3977
|
function resolveReplyId(replyToId, threadId) {
|
|
3981
3978
|
return replyToId ?? threadId ? String(replyToId ?? threadId) : void 0;
|
|
3982
3979
|
}
|
|
3983
|
-
async function
|
|
3984
|
-
const
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
|
|
3980
|
+
async function sendTlonOutbound(params, kind) {
|
|
3981
|
+
const { cfg, to, text, accountId, replyToId, threadId } = params;
|
|
3982
|
+
const { account, parsed } = resolveOutboundContext({
|
|
3983
|
+
cfg,
|
|
3984
|
+
accountId,
|
|
3985
|
+
to
|
|
3989
3986
|
});
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
try {
|
|
3994
|
-
await api.delete();
|
|
3995
|
-
} catch {}
|
|
3996
|
-
}
|
|
3997
|
-
}
|
|
3998
|
-
const tlonRuntimeOutbound = {
|
|
3999
|
-
deliveryMode: "direct",
|
|
4000
|
-
chunker: chunkTextForOutbound,
|
|
4001
|
-
chunkerMode: "markdown",
|
|
4002
|
-
textChunkLimit: 1e4,
|
|
4003
|
-
resolveTarget: ({ to }) => resolveTlonOutboundTarget(to),
|
|
4004
|
-
deliveryCapabilities: { durableFinal: {
|
|
4005
|
-
text: true,
|
|
4006
|
-
media: true,
|
|
4007
|
-
replyTo: true,
|
|
4008
|
-
thread: true,
|
|
4009
|
-
messageSendingHooks: true
|
|
4010
|
-
} },
|
|
4011
|
-
sendText: async ({ cfg, to, text, accountId, replyToId, threadId }) => {
|
|
4012
|
-
const { account, parsed } = resolveOutboundContext({
|
|
4013
|
-
cfg,
|
|
4014
|
-
accountId,
|
|
4015
|
-
to
|
|
4016
|
-
});
|
|
4017
|
-
return withHttpPokeAccountApi(account, async (api) => {
|
|
4018
|
-
const fromShip = normalizeShip(account.ship);
|
|
4019
|
-
if (parsed.kind === "dm") return await sendDm({
|
|
4020
|
-
api,
|
|
4021
|
-
fromShip,
|
|
4022
|
-
toShip: parsed.ship,
|
|
4023
|
-
text
|
|
4024
|
-
});
|
|
4025
|
-
return await sendGroupMessage({
|
|
4026
|
-
api,
|
|
4027
|
-
fromShip,
|
|
4028
|
-
hostShip: parsed.hostShip,
|
|
4029
|
-
channelName: parsed.channelName,
|
|
4030
|
-
text,
|
|
4031
|
-
replyToId: resolveReplyId(replyToId, threadId)
|
|
4032
|
-
});
|
|
4033
|
-
});
|
|
4034
|
-
},
|
|
4035
|
-
sendMedia: async ({ cfg, to, text, mediaUrl, accountId, replyToId, threadId }) => {
|
|
4036
|
-
const { account, parsed } = resolveOutboundContext({
|
|
4037
|
-
cfg,
|
|
4038
|
-
accountId,
|
|
4039
|
-
to
|
|
4040
|
-
});
|
|
3987
|
+
let uploadedUrl;
|
|
3988
|
+
if (kind === "media") {
|
|
3989
|
+
const { mediaUrl } = params;
|
|
4041
3990
|
configureClient({
|
|
4042
3991
|
shipUrl: account.url,
|
|
4043
3992
|
shipName: account.ship.replace(/^~/, ""),
|
|
@@ -4045,28 +3994,36 @@ const tlonRuntimeOutbound = {
|
|
|
4045
3994
|
getCode: async () => account.code,
|
|
4046
3995
|
dangerouslyAllowPrivateNetwork: account.dangerouslyAllowPrivateNetwork ?? void 0
|
|
4047
3996
|
});
|
|
4048
|
-
|
|
4049
|
-
return withHttpPokeAccountApi(account, async (api) => {
|
|
4050
|
-
const fromShip = normalizeShip(account.ship);
|
|
4051
|
-
const story = buildMediaStory(text, uploadedUrl);
|
|
4052
|
-
if (parsed.kind === "dm") return await sendDmWithStory({
|
|
4053
|
-
api,
|
|
4054
|
-
fromShip,
|
|
4055
|
-
toShip: parsed.ship,
|
|
4056
|
-
story,
|
|
4057
|
-
kind: "media"
|
|
4058
|
-
});
|
|
4059
|
-
return await sendGroupMessageWithStory({
|
|
4060
|
-
api,
|
|
4061
|
-
fromShip,
|
|
4062
|
-
hostShip: parsed.hostShip,
|
|
4063
|
-
channelName: parsed.channelName,
|
|
4064
|
-
story,
|
|
4065
|
-
replyToId: resolveReplyId(replyToId, threadId),
|
|
4066
|
-
kind: "media"
|
|
4067
|
-
});
|
|
4068
|
-
});
|
|
3997
|
+
uploadedUrl = mediaUrl ? await uploadImageFromUrl(mediaUrl, account.mediaMaxBytes) : void 0;
|
|
4069
3998
|
}
|
|
3999
|
+
const api = await createHttpPokeApi({
|
|
4000
|
+
url: account.url,
|
|
4001
|
+
ship: account.ship,
|
|
4002
|
+
code: account.code,
|
|
4003
|
+
dangerouslyAllowPrivateNetwork: account.dangerouslyAllowPrivateNetwork ?? void 0
|
|
4004
|
+
});
|
|
4005
|
+
const fromShip = normalizeShip(account.ship);
|
|
4006
|
+
const story = kind === "media" ? buildMediaStory(text, uploadedUrl) : markdownToStory(text);
|
|
4007
|
+
if (parsed.kind === "dm") return await sendDmWithStory({
|
|
4008
|
+
api,
|
|
4009
|
+
fromShip,
|
|
4010
|
+
toShip: parsed.ship,
|
|
4011
|
+
story,
|
|
4012
|
+
kind
|
|
4013
|
+
});
|
|
4014
|
+
return await sendGroupMessageWithStory({
|
|
4015
|
+
api,
|
|
4016
|
+
fromShip,
|
|
4017
|
+
hostShip: parsed.hostShip,
|
|
4018
|
+
channelName: parsed.channelName,
|
|
4019
|
+
story,
|
|
4020
|
+
replyToId: resolveReplyId(replyToId, threadId),
|
|
4021
|
+
kind
|
|
4022
|
+
});
|
|
4023
|
+
}
|
|
4024
|
+
const tlonRuntimeOutbound = {
|
|
4025
|
+
sendText: (params) => sendTlonOutbound(params, "text"),
|
|
4026
|
+
sendMedia: (params) => sendTlonOutbound(params, "media")
|
|
4070
4027
|
};
|
|
4071
4028
|
async function probeTlonAccount(account, timeoutMs) {
|
|
4072
4029
|
return await runChannelProbe(timeoutMs, async () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/tlon",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.9.1",
|
|
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.
|
|
22
|
+
"openclaw": ">=2026.9.1"
|
|
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.
|
|
123
|
+
"pluginApi": ">=2026.9.1"
|
|
124
124
|
},
|
|
125
125
|
"build": {
|
|
126
|
-
"openclawVersion": "2026.
|
|
126
|
+
"openclawVersion": "2026.9.1"
|
|
127
127
|
},
|
|
128
128
|
"release": {
|
|
129
129
|
"bundleRuntimeDependencies": false,
|