@openclaw/tlon 2026.5.7 → 2026.5.9-beta.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 ssrfPolicyFromAllowPrivateNetwork, i as isBlockedHostnameOrIp, n as createDedupeCache, o as ssrfPolicyFromDangerouslyAllowPrivateNetwork, r as fetchWithSsrFGuard, s as createLoggerBackedRuntime, t as SsrFBlockedError } from "./runtime-api-C0hr1Rtn.js";
2
- import { t as tlonPlugin } from "./channel-C1on9fPi.js";
2
+ import { t as tlonPlugin } from "./channel-DWjdEJ9A.js";
3
3
  import { n as setTlonRuntime } from "./runtime-5FiW9E50.js";
4
4
  export { SsrFBlockedError, createDedupeCache, createLoggerBackedRuntime, fetchWithSsrFGuard, isBlockedHostnameOrIp, setTlonRuntime, ssrfPolicyFromAllowPrivateNetwork, ssrfPolicyFromDangerouslyAllowPrivateNetwork, tlonPlugin };
@@ -5,6 +5,7 @@ import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
5
5
  import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id";
6
6
  import { createHybridChannelConfigAdapter } from "openclaw/plugin-sdk/channel-config-helpers";
7
7
  import { createChatChannelPlugin } from "openclaw/plugin-sdk/channel-core";
8
+ import { createChannelMessageAdapterFromOutbound } from "openclaw/plugin-sdk/channel-message";
8
9
  import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
9
10
  import { createRuntimeOutboundDelegates } from "openclaw/plugin-sdk/outbound-runtime";
10
11
  import { createComputedAccountStatusAdapter, createDefaultChannelRuntimeState } from "openclaw/plugin-sdk/status-helpers";
@@ -84,7 +85,7 @@ function resolveTlonOutboundSessionRoute(params) {
84
85
  //#endregion
85
86
  //#region extensions/tlon/src/channel.ts
86
87
  const TLON_CHANNEL_ID = "tlon";
87
- const loadTlonChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-v-_0sHkJ.js"));
88
+ const loadTlonChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-BySSCTKr.js"));
88
89
  const tlonSetupWizardProxy = createTlonSetupWizardBase({
89
90
  resolveConfigured: async ({ cfg, accountId }) => await (await loadTlonChannelRuntime()).tlonSetupWizard.status.resolveConfigured({
90
91
  cfg,
@@ -112,6 +113,27 @@ const tlonConfigAdapter = createHybridChannelConfigAdapter({
112
113
  resolveAllowFrom: (account) => account.dmAllowlist,
113
114
  formatAllowFrom: (allowFrom) => allowFrom.map((entry) => normalizeShip(String(entry))).filter(Boolean)
114
115
  });
116
+ const tlonChannelOutbound = {
117
+ deliveryMode: "direct",
118
+ textChunkLimit: 1e4,
119
+ resolveTarget: ({ to }) => resolveTlonOutboundTarget(to),
120
+ deliveryCapabilities: { durableFinal: {
121
+ text: true,
122
+ media: true,
123
+ replyTo: true,
124
+ thread: true,
125
+ messageSendingHooks: true
126
+ } },
127
+ ...createRuntimeOutboundDelegates({
128
+ getRuntime: loadTlonChannelRuntime,
129
+ sendText: { resolve: (runtime) => runtime.tlonRuntimeOutbound.sendText },
130
+ sendMedia: { resolve: (runtime) => runtime.tlonRuntimeOutbound.sendMedia }
131
+ })
132
+ };
133
+ const tlonMessageAdapter = createChannelMessageAdapterFromOutbound({
134
+ id: TLON_CHANNEL_ID,
135
+ outbound: tlonChannelOutbound
136
+ });
115
137
  const tlonPlugin = createChatChannelPlugin({
116
138
  base: {
117
139
  id: TLON_CHANNEL_ID,
@@ -166,6 +188,7 @@ const tlonPlugin = createChatChannelPlugin({
166
188
  },
167
189
  resolveOutboundSessionRoute: (params) => resolveTlonOutboundSessionRoute(params)
168
190
  },
191
+ message: tlonMessageAdapter,
169
192
  status: createComputedAccountStatusAdapter({
170
193
  defaultRuntime: createDefaultChannelRuntimeState(DEFAULT_ACCOUNT_ID),
171
194
  collectStatusIssues: (accounts) => {
@@ -207,16 +230,7 @@ const tlonPlugin = createChatChannelPlugin({
207
230
  }),
208
231
  gateway: { startAccount: async (ctx) => await (await loadTlonChannelRuntime()).startTlonGatewayAccount(ctx) }
209
232
  },
210
- outbound: {
211
- deliveryMode: "direct",
212
- textChunkLimit: 1e4,
213
- resolveTarget: ({ to }) => resolveTlonOutboundTarget(to),
214
- ...createRuntimeOutboundDelegates({
215
- getRuntime: loadTlonChannelRuntime,
216
- sendText: { resolve: (runtime) => runtime.tlonRuntimeOutbound.sendText },
217
- sendMedia: { resolve: (runtime) => runtime.tlonRuntimeOutbound.sendMedia }
218
- })
219
- }
233
+ outbound: tlonChannelOutbound
220
234
  });
221
235
  //#endregion
222
236
  export { tlonPlugin as t };
@@ -1,2 +1,2 @@
1
- import { t as tlonPlugin } from "./channel-C1on9fPi.js";
1
+ import { t as tlonPlugin } from "./channel-DWjdEJ9A.js";
2
2
  export { tlonPlugin };
@@ -3,6 +3,7 @@ import { c as validateUrbitBaseUrl, d as formatTargetHint, f as normalizeShip, h
3
3
  import { t as getTlonRuntime } from "./runtime-5FiW9E50.js";
4
4
  import { t as tlonSetupWizard } from "./setup-surface-FxNMaluC.js";
5
5
  import { fetchWithSsrFGuard, ssrfPolicyFromDangerouslyAllowPrivateNetwork } from "openclaw/plugin-sdk/ssrf-runtime";
6
+ import { createMessageReceiptFromOutboundResults } from "openclaw/plugin-sdk/channel-message";
6
7
  import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/text-runtime";
7
8
  import crypto, { randomBytes, randomUUID } from "node:crypto";
8
9
  import { da, scot } from "@urbit/aura";
@@ -10,6 +11,7 @@ import { Readable } from "node:stream";
10
11
  import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
11
12
  import { mkdir, writeFile } from "node:fs/promises";
12
13
  import * as path from "node:path";
14
+ import { extensionForMime } from "openclaw/plugin-sdk/media-mime";
13
15
  import { MAX_IMAGE_BYTES, fetchRemoteMedia, saveMediaBuffer } from "openclaw/plugin-sdk/media-runtime";
14
16
  import { PutObjectCommand, S3Client } from "@aws-sdk/client-s3";
15
17
  import { getSignedUrl } from "@aws-sdk/s3-request-presigner";
@@ -528,15 +530,27 @@ function markdownToStory(markdown) {
528
530
  }
529
531
  //#endregion
530
532
  //#region extensions/tlon/src/urbit/send.ts
533
+ function createTlonSendReceipt(params) {
534
+ return createMessageReceiptFromOutboundResults({
535
+ results: [{
536
+ channel: "tlon",
537
+ messageId: params.messageId,
538
+ conversationId: params.conversationId
539
+ }],
540
+ threadId: params.conversationId,
541
+ kind: params.kind
542
+ });
543
+ }
531
544
  async function sendDm({ api, fromShip, toShip, text }) {
532
545
  return sendDmWithStory({
533
546
  api,
534
547
  fromShip,
535
548
  toShip,
536
- story: markdownToStory(text)
549
+ story: markdownToStory(text),
550
+ kind: "text"
537
551
  });
538
552
  }
539
- async function sendDmWithStory({ api, fromShip, toShip, story }) {
553
+ async function sendDmWithStory({ api, fromShip, toShip, story, kind = "unknown" }) {
540
554
  const sentAt = Date.now();
541
555
  const id = `${fromShip}/${scot("ud", da.fromUnix(sentAt))}`;
542
556
  const action = {
@@ -561,7 +575,12 @@ async function sendDmWithStory({ api, fromShip, toShip, story }) {
561
575
  });
562
576
  return {
563
577
  channel: "tlon",
564
- messageId: id
578
+ messageId: id,
579
+ receipt: createTlonSendReceipt({
580
+ messageId: id,
581
+ conversationId: toShip,
582
+ kind
583
+ })
565
584
  };
566
585
  }
567
586
  async function sendGroupMessage({ api, fromShip, hostShip, channelName, text, replyToId }) {
@@ -571,10 +590,11 @@ async function sendGroupMessage({ api, fromShip, hostShip, channelName, text, re
571
590
  hostShip,
572
591
  channelName,
573
592
  story: markdownToStory(text),
574
- replyToId
593
+ replyToId,
594
+ kind: "text"
575
595
  });
576
596
  }
577
- async function sendGroupMessageWithStory({ api, fromShip, hostShip, channelName, story, replyToId }) {
597
+ async function sendGroupMessageWithStory({ api, fromShip, hostShip, channelName, story, replyToId, kind = "unknown" }) {
578
598
  const sentAt = Date.now();
579
599
  let formattedReplyId = replyToId;
580
600
  if (replyToId && /^\d+$/.test(replyToId)) try {
@@ -603,9 +623,15 @@ async function sendGroupMessageWithStory({ api, fromShip, hostShip, channelName,
603
623
  mark: "channel-action-1",
604
624
  json: action
605
625
  });
626
+ const messageId = `${fromShip}/${sentAt}`;
606
627
  return {
607
628
  channel: "tlon",
608
- messageId: `${fromShip}/${sentAt}`
629
+ messageId,
630
+ receipt: createTlonSendReceipt({
631
+ messageId,
632
+ conversationId: `${hostShip}/${channelName}`,
633
+ kind
634
+ })
609
635
  };
610
636
  }
611
637
  /**
@@ -1063,9 +1089,6 @@ var UrbitSSEClient = class {
1063
1089
  * When an unknown ship tries to interact with the bot, the owner receives
1064
1090
  * a notification and can approve or deny the request.
1065
1091
  */
1066
- function normalizeLowercaseStringOrEmpty$1(value) {
1067
- return typeof value === "string" ? value.trim().toLowerCase() : "";
1068
- }
1069
1092
  /**
1070
1093
  * Generate a unique approval ID in the format: {type}-{timestamp}-{shortHash}
1071
1094
  */
@@ -1114,7 +1137,7 @@ function formatApprovalRequest(approval) {
1114
1137
  * - "block" permanently blocks the ship via Tlon's native blocking
1115
1138
  */
1116
1139
  function parseApprovalResponse(text) {
1117
- const match = normalizeLowercaseStringOrEmpty$1(text).match(/^(approve|deny|block)(?:\s+(.+))?$/);
1140
+ const match = normalizeLowercaseStringOrEmpty(text).match(/^(approve|deny|block)(?:\s+(.+))?$/);
1118
1141
  if (!match) return null;
1119
1142
  return {
1120
1143
  action: match[1],
@@ -1126,7 +1149,7 @@ function parseApprovalResponse(text) {
1126
1149
  * Used to determine if we should intercept the message before normal processing.
1127
1150
  */
1128
1151
  function isApprovalResponse(text) {
1129
- const trimmed = normalizeLowercaseStringOrEmpty$1(text);
1152
+ const trimmed = normalizeLowercaseStringOrEmpty(text);
1130
1153
  return trimmed.startsWith("approve") || trimmed.startsWith("deny") || trimmed.startsWith("block");
1131
1154
  }
1132
1155
  /**
@@ -1169,7 +1192,7 @@ function formatApprovalConfirmation(approval, action) {
1169
1192
  * - "pending" - list all pending approvals
1170
1193
  */
1171
1194
  function parseAdminCommand(text) {
1172
- const trimmed = normalizeLowercaseStringOrEmpty$1(text);
1195
+ const trimmed = normalizeLowercaseStringOrEmpty(text);
1173
1196
  if (trimmed === "blocked") return { type: "blocked" };
1174
1197
  if (trimmed === "pending") return { type: "pending" };
1175
1198
  const unblockMatch = trimmed.match(/^unblock\s+(~[\w-]+)$/);
@@ -1941,18 +1964,7 @@ function getExtensionFromFileName(fileName) {
1941
1964
  return path.extname(fileName).replace(/^\./, "") || null;
1942
1965
  }
1943
1966
  function getExtensionFromContentType(contentType) {
1944
- return {
1945
- "image/jpeg": "jpg",
1946
- "image/jpg": "jpg",
1947
- "image/png": "png",
1948
- "image/gif": "gif",
1949
- "image/webp": "webp",
1950
- "image/svg+xml": "svg",
1951
- "video/mp4": "mp4",
1952
- "video/webm": "webm",
1953
- "audio/mpeg": "mp3",
1954
- "audio/ogg": "ogg"
1955
- }[contentType.split(";")[0].trim()] ?? null;
1967
+ return extensionForMime(contentType)?.replace(/^\./u, "") ?? null;
1956
1968
  }
1957
1969
  function getExtensionFromUrl(url) {
1958
1970
  try {
@@ -2465,6 +2477,24 @@ async function monitorTlonProvider(opts = {}) {
2465
2477
  const responsePrefix = core.channel.reply.resolveEffectiveMessagesConfig(cfg, route.agentId).responsePrefix;
2466
2478
  const humanDelay = core.channel.reply.resolveHumanDelayConfig(cfg, route.agentId);
2467
2479
  const storePath = core.channel.session.resolveStorePath(cfg.session?.store, { agentId: route.agentId });
2480
+ const deliveryTarget = isGroup ? groupChannel : senderShip;
2481
+ const prepareReplyPayload = (payload) => {
2482
+ const replyText = payload.text;
2483
+ if (!replyText) return payload;
2484
+ if (!effectiveShowModelSig) return payload;
2485
+ const extPayload = payload;
2486
+ const defaultModel = cfg.agents?.defaults?.model;
2487
+ const modelInfo = extPayload.metadata?.model || extPayload.model || (typeof defaultModel === "string" ? defaultModel : defaultModel?.primary);
2488
+ return {
2489
+ ...payload,
2490
+ text: `${replyText}\n\n_[Generated by ${formatModelName(modelInfo)}]_`
2491
+ };
2492
+ };
2493
+ const rememberThreadParticipation = (result) => {
2494
+ if (!isGroup || !groupChannel || !parentId || result?.visibleReplySent === false) return;
2495
+ participatedThreads.add(parentId);
2496
+ runtime.log?.(`[tlon] Now tracking thread for future replies: ${parentId}`);
2497
+ };
2468
2498
  await core.channel.turn.run({
2469
2499
  channel: "tlon",
2470
2500
  accountId: route.accountId,
@@ -2489,18 +2519,18 @@ async function monitorTlonProvider(opts = {}) {
2489
2519
  recordInboundSession: core.channel.session.recordInboundSession,
2490
2520
  dispatchReplyWithBufferedBlockDispatcher: core.channel.reply.dispatchReplyWithBufferedBlockDispatcher,
2491
2521
  delivery: {
2522
+ preparePayload: prepareReplyPayload,
2523
+ durable: deliveryTarget ? () => ({
2524
+ to: deliveryTarget,
2525
+ replyToId: parentId ?? void 0,
2526
+ threadId: parentId ?? void 0
2527
+ }) : false,
2492
2528
  deliver: async (payload) => {
2493
- let replyText = payload.text;
2494
- if (!replyText) return;
2495
- if (effectiveShowModelSig) {
2496
- const extPayload = payload;
2497
- const defaultModel = cfg.agents?.defaults?.model;
2498
- const modelInfo = extPayload.metadata?.model || extPayload.model || (typeof defaultModel === "string" ? defaultModel : defaultModel?.primary);
2499
- replyText = `${replyText}\n\n_[Generated by ${formatModelName(modelInfo)}]_`;
2500
- }
2529
+ const replyText = payload.text;
2530
+ if (!replyText) return { visibleReplySent: false };
2501
2531
  if (isGroup && groupChannel) {
2502
2532
  const parsed = parseChannelNest(groupChannel);
2503
- if (!parsed) return;
2533
+ if (!parsed) return { visibleReplySent: false };
2504
2534
  await sendGroupMessage({
2505
2535
  api,
2506
2536
  fromShip: botShipName,
@@ -2509,16 +2539,21 @@ async function monitorTlonProvider(opts = {}) {
2509
2539
  text: replyText,
2510
2540
  replyToId: parentId ?? void 0
2511
2541
  });
2512
- if (parentId) {
2513
- participatedThreads.add(parentId);
2514
- runtime.log?.(`[tlon] Now tracking thread for future replies: ${parentId}`);
2515
- }
2516
- } else await sendDm({
2542
+ return {
2543
+ visibleReplySent: true,
2544
+ replyToId: parentId ?? void 0
2545
+ };
2546
+ }
2547
+ await sendDm({
2517
2548
  api,
2518
2549
  fromShip: botShipName,
2519
2550
  toShip: senderShip,
2520
2551
  text: replyText
2521
2552
  });
2553
+ return { visibleReplySent: true };
2554
+ },
2555
+ onDelivered: (_payload, _info, result) => {
2556
+ rememberThreadParticipation(result);
2522
2557
  },
2523
2558
  onError: (err, info) => {
2524
2559
  const dispatchDuration = Date.now() - dispatchStartTime;
@@ -3124,15 +3159,6 @@ async function monitorTlonProvider(opts = {}) {
3124
3159
  //#endregion
3125
3160
  //#region extensions/tlon/src/tlon-api.ts
3126
3161
  const MEMEX_BASE_URL = "https://memex.tlon.network";
3127
- const mimeToExt = {
3128
- "image/gif": ".gif",
3129
- "image/heic": ".heic",
3130
- "image/heif": ".heif",
3131
- "image/jpeg": ".jpg",
3132
- "image/jpg": ".jpg",
3133
- "image/png": ".png",
3134
- "image/webp": ".webp"
3135
- };
3136
3162
  let currentClientConfig = null;
3137
3163
  function configureClient(params) {
3138
3164
  currentClientConfig = {
@@ -3145,8 +3171,7 @@ function requireClientConfig() {
3145
3171
  return currentClientConfig;
3146
3172
  }
3147
3173
  function getExtensionFromMimeType(mimeType) {
3148
- if (!mimeType) return ".jpg";
3149
- return mimeToExt[normalizeLowercaseStringOrEmpty(mimeType)] || ".jpg";
3174
+ return extensionForMime(mimeType) || ".jpg";
3150
3175
  }
3151
3176
  function hasCustomS3Creds(credentials) {
3152
3177
  return Boolean(credentials?.accessKeyId && credentials?.endpoint && credentials?.secretAccessKey);
@@ -3477,6 +3502,13 @@ const tlonRuntimeOutbound = {
3477
3502
  deliveryMode: "direct",
3478
3503
  textChunkLimit: 1e4,
3479
3504
  resolveTarget: ({ to }) => resolveTlonOutboundTarget(to),
3505
+ deliveryCapabilities: { durableFinal: {
3506
+ text: true,
3507
+ media: true,
3508
+ replyTo: true,
3509
+ thread: true,
3510
+ messageSendingHooks: true
3511
+ } },
3480
3512
  sendText: async ({ cfg, to, text, accountId, replyToId, threadId }) => {
3481
3513
  const { account, parsed } = resolveOutboundContext({
3482
3514
  cfg,
@@ -3522,7 +3554,8 @@ const tlonRuntimeOutbound = {
3522
3554
  api,
3523
3555
  fromShip,
3524
3556
  toShip: parsed.ship,
3525
- story
3557
+ story,
3558
+ kind: "media"
3526
3559
  });
3527
3560
  return await sendGroupMessageWithStory({
3528
3561
  api,
@@ -3530,7 +3563,8 @@ const tlonRuntimeOutbound = {
3530
3563
  hostShip: parsed.hostShip,
3531
3564
  channelName: parsed.channelName,
3532
3565
  story,
3533
- replyToId: resolveReplyId(replyToId, threadId)
3566
+ replyToId: resolveReplyId(replyToId, threadId),
3567
+ kind: "media"
3534
3568
  });
3535
3569
  });
3536
3570
  }
package/dist/test-api.js CHANGED
@@ -1,2 +1,2 @@
1
- import { t as tlonPlugin } from "./channel-C1on9fPi.js";
1
+ import { t as tlonPlugin } from "./channel-DWjdEJ9A.js";
2
2
  export { tlonPlugin };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/tlon",
3
- "version": "2026.5.7",
3
+ "version": "2026.5.9-beta.1",
4
4
  "description": "OpenClaw Tlon/Urbit channel plugin",
5
5
  "repository": {
6
6
  "type": "git",
@@ -8,8 +8,8 @@
8
8
  },
9
9
  "type": "module",
10
10
  "dependencies": {
11
- "@aws-sdk/client-s3": "3.1042.0",
12
- "@aws-sdk/s3-request-presigner": "3.1042.0",
11
+ "@aws-sdk/client-s3": "3.1044.0",
12
+ "@aws-sdk/s3-request-presigner": "3.1044.0",
13
13
  "@tloncorp/tlon-skill": "0.3.5",
14
14
  "@urbit/aura": "^3.0.0"
15
15
  },
@@ -18,7 +18,7 @@
18
18
  "openclaw": "workspace:*"
19
19
  },
20
20
  "peerDependencies": {
21
- "openclaw": ">=2026.5.7"
21
+ "openclaw": ">=2026.5.9-beta.1"
22
22
  },
23
23
  "peerDependenciesMeta": {
24
24
  "openclaw": {
@@ -72,10 +72,10 @@
72
72
  "minHostVersion": ">=2026.4.10"
73
73
  },
74
74
  "compat": {
75
- "pluginApi": ">=2026.5.7"
75
+ "pluginApi": ">=2026.5.9-beta.1"
76
76
  },
77
77
  "build": {
78
- "openclawVersion": "2026.5.7"
78
+ "openclawVersion": "2026.5.9-beta.1"
79
79
  },
80
80
  "release": {
81
81
  "publishToClawHub": true,