@openclaw/tlon 2026.5.9-beta.1 → 2026.5.10-beta.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 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-
|
|
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-
|
|
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-
|
|
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
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
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:
|
|
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
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
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.
|
|
2509
|
+
await core.channel.turn.runAssembled({
|
|
2499
2510
|
channel: "tlon",
|
|
2500
2511
|
accountId: route.accountId,
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
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 &&
|
|
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 && !
|
|
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 (!
|
|
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:
|
|
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-
|
|
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.
|
|
3
|
+
"version": "2026.5.10-beta.2",
|
|
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.
|
|
12
|
-
"@aws-sdk/s3-request-presigner": "3.
|
|
13
|
-
"@tloncorp/tlon-skill": "0.3.
|
|
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.
|
|
21
|
+
"openclaw": ">=2026.5.10-beta.2"
|
|
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.
|
|
75
|
+
"pluginApi": ">=2026.5.10-beta.2"
|
|
76
76
|
},
|
|
77
77
|
"build": {
|
|
78
|
-
"openclawVersion": "2026.5.
|
|
78
|
+
"openclawVersion": "2026.5.10-beta.2"
|
|
79
79
|
},
|
|
80
80
|
"release": {
|
|
81
81
|
"publishToClawHub": true,
|