@openclaw/tlon 2026.5.9-beta.1 → 2026.5.10-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-DWjdEJ9A.js";
2
+ import { t as tlonPlugin } from "./channel-ByuwHe2i.js";
3
3
  import { n as setTlonRuntime } from "./runtime-5FiW9E50.js";
4
4
  export { SsrFBlockedError, createDedupeCache, createLoggerBackedRuntime, fetchWithSsrFGuard, isBlockedHostnameOrIp, setTlonRuntime, ssrfPolicyFromAllowPrivateNetwork, ssrfPolicyFromDangerouslyAllowPrivateNetwork, tlonPlugin };
@@ -85,7 +85,7 @@ function resolveTlonOutboundSessionRoute(params) {
85
85
  //#endregion
86
86
  //#region extensions/tlon/src/channel.ts
87
87
  const TLON_CHANNEL_ID = "tlon";
88
- const loadTlonChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-BySSCTKr.js"));
88
+ const loadTlonChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-u89kWom3.js"));
89
89
  const tlonSetupWizardProxy = createTlonSetupWizardBase({
90
90
  resolveConfigured: async ({ cfg, accountId }) => await (await loadTlonChannelRuntime()).tlonSetupWizard.status.resolveConfigured({
91
91
  cfg,
@@ -1,2 +1,2 @@
1
- import { t as tlonPlugin } from "./channel-DWjdEJ9A.js";
1
+ import { t as tlonPlugin } from "./channel-ByuwHe2i.js";
2
2
  export { tlonPlugin };
@@ -8,6 +8,7 @@ import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/text-runtim
8
8
  import crypto, { randomBytes, randomUUID } from "node:crypto";
9
9
  import { da, scot } from "@urbit/aura";
10
10
  import { Readable } from "node:stream";
11
+ import { resolveStableChannelMessageIngress } from "openclaw/plugin-sdk/channel-ingress-runtime";
11
12
  import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
12
13
  import { mkdir, writeFile } from "node:fs/promises";
13
14
  import * as path from "node:path";
@@ -328,11 +329,6 @@ function getUrbitContext(url, ship) {
328
329
  ship: normalizeUrbitShip(ship, validated.hostname)
329
330
  };
330
331
  }
331
- /**
332
- * Get the default SSRF policy for image uploads.
333
- * Uses a restrictive policy that blocks private networks by default.
334
- */
335
- function getDefaultSsrFPolicy() {}
336
332
  //#endregion
337
333
  //#region extensions/tlon/src/urbit/story.ts
338
334
  /**
@@ -1554,35 +1550,58 @@ function isBotMentioned(messageText, botShipName, nickname) {
1554
1550
  }
1555
1551
  return false;
1556
1552
  }
1557
- /**
1558
- * Strip bot ship mention from message text for command detection.
1559
- * "~bot-ship /status" → "/status"
1560
- */
1561
1553
  function stripBotMention(messageText, botShipName) {
1562
1554
  if (!messageText || !botShipName) return messageText;
1563
1555
  return messageText.replace(normalizeShip(botShipName), "").trim();
1564
1556
  }
1565
- function isDmAllowed(senderShip, allowlist) {
1566
- if (!allowlist || allowlist.length === 0) return false;
1567
- const normalizedSender = normalizeShip(senderShip);
1568
- return allowlist.map((ship) => normalizeShip(ship)).some((ship) => ship === normalizedSender);
1557
+ const tlonIngressIdentity = {
1558
+ key: "sender-ship",
1559
+ normalize: normalizeShip,
1560
+ sensitivity: "pii",
1561
+ isWildcardEntry: () => false,
1562
+ entryIdPrefix: "tlon-entry"
1563
+ };
1564
+ async function isDmAllowedWithIngress(senderShip, allowlist) {
1565
+ return (await resolveStableChannelMessageIngress({
1566
+ channelId: "tlon",
1567
+ accountId: "default",
1568
+ identity: tlonIngressIdentity,
1569
+ subject: { stableId: senderShip },
1570
+ conversation: {
1571
+ kind: "direct",
1572
+ id: "direct"
1573
+ },
1574
+ dmPolicy: "allowlist",
1575
+ allowFrom: allowlist ?? []
1576
+ })).senderAccess.allowed;
1577
+ }
1578
+ async function resolveTlonCommandAuthorizationWithIngress(params) {
1579
+ const normalizedOwner = params.ownerShip ? normalizeShip(params.ownerShip) : null;
1580
+ return await resolveStableChannelMessageIngress({
1581
+ channelId: "tlon",
1582
+ accountId: "default",
1583
+ identity: tlonIngressIdentity,
1584
+ useAccessGroups: params.useAccessGroups,
1585
+ subject: { stableId: params.senderShip },
1586
+ conversation: {
1587
+ kind: "direct",
1588
+ id: "command"
1589
+ },
1590
+ event: {
1591
+ authMode: "none",
1592
+ mayPair: false
1593
+ },
1594
+ dmPolicy: "allowlist",
1595
+ groupPolicy: "open",
1596
+ allowFrom: normalizedOwner ? [normalizedOwner] : [],
1597
+ command: {}
1598
+ });
1569
1599
  }
1570
- /**
1571
- * Check if a group invite from a ship should be auto-accepted.
1572
- *
1573
- * SECURITY: Fail-safe to deny. If allowlist is empty or undefined,
1574
- * ALL invites are rejected - even if autoAcceptGroupInvites is enabled.
1575
- * This prevents misconfigured bots from accepting malicious invites.
1576
- */
1577
1600
  function isGroupInviteAllowed(inviterShip, allowlist) {
1578
1601
  if (!allowlist || allowlist.length === 0) return false;
1579
1602
  const normalizedInviter = normalizeShip(inviterShip);
1580
1603
  return allowlist.map((ship) => normalizeShip(ship)).some((ship) => ship === normalizedInviter);
1581
1604
  }
1582
- /**
1583
- * Resolve quoted/cited content only after the caller has passed authorization.
1584
- * Unauthorized paths must keep raw text and must not trigger cross-channel cite fetches.
1585
- */
1586
1605
  async function resolveAuthorizedMessageText(params) {
1587
1606
  const { rawText, content, authorizedForCites, resolveAllCites } = params;
1588
1607
  if (!authorizedForCites) return rawText;
@@ -1934,7 +1953,7 @@ async function downloadMedia(url, mediaDir) {
1934
1953
  url,
1935
1954
  maxBytes: MAX_IMAGE_BYTES,
1936
1955
  readIdleTimeoutMs: TLON_MEDIA_DOWNLOAD_IDLE_TIMEOUT_MS,
1937
- ssrfPolicy: /* @__PURE__ */ getDefaultSsrFPolicy(),
1956
+ ssrfPolicy: void 0,
1938
1957
  requestInit: { method: "GET" }
1939
1958
  });
1940
1959
  if (!mediaDir) {
@@ -2402,14 +2421,11 @@ async function monitorTlonProvider(opts = {}) {
2402
2421
  let commandAuthorized = false;
2403
2422
  if (shouldComputeAuth) {
2404
2423
  const useAccessGroups = cfg.commands?.useAccessGroups !== false;
2405
- const senderIsOwner = isOwner(senderShip);
2406
- commandAuthorized = core.channel.commands.resolveCommandAuthorizedFromAuthorizers({
2407
- useAccessGroups,
2408
- authorizers: [{
2409
- configured: Boolean(effectiveOwnerShip),
2410
- allowed: senderIsOwner
2411
- }]
2412
- });
2424
+ commandAuthorized = (await resolveTlonCommandAuthorizationWithIngress({
2425
+ senderShip,
2426
+ ownerShip: effectiveOwnerShip,
2427
+ useAccessGroups
2428
+ })).commandAccess.authorized;
2413
2429
  if (!commandAuthorized) console.log(`[tlon] Command attempt denied: ${senderShip} is not owner (owner=${effectiveOwnerShip ?? "not configured"})`);
2414
2430
  }
2415
2431
  let bodyWithAttachments = messageText;
@@ -2422,11 +2438,6 @@ async function monitorTlonProvider(opts = {}) {
2422
2438
  });
2423
2439
  const commandBody = isGroup ? stripBotMention(messageText, botShipName) : messageText;
2424
2440
  const tlonConversationId = isGroup ? groupChannel ?? channelNest ?? senderShip : senderShip;
2425
- const rawTurnMessage = {
2426
- messageId,
2427
- messageText,
2428
- timestamp
2429
- };
2430
2441
  const ctxPayload = core.channel.turn.buildContext({
2431
2442
  channel: "tlon",
2432
2443
  accountId: route.accountId,
@@ -2495,80 +2506,65 @@ async function monitorTlonProvider(opts = {}) {
2495
2506
  participatedThreads.add(parentId);
2496
2507
  runtime.log?.(`[tlon] Now tracking thread for future replies: ${parentId}`);
2497
2508
  };
2498
- await core.channel.turn.run({
2509
+ await core.channel.turn.runAssembled({
2499
2510
  channel: "tlon",
2500
2511
  accountId: route.accountId,
2501
- raw: rawTurnMessage,
2502
- adapter: {
2503
- ingest: (raw) => ({
2504
- id: raw.messageId,
2505
- timestamp: raw.timestamp,
2506
- rawText: raw.messageText,
2507
- textForAgent: commandBody,
2508
- textForCommands: commandBody,
2509
- raw
2510
- }),
2511
- resolveTurn: () => ({
2512
- cfg,
2513
- channel: "tlon",
2514
- accountId: route.accountId,
2515
- agentId: route.agentId,
2516
- routeSessionKey: route.sessionKey,
2517
- storePath,
2518
- ctxPayload,
2519
- recordInboundSession: core.channel.session.recordInboundSession,
2520
- dispatchReplyWithBufferedBlockDispatcher: core.channel.reply.dispatchReplyWithBufferedBlockDispatcher,
2521
- delivery: {
2522
- preparePayload: prepareReplyPayload,
2523
- durable: deliveryTarget ? () => ({
2524
- to: deliveryTarget,
2525
- replyToId: parentId ?? void 0,
2526
- threadId: parentId ?? void 0
2527
- }) : false,
2528
- deliver: async (payload) => {
2529
- const replyText = payload.text;
2530
- if (!replyText) return { visibleReplySent: false };
2531
- if (isGroup && groupChannel) {
2532
- const parsed = parseChannelNest(groupChannel);
2533
- if (!parsed) return { visibleReplySent: false };
2534
- await sendGroupMessage({
2535
- api,
2536
- fromShip: botShipName,
2537
- hostShip: parsed.hostShip,
2538
- channelName: parsed.channelName,
2539
- text: replyText,
2540
- replyToId: parentId ?? void 0
2541
- });
2542
- return {
2543
- visibleReplySent: true,
2544
- replyToId: parentId ?? void 0
2545
- };
2546
- }
2547
- await sendDm({
2548
- api,
2549
- fromShip: botShipName,
2550
- toShip: senderShip,
2551
- text: replyText
2552
- });
2553
- return { visibleReplySent: true };
2554
- },
2555
- onDelivered: (_payload, _info, result) => {
2556
- rememberThreadParticipation(result);
2557
- },
2558
- onError: (err, info) => {
2559
- const dispatchDuration = Date.now() - dispatchStartTime;
2560
- runtime.error?.(`[tlon] ${info.kind} reply failed after ${dispatchDuration}ms: ${String(err)}`);
2561
- }
2562
- },
2563
- dispatcherOptions: {
2564
- responsePrefix,
2565
- humanDelay
2566
- },
2567
- record: { onRecordError: (err) => {
2568
- runtime.error?.(`[tlon] failed updating session meta: ${String(err)}`);
2569
- } }
2570
- })
2571
- }
2512
+ cfg,
2513
+ agentId: route.agentId,
2514
+ routeSessionKey: route.sessionKey,
2515
+ storePath,
2516
+ ctxPayload,
2517
+ recordInboundSession: core.channel.session.recordInboundSession,
2518
+ dispatchReplyWithBufferedBlockDispatcher: core.channel.reply.dispatchReplyWithBufferedBlockDispatcher,
2519
+ delivery: {
2520
+ preparePayload: prepareReplyPayload,
2521
+ durable: deliveryTarget ? () => ({
2522
+ to: deliveryTarget,
2523
+ replyToId: parentId ?? void 0,
2524
+ threadId: parentId ?? void 0
2525
+ }) : false,
2526
+ deliver: async (payload) => {
2527
+ const replyText = payload.text;
2528
+ if (!replyText) return { visibleReplySent: false };
2529
+ if (isGroup && groupChannel) {
2530
+ const parsed = parseChannelNest(groupChannel);
2531
+ if (!parsed) return { visibleReplySent: false };
2532
+ await sendGroupMessage({
2533
+ api,
2534
+ fromShip: botShipName,
2535
+ hostShip: parsed.hostShip,
2536
+ channelName: parsed.channelName,
2537
+ text: replyText,
2538
+ replyToId: parentId ?? void 0
2539
+ });
2540
+ return {
2541
+ visibleReplySent: true,
2542
+ replyToId: parentId ?? void 0
2543
+ };
2544
+ }
2545
+ await sendDm({
2546
+ api,
2547
+ fromShip: botShipName,
2548
+ toShip: senderShip,
2549
+ text: replyText
2550
+ });
2551
+ return { visibleReplySent: true };
2552
+ },
2553
+ onDelivered: (_payload, _info, result) => {
2554
+ rememberThreadParticipation(result);
2555
+ },
2556
+ onError: (err, info) => {
2557
+ const dispatchDuration = Date.now() - dispatchStartTime;
2558
+ runtime.error?.(`[tlon] ${info.kind} reply failed after ${dispatchDuration}ms: ${String(err)}`);
2559
+ }
2560
+ },
2561
+ dispatcherOptions: {
2562
+ responsePrefix,
2563
+ humanDelay
2564
+ },
2565
+ record: { onRecordError: (err) => {
2566
+ runtime.error?.(`[tlon] failed updating session meta: ${String(err)}`);
2567
+ } }
2572
2568
  });
2573
2569
  };
2574
2570
  const watchedChannels = new Set(groupChannels);
@@ -2754,7 +2750,7 @@ async function monitorTlonProvider(opts = {}) {
2754
2750
  }
2755
2751
  continue;
2756
2752
  }
2757
- if (effectiveAutoAcceptDmInvites && isDmAllowed(ship, effectiveDmAllowlist)) {
2753
+ if (effectiveAutoAcceptDmInvites && await isDmAllowedWithIngress(ship, effectiveDmAllowlist)) {
2758
2754
  try {
2759
2755
  await api.poke({
2760
2756
  app: "chat",
@@ -2771,7 +2767,7 @@ async function monitorTlonProvider(opts = {}) {
2771
2767
  }
2772
2768
  continue;
2773
2769
  }
2774
- if (effectiveOwnerShip && !isDmAllowed(ship, effectiveDmAllowlist)) {
2770
+ if (effectiveOwnerShip && !await isDmAllowedWithIngress(ship, effectiveDmAllowlist)) {
2775
2771
  await queueApprovalRequest(createPendingApproval({
2776
2772
  type: "dm",
2777
2773
  requestingShip: ship,
@@ -2833,7 +2829,7 @@ async function monitorTlonProvider(opts = {}) {
2833
2829
  });
2834
2830
  return;
2835
2831
  }
2836
- if (!isDmAllowed(senderShip, effectiveDmAllowlist)) {
2832
+ if (!await isDmAllowedWithIngress(senderShip, effectiveDmAllowlist)) {
2837
2833
  if (effectiveOwnerShip) await queueApprovalRequest(createPendingApproval({
2838
2834
  type: "dm",
2839
2835
  requestingShip: senderShip,
@@ -3403,7 +3399,7 @@ async function uploadImageFromUrl(imageUrl) {
3403
3399
  const { response, release } = await fetchWithSsrFGuard({
3404
3400
  url: imageUrl,
3405
3401
  init: { method: "GET" },
3406
- policy: /* @__PURE__ */ getDefaultSsrFPolicy(),
3402
+ policy: void 0,
3407
3403
  auditContext: "tlon-upload-image"
3408
3404
  });
3409
3405
  try {
package/dist/test-api.js CHANGED
@@ -1,2 +1,2 @@
1
- import { t as tlonPlugin } from "./channel-DWjdEJ9A.js";
1
+ import { t as tlonPlugin } from "./channel-ByuwHe2i.js";
2
2
  export { tlonPlugin };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/tlon",
3
- "version": "2026.5.9-beta.1",
3
+ "version": "2026.5.10-beta.1",
4
4
  "description": "OpenClaw Tlon/Urbit channel plugin",
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.1044.0",
12
- "@aws-sdk/s3-request-presigner": "3.1044.0",
13
- "@tloncorp/tlon-skill": "0.3.5",
11
+ "@aws-sdk/client-s3": "3.1045.0",
12
+ "@aws-sdk/s3-request-presigner": "3.1045.0",
13
+ "@tloncorp/tlon-skill": "0.3.6",
14
14
  "@urbit/aura": "^3.0.0"
15
15
  },
16
16
  "devDependencies": {
@@ -18,7 +18,7 @@
18
18
  "openclaw": "workspace:*"
19
19
  },
20
20
  "peerDependencies": {
21
- "openclaw": ">=2026.5.9-beta.1"
21
+ "openclaw": ">=2026.5.10-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.9-beta.1"
75
+ "pluginApi": ">=2026.5.10-beta.1"
76
76
  },
77
77
  "build": {
78
- "openclawVersion": "2026.5.9-beta.1"
78
+ "openclawVersion": "2026.5.10-beta.1"
79
79
  },
80
80
  "release": {
81
81
  "publishToClawHub": true,