@openclaw/tlon 2026.10.5-beta.3 → 2026.10.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/.setup/{api-CD82bZzj.mjs → api-b5sNP2yy.mjs} +1 -1
- package/dist/.setup/{channel-C4naQdox.mjs → channel-BiTAKY7-.mjs} +1 -1
- package/dist/.setup/{channel.runtime-Bbp6_R2T.mjs → channel.runtime-Bkx-midT.mjs} +109 -36
- package/dist/api.js +1 -1
- package/dist/channel-plugin-api.js +1 -2
- package/dist/doctor-contract-api.js +1 -2
- package/dist/setup-entry.js +1 -1
- package/package.json +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SsrFBlockedError, createDedupeCache, createLoggerBackedRuntime, fetchWithSsrFGuard, isBlockedHostnameOrIp, ssrfPolicyFromDangerouslyAllowPrivateNetwork } from "../runtime-api.js";
|
|
2
|
-
import { t as tlonPlugin } from "./channel-
|
|
2
|
+
import { t as tlonPlugin } from "./channel-BiTAKY7-.mjs";
|
|
3
3
|
import { n as setTlonRuntime } from "./runtime-Ck3lNvST.mjs";
|
|
4
4
|
import "../api.js";
|
|
5
5
|
export { SsrFBlockedError, createDedupeCache, createLoggerBackedRuntime, fetchWithSsrFGuard, isBlockedHostnameOrIp, setTlonRuntime, ssrfPolicyFromDangerouslyAllowPrivateNetwork, tlonPlugin };
|
|
@@ -94,7 +94,7 @@ function resolveTlonOutboundSessionRoute(params) {
|
|
|
94
94
|
//#endregion
|
|
95
95
|
//#region extensions/tlon/src/channel.ts
|
|
96
96
|
const TLON_CHANNEL_ID = "tlon";
|
|
97
|
-
const loadTlonChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-
|
|
97
|
+
const loadTlonChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-Bkx-midT.mjs"));
|
|
98
98
|
const tlonSetupWizardProxy = createTlonSetupWizardBase(async (params) => await (await loadTlonChannelRuntime()).tlonSetupWizard.finalize(params));
|
|
99
99
|
const tlonConfigAdapter = createHybridChannelConfigAdapter({
|
|
100
100
|
sectionKey: TLON_CHANNEL_ID,
|
|
@@ -73,7 +73,7 @@ function parsePendingApprovals(value) {
|
|
|
73
73
|
return parsed.filter((item) => {
|
|
74
74
|
if (!item || typeof item !== "object") return false;
|
|
75
75
|
const obj = item;
|
|
76
|
-
return typeof obj.id === "string" && (obj.type === "dm" || obj.type === "channel" || obj.type === "group") && typeof obj.requestingShip === "string" && typeof obj.timestamp === "number";
|
|
76
|
+
return typeof obj.id === "string" && (obj.type === "dm" || obj.type === "channel" || obj.type === "group") && typeof obj.requestingShip === "string" && typeof obj.timestamp === "number" && (obj.clubId === void 0 || typeof obj.clubId === "string") && (obj.verifiedDirect === void 0 || typeof obj.verifiedDirect === "boolean");
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
79
|
function parseSettingsEvent(event) {
|
|
@@ -113,7 +113,7 @@ function createSettingsManager(api, logger) {
|
|
|
113
113
|
try {
|
|
114
114
|
const deskData = (await api.scry("/settings/all.json"))?.all?.[SETTINGS_DESK];
|
|
115
115
|
current = parseSettingsResponse(deskData ?? {});
|
|
116
|
-
logger?.log?.(
|
|
116
|
+
logger?.log?.("[settings] Loaded");
|
|
117
117
|
return current;
|
|
118
118
|
} catch (err) {
|
|
119
119
|
logger?.log?.(`[settings] No settings found (using defaults): ${String(err)}`);
|
|
@@ -128,7 +128,7 @@ function createSettingsManager(api, logger) {
|
|
|
128
128
|
event: (event) => {
|
|
129
129
|
const update = parseSettingsEvent(event);
|
|
130
130
|
if (!update) return;
|
|
131
|
-
logger?.log?.(`[settings] Update: ${update.key}
|
|
131
|
+
logger?.log?.(`[settings] Update: ${update.key}`);
|
|
132
132
|
current = applySettingsUpdate(current, update.key, update.value);
|
|
133
133
|
try {
|
|
134
134
|
onChange(current);
|
|
@@ -715,9 +715,7 @@ async function sendGroupMessage({ text, ...params }) {
|
|
|
715
715
|
async function sendGroupMessageWithStory({ api, fromShip, hostShip, channelName, story, replyToId, kind = "unknown" }) {
|
|
716
716
|
const sentAt = Date.now();
|
|
717
717
|
let formattedReplyId = replyToId;
|
|
718
|
-
if (replyToId && /^\d+$/.test(replyToId))
|
|
719
|
-
formattedReplyId = scot("ud", BigInt(replyToId));
|
|
720
|
-
} catch {}
|
|
718
|
+
if (replyToId && /^\d+$/.test(replyToId)) formattedReplyId = scot("ud", BigInt(replyToId));
|
|
721
719
|
const memo = {
|
|
722
720
|
content: story,
|
|
723
721
|
author: fromShip,
|
|
@@ -858,7 +856,8 @@ async function ensureUrbitChannelOpen(deps, params) {
|
|
|
858
856
|
await openUrbitChannelStep(deps, {
|
|
859
857
|
body: params.createBody,
|
|
860
858
|
auditContext: params.createAuditContext,
|
|
861
|
-
operation: "Channel creation"
|
|
859
|
+
operation: "Channel creation",
|
|
860
|
+
beforeRequest: params.beforeRequest
|
|
862
861
|
});
|
|
863
862
|
await openUrbitChannelStep(deps, {
|
|
864
863
|
body: [{
|
|
@@ -870,7 +869,8 @@ async function ensureUrbitChannelOpen(deps, params) {
|
|
|
870
869
|
json: "Opening API channel"
|
|
871
870
|
}],
|
|
872
871
|
auditContext: "tlon-urbit-channel-wake",
|
|
873
|
-
operation: "Channel activation"
|
|
872
|
+
operation: "Channel activation",
|
|
873
|
+
beforeRequest: params.beforeRequest
|
|
874
874
|
});
|
|
875
875
|
}
|
|
876
876
|
//#endregion
|
|
@@ -934,7 +934,8 @@ var UrbitSSEClient = class {
|
|
|
934
934
|
async createCurrentChannel() {
|
|
935
935
|
await ensureUrbitChannelOpen(this.channelRequestContext(), {
|
|
936
936
|
createBody: this.subscriptions,
|
|
937
|
-
createAuditContext: "tlon-urbit-channel-create"
|
|
937
|
+
createAuditContext: "tlon-urbit-channel-create",
|
|
938
|
+
beforeRequest: () => this.reconnectAbortController.signal.throwIfAborted()
|
|
938
939
|
});
|
|
939
940
|
}
|
|
940
941
|
async subscribe(params) {
|
|
@@ -1002,21 +1003,27 @@ var UrbitSSEClient = class {
|
|
|
1002
1003
|
ssrfPolicy: this.ssrfPolicy,
|
|
1003
1004
|
lookupFn: this.lookupFn,
|
|
1004
1005
|
fetchImpl: this.fetchImpl,
|
|
1005
|
-
signal: controller.signal,
|
|
1006
|
+
signal: AbortSignal.any([controller.signal, this.reconnectAbortController.signal]),
|
|
1007
|
+
beforeRequest: () => this.reconnectAbortController.signal.throwIfAborted(),
|
|
1006
1008
|
auditContext: "tlon-urbit-sse-stream"
|
|
1007
1009
|
});
|
|
1008
1010
|
} finally {
|
|
1009
1011
|
clearTimeout(timeoutId);
|
|
1010
1012
|
}
|
|
1011
1013
|
const { response, release } = stream;
|
|
1014
|
+
if (this.reconnectAbortController.signal.aborted) {
|
|
1015
|
+
await release();
|
|
1016
|
+
this.reconnectAbortController.signal.throwIfAborted();
|
|
1017
|
+
}
|
|
1012
1018
|
this.streamRelease = release;
|
|
1013
|
-
if (!response.ok) {
|
|
1019
|
+
if (!response.ok || !response.body) {
|
|
1014
1020
|
this.streamRelease = null;
|
|
1015
1021
|
await release();
|
|
1016
|
-
throw new UrbitHttpError({
|
|
1022
|
+
if (!response.ok) throw new UrbitHttpError({
|
|
1017
1023
|
operation: "Stream connection",
|
|
1018
1024
|
status: response.status
|
|
1019
1025
|
});
|
|
1026
|
+
return;
|
|
1020
1027
|
}
|
|
1021
1028
|
this.processStream(response.body).catch((error) => {
|
|
1022
1029
|
if (!this.aborted) {
|
|
@@ -1032,6 +1039,7 @@ var UrbitSSEClient = class {
|
|
|
1032
1039
|
let buffer = "";
|
|
1033
1040
|
let bufferBytes = 0;
|
|
1034
1041
|
let pendingDelimiterNewline = false;
|
|
1042
|
+
let pendingCarriageReturn = false;
|
|
1035
1043
|
const appendPending = (text) => {
|
|
1036
1044
|
const previousCodeUnit = buffer.charCodeAt(buffer.length - 1);
|
|
1037
1045
|
const firstCodeUnit = text.charCodeAt(0);
|
|
@@ -1041,7 +1049,11 @@ var UrbitSSEClient = class {
|
|
|
1041
1049
|
buffer += text;
|
|
1042
1050
|
bufferBytes = nextBytes;
|
|
1043
1051
|
};
|
|
1044
|
-
const consumeText = async (
|
|
1052
|
+
const consumeText = async (rawText) => {
|
|
1053
|
+
if (rawText.length === 0) return;
|
|
1054
|
+
const startsWithPendingLineFeed = pendingCarriageReturn && rawText.startsWith("\n");
|
|
1055
|
+
pendingCarriageReturn = rawText.endsWith("\r");
|
|
1056
|
+
const text = (startsWithPendingLineFeed ? rawText.slice(1) : rawText).replace(/\r\n?/g, "\n");
|
|
1045
1057
|
let offset = 0;
|
|
1046
1058
|
if (pendingDelimiterNewline && text.length > 0) {
|
|
1047
1059
|
pendingDelimiterNewline = false;
|
|
@@ -1091,13 +1103,17 @@ var UrbitSSEClient = class {
|
|
|
1091
1103
|
}
|
|
1092
1104
|
}
|
|
1093
1105
|
async processEvent(eventData) {
|
|
1094
|
-
const lines = eventData.split(
|
|
1095
|
-
|
|
1106
|
+
const lines = eventData.split(/\r\n|\r|\n/);
|
|
1107
|
+
const dataLines = [];
|
|
1096
1108
|
let eventId = null;
|
|
1097
1109
|
for (const line of lines) {
|
|
1098
1110
|
if (line.startsWith("id:")) eventId = parseUrbitSseEventId(line.slice(3).trim());
|
|
1099
|
-
if (line.startsWith("data:"))
|
|
1111
|
+
if (line.startsWith("data:")) {
|
|
1112
|
+
const value = line.slice(5);
|
|
1113
|
+
dataLines.push(value.startsWith(" ") ? value.slice(1) : value);
|
|
1114
|
+
}
|
|
1100
1115
|
}
|
|
1116
|
+
const data = dataLines.join("\n");
|
|
1101
1117
|
if (!data) return;
|
|
1102
1118
|
let parsed;
|
|
1103
1119
|
try {
|
|
@@ -1189,6 +1205,7 @@ var UrbitSSEClient = class {
|
|
|
1189
1205
|
this.reconnectAttempts = 0;
|
|
1190
1206
|
this.logger.log?.("[SSE] Reconnection successful!");
|
|
1191
1207
|
} catch (error) {
|
|
1208
|
+
if (this.aborted) return;
|
|
1192
1209
|
this.logger.error?.(`[SSE] Reconnection failed: ${String(error)}`);
|
|
1193
1210
|
await this.attemptReconnect();
|
|
1194
1211
|
}
|
|
@@ -1260,6 +1277,8 @@ function createPendingApproval(params) {
|
|
|
1260
1277
|
id: generateApprovalId(params.type),
|
|
1261
1278
|
type: params.type,
|
|
1262
1279
|
requestingShip: params.requestingShip,
|
|
1280
|
+
...params.clubId !== void 0 ? { clubId: params.clubId } : {},
|
|
1281
|
+
...params.verifiedDirect === true ? { verifiedDirect: true } : {},
|
|
1263
1282
|
channelNest: params.channelNest,
|
|
1264
1283
|
groupFlag: params.groupFlag,
|
|
1265
1284
|
messagePreview: params.messagePreview != null ? sliceUtf16Safe(params.messagePreview, 0, 100) : void 0,
|
|
@@ -1274,7 +1293,12 @@ function truncate(text, maxLength) {
|
|
|
1274
1293
|
function formatApprovalRequest(approval) {
|
|
1275
1294
|
const preview = approval.messagePreview ? `\n"${truncate(approval.messagePreview, 100)}"` : "";
|
|
1276
1295
|
switch (approval.type) {
|
|
1277
|
-
case "dm":
|
|
1296
|
+
case "dm":
|
|
1297
|
+
if (approval.clubId !== void 0) {
|
|
1298
|
+
const replayLine = approval.originalMessage ? `The message is answered as an unverified group DM sender, never as ${approval.requestingShip}.` : `The message is not kept, so it will not be answered; have ${approval.requestingShip} send it again in a normal direct message to get a reply.`;
|
|
1299
|
+
return `New group DM message claiming to be from ${approval.requestingShip} (unverified; group DM ${approval.clubId}):${preview}\n\nApproving adds ${approval.requestingShip} to the DM allowlist. ${replayLine}\nReply "approve", "deny", or "block" (ID: ${approval.id})`;
|
|
1300
|
+
}
|
|
1301
|
+
return `New DM request from ${approval.requestingShip}:${preview}\n\nReply "approve", "deny", or "block" (ID: ${approval.id})`;
|
|
1278
1302
|
case "channel": return `${approval.requestingShip} mentioned you in ${approval.channelNest}:${preview}\n\nReply "approve", "deny", or "block"\n(ID: ${approval.id})`;
|
|
1279
1303
|
case "group": return `Group invite from ${approval.requestingShip} to join ${approval.groupFlag}\n\nReply "approve", "deny", or "block"\n(ID: ${approval.id})`;
|
|
1280
1304
|
}
|
|
@@ -1295,12 +1319,22 @@ function findPendingApproval(pendingApprovals, id) {
|
|
|
1295
1319
|
function removePendingApproval(pendingApprovals, id) {
|
|
1296
1320
|
return pendingApprovals.filter((a) => a.id !== id);
|
|
1297
1321
|
}
|
|
1322
|
+
/**
|
|
1323
|
+
* DM requests saved before sender provenance was recorded cannot be told apart from unverified
|
|
1324
|
+
* group DM claims, so their stored message is never replayed; the sender must send it again.
|
|
1325
|
+
*/
|
|
1326
|
+
function requiresResendAfterApproval(approval) {
|
|
1327
|
+
return approval.type === "dm" && approval.originalMessage !== void 0 && approval.clubId === void 0 && approval.verifiedDirect !== true;
|
|
1328
|
+
}
|
|
1298
1329
|
function formatApprovalConfirmation(approval, action) {
|
|
1299
1330
|
if (action === "block") return `Blocked ${approval.requestingShip}. They will no longer be able to contact the bot.`;
|
|
1300
1331
|
const actionText = action === "approve" ? "Approved" : "Denied";
|
|
1301
1332
|
switch (approval.type) {
|
|
1302
1333
|
case "dm":
|
|
1303
|
-
if (action === "approve")
|
|
1334
|
+
if (action === "approve") {
|
|
1335
|
+
if (requiresResendAfterApproval(approval)) return `${actionText} DM access for ${approval.requestingShip}. They can now message the bot.\nTheir earlier message was saved before this version and its sender cannot be verified, so it was not processed. Ask ${approval.requestingShip} to send it again.`;
|
|
1336
|
+
return `${actionText} DM access for ${approval.requestingShip}. They can now message the bot.`;
|
|
1337
|
+
}
|
|
1304
1338
|
return `${actionText} DM request from ${approval.requestingShip}.`;
|
|
1305
1339
|
case "channel":
|
|
1306
1340
|
if (action === "approve") return `${actionText} ${approval.requestingShip} for ${approval.channelNest}. They can now interact in this channel.`;
|
|
@@ -1444,11 +1478,13 @@ function createTlonApprovalRuntime(params) {
|
|
|
1444
1478
|
return false;
|
|
1445
1479
|
}
|
|
1446
1480
|
const approvals = state.pendingApprovals;
|
|
1447
|
-
const existing = approvals.find((item) => item.type === approval.type && item.requestingShip === approval.requestingShip && (approval.type !== "channel" || item.channelNest === approval.channelNest) && (approval.type !== "group" || item.groupFlag === approval.groupFlag));
|
|
1481
|
+
const existing = approvals.find((item) => item.type === approval.type && item.requestingShip === approval.requestingShip && item.clubId === approval.clubId && (approval.type !== "channel" || item.channelNest === approval.channelNest) && (approval.type !== "group" || item.groupFlag === approval.groupFlag));
|
|
1448
1482
|
if (existing) {
|
|
1449
1483
|
if (approval.originalMessage) {
|
|
1450
1484
|
existing.originalMessage = approval.originalMessage;
|
|
1451
1485
|
existing.messagePreview = approval.messagePreview;
|
|
1486
|
+
if (approval.verifiedDirect === true) existing.verifiedDirect = true;
|
|
1487
|
+
else delete existing.verifiedDirect;
|
|
1452
1488
|
}
|
|
1453
1489
|
runtime.log?.(`[tlon] Updated existing approval for ${approval.requestingShip} (${approval.type}) - re-sending notification`);
|
|
1454
1490
|
await savePendingApprovals(true);
|
|
@@ -1482,7 +1518,8 @@ function createTlonApprovalRuntime(params) {
|
|
|
1482
1518
|
if (parsed.action === "approve") switch (approval.type) {
|
|
1483
1519
|
case "dm":
|
|
1484
1520
|
await addToDmAllowlist(approval.requestingShip);
|
|
1485
|
-
if (approval
|
|
1521
|
+
if (requiresResendAfterApproval(approval)) runtime.log?.(`[tlon] Not replaying pre-upgrade DM request from ${approval.requestingShip}: sender provenance unknown; owner told to request a resend`);
|
|
1522
|
+
else if (approval.originalMessage) {
|
|
1486
1523
|
runtime.log?.(`[tlon] Processing original message from ${approval.requestingShip} after approval`);
|
|
1487
1524
|
await processApprovedMessage(approval);
|
|
1488
1525
|
}
|
|
@@ -1725,7 +1762,14 @@ function extractMessageText(content) {
|
|
|
1725
1762
|
}
|
|
1726
1763
|
}
|
|
1727
1764
|
const codeBlock = asNullableRecord(block.code);
|
|
1728
|
-
if (codeBlock)
|
|
1765
|
+
if (codeBlock) {
|
|
1766
|
+
const lang = readStringField(codeBlock, "lang") ?? "";
|
|
1767
|
+
const code = readStringField(codeBlock, "code") ?? "";
|
|
1768
|
+
let fenceLength = 3;
|
|
1769
|
+
for (const match of code.matchAll(/`+/g)) fenceLength = Math.max(fenceLength, match[0].length + 1);
|
|
1770
|
+
const fence = "`".repeat(fenceLength);
|
|
1771
|
+
return `\n${fence}${lang}\n${code}\n${fence}\n`;
|
|
1772
|
+
}
|
|
1729
1773
|
const header = asNullableRecord(block.header);
|
|
1730
1774
|
if (header) return `\n## ${(Array.isArray(header.content) ? header.content : []).map((item) => typeof item === "string" ? item : "").join("")}\n`;
|
|
1731
1775
|
const cite = asNullableRecord(block.cite);
|
|
@@ -2367,6 +2411,10 @@ function createActiveSnapshotTracker() {
|
|
|
2367
2411
|
}
|
|
2368
2412
|
//#endregion
|
|
2369
2413
|
//#region extensions/tlon/src/monitor/index.ts
|
|
2414
|
+
/** Identity for an unverified group DM (club) author claim; never matches a bare ship. */
|
|
2415
|
+
function clubSenderId(clubId, claimedShip) {
|
|
2416
|
+
return `club:${clubId}:${claimedShip}`;
|
|
2417
|
+
}
|
|
2370
2418
|
async function monitorTlonProvider(opts) {
|
|
2371
2419
|
const discoveryScheduler = opts.scheduler.scope();
|
|
2372
2420
|
const core = getTlonRuntime();
|
|
@@ -2479,9 +2527,17 @@ async function monitorTlonProvider(opts) {
|
|
|
2479
2527
|
if (!settingsState.effectiveOwnerShip) return false;
|
|
2480
2528
|
return normalizeShip(ship) === settingsState.effectiveOwnerShip;
|
|
2481
2529
|
}
|
|
2530
|
+
/** DM ingress allowlist for one chat event; club claims only match as their club-scoped id. */
|
|
2531
|
+
function resolveChatAllowFrom(params) {
|
|
2532
|
+
if (params.ownerDm) return [params.senderShip];
|
|
2533
|
+
if (!params.isClubMessage) return settingsState.effectiveDmAllowlist;
|
|
2534
|
+
return settingsState.effectiveDmAllowlist.some((ship) => normalizeShip(ship) === params.senderShip) ? [params.senderId] : [];
|
|
2535
|
+
}
|
|
2482
2536
|
const processMessage = async (params) => {
|
|
2483
2537
|
const { messageId, senderShip, isGroup, channelNest, timestamp, parentId, isThreadReply, isAdmissionAllowed, messageContent, turnAdoptionLifecycle, resolveChannelIngress } = params;
|
|
2484
2538
|
let messageText = params.messageText;
|
|
2539
|
+
const clubId = params.clubId;
|
|
2540
|
+
const senderId = clubId === void 0 ? senderShip : clubSenderId(clubId, senderShip);
|
|
2485
2541
|
let attachments = [];
|
|
2486
2542
|
let unavailableMediaCount = 0;
|
|
2487
2543
|
if (messageContent) try {
|
|
@@ -2567,13 +2623,13 @@ async function monitorTlonProvider(opts) {
|
|
|
2567
2623
|
}
|
|
2568
2624
|
senders.add(senderShip);
|
|
2569
2625
|
}
|
|
2570
|
-
const senderRole = isOwner(senderShip) ? "owner" : "user";
|
|
2571
|
-
const fromLabel = isGroup ? `${senderShip} [${senderRole}] in ${channelNest}` : `${senderShip} [${senderRole}]`;
|
|
2626
|
+
const senderRole = clubId === void 0 && isOwner(senderShip) ? "owner" : "user";
|
|
2627
|
+
const fromLabel = isGroup ? `${senderShip} [${senderRole}] in ${channelNest}` : clubId !== void 0 ? `${senderShip} (unverified) [${senderRole}] in group DM ${clubId}` : `${senderShip} [${senderRole}]`;
|
|
2572
2628
|
const shouldComputeAuth = core.channel.commands.shouldComputeCommandAuthorized(messageText, cfg);
|
|
2573
2629
|
let commandAuthorized = false;
|
|
2574
2630
|
if (shouldComputeAuth) {
|
|
2575
2631
|
commandAuthorized = (await resolveTlonCommandAuthorizationWithIngress({
|
|
2576
|
-
senderShip,
|
|
2632
|
+
senderShip: senderId,
|
|
2577
2633
|
ownerShip: settingsState.effectiveOwnerShip
|
|
2578
2634
|
})).commandAccess.authorized;
|
|
2579
2635
|
if (!commandAuthorized) console.log(`[tlon] Command attempt denied: ${senderShip} is not owner (owner=${settingsState.effectiveOwnerShip ?? "not configured"})`);
|
|
@@ -2599,10 +2655,10 @@ async function monitorTlonProvider(opts) {
|
|
|
2599
2655
|
accountId: route.accountId,
|
|
2600
2656
|
messageId,
|
|
2601
2657
|
timestamp,
|
|
2602
|
-
from: isGroup ? `tlon:group:${channelNest}` : `tlon:${
|
|
2658
|
+
from: isGroup ? `tlon:group:${channelNest}` : `tlon:${senderId}`,
|
|
2603
2659
|
sender: {
|
|
2604
|
-
id:
|
|
2605
|
-
name: senderShip,
|
|
2660
|
+
id: senderId,
|
|
2661
|
+
name: clubId === void 0 ? senderShip : senderId,
|
|
2606
2662
|
roles: [senderRole]
|
|
2607
2663
|
},
|
|
2608
2664
|
conversation: {
|
|
@@ -2734,9 +2790,16 @@ async function monitorTlonProvider(opts) {
|
|
|
2734
2790
|
const isGroup = approval.type === "channel";
|
|
2735
2791
|
const conversationId = isGroup ? approval.channelNest ?? "" : approval.requestingShip;
|
|
2736
2792
|
if (isGroup && !conversationId) return;
|
|
2793
|
+
const clubId = !isGroup ? approval.clubId : void 0;
|
|
2794
|
+
if (!isGroup && clubId === void 0 && approval.verifiedDirect !== true) {
|
|
2795
|
+
runtime.log?.(`[tlon] Not replaying pre-upgrade DM request from ${approval.requestingShip}: sender provenance unknown`);
|
|
2796
|
+
return;
|
|
2797
|
+
}
|
|
2798
|
+
const replaySenderId = clubId === void 0 ? approval.requestingShip : clubSenderId(clubId, approval.requestingShip);
|
|
2737
2799
|
await processMessage({
|
|
2738
2800
|
messageId: approval.originalMessage.messageId,
|
|
2739
2801
|
senderShip: approval.requestingShip,
|
|
2802
|
+
clubId,
|
|
2740
2803
|
messageText: approval.originalMessage.messageText,
|
|
2741
2804
|
messageContent: approval.originalMessage.messageContent,
|
|
2742
2805
|
timestamp: approval.originalMessage.timestamp,
|
|
@@ -2747,13 +2810,13 @@ async function monitorTlonProvider(opts) {
|
|
|
2747
2810
|
isThreadReply: approval.originalMessage.isThreadReply
|
|
2748
2811
|
} : {},
|
|
2749
2812
|
resolveChannelIngress: async (contextBinding) => await resolveTlonMessageIngress({
|
|
2750
|
-
senderShip:
|
|
2813
|
+
senderShip: replaySenderId,
|
|
2751
2814
|
accountId: account.accountId,
|
|
2752
2815
|
conversation: {
|
|
2753
2816
|
kind: isGroup ? "group" : "direct",
|
|
2754
2817
|
id: conversationId
|
|
2755
2818
|
},
|
|
2756
|
-
allowFrom: [
|
|
2819
|
+
allowFrom: [replaySenderId],
|
|
2757
2820
|
...isGroup ? { groupPolicy: "allowlist" } : {},
|
|
2758
2821
|
contextBinding
|
|
2759
2822
|
})
|
|
@@ -2916,29 +2979,37 @@ async function monitorTlonProvider(opts) {
|
|
|
2916
2979
|
const authorShip = normalizeShip(readStringField(essay, "author") ?? "");
|
|
2917
2980
|
const partnerShip = extractDmPartnerShip(whom);
|
|
2918
2981
|
const senderShip = partnerShip || authorShip;
|
|
2982
|
+
const clubId = partnerShip ? void 0 : typeof whom === "string" && whom ? whom : "unknown";
|
|
2983
|
+
const isClubMessage = clubId !== void 0;
|
|
2984
|
+
const senderId = isClubMessage ? clubSenderId(clubId, senderShip) : senderShip;
|
|
2919
2985
|
if (authorShip === botShipName) return;
|
|
2920
2986
|
if (!senderShip || senderShip === botShipName) return;
|
|
2921
2987
|
if (authorShip && partnerShip && authorShip !== partnerShip) runtime.log?.(`[tlon] DM ship mismatch (author=${authorShip}, partner=${partnerShip}) - routing to partner`);
|
|
2922
2988
|
const rawText = extractMessageText(essay.content);
|
|
2923
2989
|
if (!rawText.trim()) return;
|
|
2924
2990
|
const messageText = rawText;
|
|
2925
|
-
|
|
2991
|
+
const ownerDm = !isClubMessage && isOwner(senderShip);
|
|
2992
|
+
if (ownerDm && await handleApprovalResponse(messageText)) {
|
|
2926
2993
|
runtime.log?.(`[tlon] Processed approval response from owner: ${messageText}`);
|
|
2927
2994
|
return;
|
|
2928
2995
|
}
|
|
2929
|
-
if (
|
|
2996
|
+
if (ownerDm && await handleAdminCommand(messageText)) {
|
|
2930
2997
|
runtime.log?.(`[tlon] Processed admin command from owner: ${messageText}`);
|
|
2931
2998
|
return;
|
|
2932
2999
|
}
|
|
2933
|
-
const ownerDm = isOwner(senderShip);
|
|
2934
3000
|
const resolveChannelIngress = async (contextBinding) => await resolveTlonMessageIngress({
|
|
2935
|
-
senderShip,
|
|
3001
|
+
senderShip: senderId,
|
|
2936
3002
|
accountId: account.accountId,
|
|
2937
3003
|
conversation: {
|
|
2938
3004
|
kind: "direct",
|
|
2939
3005
|
id: senderShip
|
|
2940
3006
|
},
|
|
2941
|
-
allowFrom:
|
|
3007
|
+
allowFrom: resolveChatAllowFrom({
|
|
3008
|
+
ownerDm,
|
|
3009
|
+
isClubMessage,
|
|
3010
|
+
senderShip,
|
|
3011
|
+
senderId
|
|
3012
|
+
}),
|
|
2942
3013
|
contextBinding
|
|
2943
3014
|
});
|
|
2944
3015
|
if (!ownerDm && !(await resolveChannelIngress()).senderAccess.allowed) {
|
|
@@ -2947,12 +3018,13 @@ async function monitorTlonProvider(opts) {
|
|
|
2947
3018
|
type: "dm",
|
|
2948
3019
|
requestingShip: senderShip,
|
|
2949
3020
|
messagePreview: sliceUtf16Safe(messageText, 0, 100),
|
|
2950
|
-
|
|
3021
|
+
...isClubMessage ? { clubId } : { verifiedDirect: true },
|
|
3022
|
+
...isClubMessage && isOwner(senderShip) ? {} : { originalMessage: {
|
|
2951
3023
|
messageId,
|
|
2952
3024
|
messageText,
|
|
2953
3025
|
messageContent: essay.content,
|
|
2954
3026
|
timestamp: asFiniteNumber(essay?.sent) ?? Date.now()
|
|
2955
|
-
}
|
|
3027
|
+
} }
|
|
2956
3028
|
});
|
|
2957
3029
|
await queueApprovalRequest(approval);
|
|
2958
3030
|
} else runtime.log?.(`[tlon] Blocked DM from ${senderShip}: not in allowlist`);
|
|
@@ -2964,6 +3036,7 @@ async function monitorTlonProvider(opts) {
|
|
|
2964
3036
|
messageText: resolvedMessageText,
|
|
2965
3037
|
messageId,
|
|
2966
3038
|
senderShip,
|
|
3039
|
+
clubId,
|
|
2967
3040
|
messageContent: essay.content,
|
|
2968
3041
|
isGroup: false,
|
|
2969
3042
|
timestamp: asFiniteNumber(essay?.sent) ?? Date.now(),
|
package/dist/api.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { SsrFBlockedError, createDedupeCache, createLoggerBackedRuntime, fetchWithSsrFGuard, isBlockedHostnameOrIp, ssrfPolicyFromDangerouslyAllowPrivateNetwork } from "./runtime-api.js";
|
|
2
|
-
import { t as tlonPlugin } from "./.setup/channel-
|
|
2
|
+
import { t as tlonPlugin } from "./.setup/channel-BiTAKY7-.mjs";
|
|
3
3
|
import { n as setTlonRuntime } from "./.setup/runtime-Ck3lNvST.mjs";
|
|
4
4
|
export { SsrFBlockedError, createDedupeCache, createLoggerBackedRuntime, fetchWithSsrFGuard, isBlockedHostnameOrIp, setTlonRuntime, ssrfPolicyFromDangerouslyAllowPrivateNetwork, tlonPlugin };
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { tlonPlugin };
|
|
1
|
+
export { t as tlonPlugin } from "./.setup/channel-BiTAKY7-.mjs";
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { legacyConfigRules, normalizeCompatibilityConfig };
|
|
1
|
+
export { t as legacyConfigRules, n as normalizeCompatibilityConfig } from "./.setup/doctor-contract-bInPRAQZ.mjs";
|
package/dist/setup-entry.js
CHANGED
|
@@ -4,7 +4,7 @@ import { fileURLToPath } from "node:url";
|
|
|
4
4
|
var setup_entry_default = defineBundledChannelSetupEntry({
|
|
5
5
|
importMetaUrl: import.meta.url,
|
|
6
6
|
plugin: {
|
|
7
|
-
specifier: fileURLToPath(new URL(".setup/api-
|
|
7
|
+
specifier: fileURLToPath(new URL(".setup/api-b5sNP2yy.mjs", import.meta.url).href),
|
|
8
8
|
exportName: "tlonPlugin"
|
|
9
9
|
}
|
|
10
10
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/tlon",
|
|
3
|
-
"version": "2026.10.
|
|
3
|
+
"version": "2026.10.10-beta.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.10.
|
|
22
|
+
"openclaw": ">=2026.10.10-beta.1"
|
|
23
23
|
},
|
|
24
24
|
"peerDependenciesMeta": {
|
|
25
25
|
"openclaw": {
|
|
@@ -121,10 +121,10 @@
|
|
|
121
121
|
"minHostVersion": ">=2026.4.10"
|
|
122
122
|
},
|
|
123
123
|
"compat": {
|
|
124
|
-
"pluginApi": ">=2026.10.
|
|
124
|
+
"pluginApi": ">=2026.10.10-beta.1"
|
|
125
125
|
},
|
|
126
126
|
"build": {
|
|
127
|
-
"openclawVersion": "2026.10.
|
|
127
|
+
"openclawVersion": "2026.10.10-beta.1"
|
|
128
128
|
},
|
|
129
129
|
"release": {
|
|
130
130
|
"bundleRuntimeDependencies": false,
|