@openclaw/tlon 2026.8.1-beta.2 → 2026.9.1-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 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-BhqDxdrd.js";
|
|
3
3
|
import { n as setTlonRuntime } from "./runtime-Ck3lNvST.js";
|
|
4
4
|
export { SsrFBlockedError, createDedupeCache, createLoggerBackedRuntime, fetchWithSsrFGuard, isBlockedHostnameOrIp, setTlonRuntime, ssrfPolicyFromDangerouslyAllowPrivateNetwork, tlonPlugin };
|
|
@@ -42,6 +42,7 @@ const tlonCommonConfigFields = {
|
|
|
42
42
|
const TlonAccountSchema = z.object({ ...tlonCommonConfigFields });
|
|
43
43
|
const tlonChannelConfigSchema = buildChannelConfigSchema(z.object({
|
|
44
44
|
...tlonCommonConfigFields,
|
|
45
|
+
historyLimit: z.number().int().min(0).optional(),
|
|
45
46
|
authorization: TlonAuthorizationSchema.optional(),
|
|
46
47
|
defaultAuthorizedShips: z.array(ShipSchema).optional(),
|
|
47
48
|
accounts: z.record(z.string(), TlonAccountSchema).optional()
|
|
@@ -92,7 +93,7 @@ function resolveTlonOutboundSessionRoute(params) {
|
|
|
92
93
|
//#endregion
|
|
93
94
|
//#region extensions/tlon/src/channel.ts
|
|
94
95
|
const TLON_CHANNEL_ID = "tlon";
|
|
95
|
-
const loadTlonChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-
|
|
96
|
+
const loadTlonChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-BiVAscnL.js"));
|
|
96
97
|
const tlonSetupWizardProxy = createTlonSetupWizardBase({
|
|
97
98
|
resolveConfigured: async ({ cfg, accountId }) => await (await loadTlonChannelRuntime()).tlonSetupWizard.status.resolveConfigured({
|
|
98
99
|
cfg,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as tlonPlugin } from "./channel-
|
|
1
|
+
import { t as tlonPlugin } from "./channel-BhqDxdrd.js";
|
|
2
2
|
export { tlonPlugin };
|
|
@@ -13,6 +13,7 @@ import { runChannelProbe, sliceUtf16Safe } from "openclaw/plugin-sdk/text-utilit
|
|
|
13
13
|
import { resolveHumanDelayConfig } from "openclaw/plugin-sdk/agent-runtime";
|
|
14
14
|
import { createChannelInboundEnvelopeBuilder, formatAgentEnvelope, formatInboundMediaUnavailableText, implicitMentionKindWhen, resolveEnvelopeFormatOptions, resolveInboundMentionDecision } from "openclaw/plugin-sdk/channel-inbound";
|
|
15
15
|
import { collectErrorGraphCandidates, formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
16
|
+
import { retryAsync } from "openclaw/plugin-sdk/retry-runtime";
|
|
16
17
|
import { sleepWithAbort } from "openclaw/plugin-sdk/runtime-env";
|
|
17
18
|
import { da, scot } from "@urbit/aura";
|
|
18
19
|
import { Readable } from "node:stream";
|
|
@@ -414,7 +415,7 @@ function parseInlineMarkdown(text) {
|
|
|
414
415
|
}
|
|
415
416
|
const imageMatch = remaining.match(/^!\[([^\]]*)\]\(([^)]+)\)/);
|
|
416
417
|
if (imageMatch) {
|
|
417
|
-
result.push({
|
|
418
|
+
result.push({ imageBlock: {
|
|
418
419
|
src: expectDefined(imageMatch[2], "image URL capture"),
|
|
419
420
|
alt: expectDefined(imageMatch[1], "image alt capture")
|
|
420
421
|
} });
|
|
@@ -492,8 +493,8 @@ function isImageUrl(url) {
|
|
|
492
493
|
function processInlinesForImages(inlines) {
|
|
493
494
|
const cleanInlines = [];
|
|
494
495
|
const imageBlocks = [];
|
|
495
|
-
for (const inline of inlines) if (typeof inline === "object" && "
|
|
496
|
-
const img = inline
|
|
496
|
+
for (const inline of inlines) if (typeof inline === "object" && "imageBlock" in inline) {
|
|
497
|
+
const img = inline.imageBlock;
|
|
497
498
|
imageBlocks.push(createImageBlock(img.src, img.alt));
|
|
498
499
|
} else cleanInlines.push(inline);
|
|
499
500
|
return {
|
|
@@ -1531,7 +1532,7 @@ function formatPendingList(approvals) {
|
|
|
1531
1532
|
//#region extensions/tlon/src/monitor/approval-runtime.ts
|
|
1532
1533
|
function createTlonApprovalRuntime(params) {
|
|
1533
1534
|
const { api, runtime, botShipName, getPendingApprovals, setPendingApprovals, getCurrentSettings, setCurrentSettings, getEffectiveDmAllowlist, setEffectiveDmAllowlist, getEffectiveOwnerShip, processApprovedMessage, refreshWatchedChannels } = params;
|
|
1534
|
-
const savePendingApprovals = async () => {
|
|
1535
|
+
const savePendingApprovals = async (required = false) => {
|
|
1535
1536
|
try {
|
|
1536
1537
|
await api.poke({
|
|
1537
1538
|
app: "settings",
|
|
@@ -1545,6 +1546,7 @@ function createTlonApprovalRuntime(params) {
|
|
|
1545
1546
|
});
|
|
1546
1547
|
} catch (err) {
|
|
1547
1548
|
runtime.error?.(`[tlon] Failed to save pending approvals: ${String(err)}`);
|
|
1549
|
+
if (required) throw err;
|
|
1548
1550
|
}
|
|
1549
1551
|
};
|
|
1550
1552
|
const addToDmAllowlist = async (ship) => {
|
|
@@ -1683,12 +1685,12 @@ function createTlonApprovalRuntime(params) {
|
|
|
1683
1685
|
existing.messagePreview = approval.messagePreview;
|
|
1684
1686
|
}
|
|
1685
1687
|
runtime.log?.(`[tlon] Updated existing approval for ${approval.requestingShip} (${approval.type}) - re-sending notification`);
|
|
1686
|
-
await savePendingApprovals();
|
|
1688
|
+
await savePendingApprovals(true);
|
|
1687
1689
|
await sendOwnerNotification(formatApprovalRequest(existing));
|
|
1688
1690
|
return;
|
|
1689
1691
|
}
|
|
1690
1692
|
setPendingApprovals([...approvals, approval]);
|
|
1691
|
-
await savePendingApprovals();
|
|
1693
|
+
await savePendingApprovals(true);
|
|
1692
1694
|
await sendOwnerNotification(formatApprovalRequest(approval));
|
|
1693
1695
|
runtime.log?.(`[tlon] Queued approval request: ${approval.id} (${approval.type} from ${approval.requestingShip})`);
|
|
1694
1696
|
};
|
|
@@ -2662,20 +2664,27 @@ async function monitorTlonProvider(opts = {}) {
|
|
|
2662
2664
|
const accountUrl = account.url;
|
|
2663
2665
|
const accountCode = account.code;
|
|
2664
2666
|
async function authenticateWithRetry(maxAttempts = 10) {
|
|
2665
|
-
|
|
2667
|
+
let authAttempt = 0;
|
|
2668
|
+
return await retryAsync(async () => {
|
|
2669
|
+
authAttempt += 1;
|
|
2666
2670
|
if (opts.abortSignal?.aborted) throw new Error("Aborted while waiting to authenticate");
|
|
2667
2671
|
try {
|
|
2668
2672
|
runtime.log?.(`[tlon] Attempting authentication to ${accountUrl}...`);
|
|
2669
2673
|
return await authenticate(accountUrl, accountCode, { ssrfPolicy });
|
|
2670
2674
|
} catch (error) {
|
|
2671
|
-
runtime.error?.(`[tlon] Failed to authenticate (attempt ${
|
|
2672
|
-
|
|
2673
|
-
const delay = Math.min(3e4, 1e3 * 2 ** (attempt - 1));
|
|
2674
|
-
runtime.log?.(`[tlon] Retrying authentication in ${delay}ms...`);
|
|
2675
|
-
await sleepWithAbort(delay, opts.abortSignal);
|
|
2675
|
+
runtime.error?.(`[tlon] Failed to authenticate (attempt ${authAttempt}): ${formatErrorMessage(error)}`);
|
|
2676
|
+
throw error;
|
|
2676
2677
|
}
|
|
2677
|
-
}
|
|
2678
|
-
|
|
2678
|
+
}, {
|
|
2679
|
+
attempts: Math.max(1, maxAttempts),
|
|
2680
|
+
minDelayMs: 0,
|
|
2681
|
+
shouldRetry: () => !opts.abortSignal?.aborted,
|
|
2682
|
+
delayMs: ({ attempt }) => Math.min(3e4, 1e3 * 2 ** (attempt - 1)),
|
|
2683
|
+
onRetry: ({ delayMs }) => {
|
|
2684
|
+
runtime.log?.(`[tlon] Retrying authentication in ${delayMs}ms...`);
|
|
2685
|
+
},
|
|
2686
|
+
sleep: (delayMs) => sleepWithAbort(delayMs, opts.abortSignal)
|
|
2687
|
+
});
|
|
2679
2688
|
}
|
|
2680
2689
|
let api = null;
|
|
2681
2690
|
const cookie = await authenticateWithRetry();
|
|
@@ -2954,7 +2963,6 @@ async function monitorTlonProvider(opts = {}) {
|
|
|
2954
2963
|
}
|
|
2955
2964
|
});
|
|
2956
2965
|
const dispatchStartTime = Date.now();
|
|
2957
|
-
const responsePrefix = core.channel.reply.resolveEffectiveMessagesConfig(cfg, route.agentId).responsePrefix;
|
|
2958
2966
|
const humanDelay = resolveHumanDelayConfig(cfg, route.agentId);
|
|
2959
2967
|
const deliveryTarget = isGroup ? groupChannel : senderShip;
|
|
2960
2968
|
const prepareReplyPayload = (payload) => {
|
|
@@ -2988,6 +2996,7 @@ async function monitorTlonProvider(opts = {}) {
|
|
|
2988
2996
|
sessionKey: route.sessionKey
|
|
2989
2997
|
},
|
|
2990
2998
|
ctxPayload,
|
|
2999
|
+
replyPipeline: {},
|
|
2991
3000
|
delivery: {
|
|
2992
3001
|
preparePayload: prepareReplyPayload,
|
|
2993
3002
|
durable: deliveryTarget ? () => ({
|
|
@@ -3030,10 +3039,7 @@ async function monitorTlonProvider(opts = {}) {
|
|
|
3030
3039
|
runtime.error?.(`[tlon] ${info.kind} reply failed after ${dispatchDuration}ms: ${String(err)}`);
|
|
3031
3040
|
}
|
|
3032
3041
|
},
|
|
3033
|
-
dispatcherOptions: {
|
|
3034
|
-
responsePrefix,
|
|
3035
|
-
humanDelay
|
|
3036
|
-
},
|
|
3042
|
+
dispatcherOptions: { humanDelay },
|
|
3037
3043
|
...turnAdoptionLifecycle || promptMedia.media.length > 0 ? { replyOptions } : {},
|
|
3038
3044
|
record: { onRecordError: (err) => {
|
|
3039
3045
|
runtime.error?.(`[tlon] failed updating session meta: ${String(err)}`);
|
|
@@ -3241,7 +3247,9 @@ async function monitorTlonProvider(opts = {}) {
|
|
|
3241
3247
|
const ships = processedDmInvites.beginSnapshot(event.map((invite) => normalizeShip(invite.ship || "")).filter(Boolean));
|
|
3242
3248
|
for (const ship of ships) {
|
|
3243
3249
|
if (processedDmInvites.has(ship)) continue;
|
|
3244
|
-
|
|
3250
|
+
const ownerInvite = isOwner(ship);
|
|
3251
|
+
const allowed = ownerInvite || await isDmAllowedWithIngress(ship, effectiveDmAllowlist);
|
|
3252
|
+
if (ownerInvite || effectiveAutoAcceptDmInvites && allowed) {
|
|
3245
3253
|
try {
|
|
3246
3254
|
await api.poke({
|
|
3247
3255
|
app: "chat",
|
|
@@ -3252,27 +3260,10 @@ async function monitorTlonProvider(opts = {}) {
|
|
|
3252
3260
|
}
|
|
3253
3261
|
});
|
|
3254
3262
|
processedDmInvites.add(ship);
|
|
3255
|
-
runtime.log?.(`[tlon] Auto-accepted DM invite from owner ${ship}`);
|
|
3263
|
+
runtime.log?.(ownerInvite ? `[tlon] Auto-accepted DM invite from owner ${ship}` : `[tlon] Auto-accepted DM invite from ${ship}`);
|
|
3256
3264
|
} catch (err) {
|
|
3257
|
-
runtime.error?.(`[tlon] Failed to auto-accept DM from owner: ${String(err)}`);
|
|
3258
|
-
|
|
3259
|
-
continue;
|
|
3260
|
-
}
|
|
3261
|
-
const allowed = await isDmAllowedWithIngress(ship, effectiveDmAllowlist);
|
|
3262
|
-
if (effectiveAutoAcceptDmInvites && allowed) {
|
|
3263
|
-
try {
|
|
3264
|
-
await api.poke({
|
|
3265
|
-
app: "chat",
|
|
3266
|
-
mark: "chat-dm-rsvp",
|
|
3267
|
-
json: {
|
|
3268
|
-
ship,
|
|
3269
|
-
ok: true
|
|
3270
|
-
}
|
|
3271
|
-
});
|
|
3272
|
-
processedDmInvites.add(ship);
|
|
3273
|
-
runtime.log?.(`[tlon] Auto-accepted DM invite from ${ship}`);
|
|
3274
|
-
} catch (err) {
|
|
3275
|
-
runtime.error?.(`[tlon] Failed to auto-accept DM from ${ship}: ${String(err)}`);
|
|
3265
|
+
runtime.error?.(ownerInvite ? `[tlon] Failed to auto-accept DM from owner: ${String(err)}` : `[tlon] Failed to auto-accept DM from ${ship}: ${String(err)}`);
|
|
3266
|
+
throw err;
|
|
3276
3267
|
}
|
|
3277
3268
|
continue;
|
|
3278
3269
|
}
|
|
@@ -3495,74 +3486,41 @@ async function monitorTlonProvider(opts = {}) {
|
|
|
3495
3486
|
await api.subscribe({
|
|
3496
3487
|
app: "groups",
|
|
3497
3488
|
path: "/groups/ui",
|
|
3498
|
-
event: (event) => {
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
runtime.log?.(`[tlon] Auto-detected new channel (invite accepted): ${channelNest}`);
|
|
3509
|
-
if (effectiveAutoAcceptGroupInvites) try {
|
|
3510
|
-
const currentChannels = currentSettings.groupChannels || [];
|
|
3511
|
-
if (!currentChannels.includes(channelNest)) {
|
|
3512
|
-
const updatedChannels = [...currentChannels, channelNest];
|
|
3513
|
-
await api.poke({
|
|
3514
|
-
app: "settings",
|
|
3515
|
-
mark: "settings-event",
|
|
3516
|
-
json: { "put-entry": {
|
|
3517
|
-
"bucket-key": "tlon",
|
|
3518
|
-
"entry-key": "groupChannels",
|
|
3519
|
-
value: updatedChannels,
|
|
3520
|
-
desk: "moltbot"
|
|
3521
|
-
} }
|
|
3522
|
-
});
|
|
3523
|
-
runtime.log?.(`[tlon] Persisted ${channelNest} to settings store`);
|
|
3524
|
-
}
|
|
3525
|
-
} catch (err) {
|
|
3526
|
-
runtime.error?.(`[tlon] Failed to persist channel to settings: ${String(err)}`);
|
|
3527
|
-
}
|
|
3528
|
-
}
|
|
3529
|
-
}
|
|
3530
|
-
const join = asNullableRecord(eventRecord.join);
|
|
3531
|
-
if (join) {
|
|
3532
|
-
const joinChannels = Array.isArray(join.channels) ? join.channels : [];
|
|
3533
|
-
if (joinChannels.length > 0) for (const channelNest of joinChannels) {
|
|
3534
|
-
if (typeof channelNest !== "string") continue;
|
|
3535
|
-
if (!channelNest.startsWith("chat/")) continue;
|
|
3536
|
-
if (!watchedChannels.has(channelNest)) {
|
|
3537
|
-
watchedChannels.add(channelNest);
|
|
3538
|
-
runtime.log?.(`[tlon] Auto-detected joined channel: ${channelNest}`);
|
|
3539
|
-
if (effectiveAutoAcceptGroupInvites) try {
|
|
3540
|
-
const currentChannels = currentSettings.groupChannels || [];
|
|
3541
|
-
if (!currentChannels.includes(channelNest)) {
|
|
3542
|
-
const updatedChannels = [...currentChannels, channelNest];
|
|
3543
|
-
await api.poke({
|
|
3544
|
-
app: "settings",
|
|
3545
|
-
mark: "settings-event",
|
|
3546
|
-
json: { "put-entry": {
|
|
3547
|
-
"bucket-key": "tlon",
|
|
3548
|
-
"entry-key": "groupChannels",
|
|
3549
|
-
value: updatedChannels,
|
|
3550
|
-
desk: "moltbot"
|
|
3551
|
-
} }
|
|
3552
|
-
});
|
|
3553
|
-
runtime.log?.(`[tlon] Persisted ${channelNest} to settings store`);
|
|
3554
|
-
}
|
|
3555
|
-
} catch (err) {
|
|
3556
|
-
runtime.error?.(`[tlon] Failed to persist channel to settings: ${String(err)}`);
|
|
3557
|
-
}
|
|
3558
|
-
}
|
|
3559
|
-
}
|
|
3560
|
-
}
|
|
3561
|
-
}
|
|
3562
|
-
} catch (error) {
|
|
3563
|
-
runtime.error?.(`[tlon] Error handling groups-ui event: ${formatErrorMessage(error)}`);
|
|
3489
|
+
event: async (event) => {
|
|
3490
|
+
try {
|
|
3491
|
+
const eventRecord = asNullableRecord(event);
|
|
3492
|
+
if (!eventRecord) return;
|
|
3493
|
+
const join = asNullableRecord(eventRecord.join);
|
|
3494
|
+
const joinedChannels = Array.isArray(join?.channels) ? join.channels : [];
|
|
3495
|
+
const discoveredChannels = mergeUniqueStrings(Object.keys(asNullableRecord(eventRecord.channels) ?? {}), joinedChannels.filter((channel) => typeof channel === "string")).filter((channel) => channel.startsWith("chat/"));
|
|
3496
|
+
for (const channelNest of discoveredChannels) if (!watchedChannels.has(channelNest)) {
|
|
3497
|
+
watchedChannels.add(channelNest);
|
|
3498
|
+
runtime.log?.(`[tlon] Auto-detected new channel: ${channelNest}`);
|
|
3564
3499
|
}
|
|
3565
|
-
|
|
3500
|
+
if (!effectiveAutoAcceptGroupInvites) return;
|
|
3501
|
+
const currentChannels = currentSettings.groupChannels ?? [];
|
|
3502
|
+
const unpersistedChannels = discoveredChannels.filter((channel) => !currentChannels.includes(channel));
|
|
3503
|
+
if (unpersistedChannels.length === 0) return;
|
|
3504
|
+
const updatedChannels = mergeUniqueStrings(currentChannels, unpersistedChannels);
|
|
3505
|
+
await api.poke({
|
|
3506
|
+
app: "settings",
|
|
3507
|
+
mark: "settings-event",
|
|
3508
|
+
json: { "put-entry": {
|
|
3509
|
+
"bucket-key": "tlon",
|
|
3510
|
+
"entry-key": "groupChannels",
|
|
3511
|
+
value: updatedChannels,
|
|
3512
|
+
desk: "moltbot"
|
|
3513
|
+
} }
|
|
3514
|
+
});
|
|
3515
|
+
currentSettings = {
|
|
3516
|
+
...currentSettings,
|
|
3517
|
+
groupChannels: updatedChannels
|
|
3518
|
+
};
|
|
3519
|
+
runtime.log?.(`[tlon] Persisted ${unpersistedChannels.join(", ")} to settings store`);
|
|
3520
|
+
} catch (error) {
|
|
3521
|
+
runtime.error?.(`[tlon] Error handling groups-ui event: ${formatErrorMessage(error)}`);
|
|
3522
|
+
throw error;
|
|
3523
|
+
}
|
|
3566
3524
|
},
|
|
3567
3525
|
err: (error) => {
|
|
3568
3526
|
runtime.error?.(`[tlon] Groups-ui subscription error: ${String(error)}`);
|
|
@@ -3577,15 +3535,17 @@ async function monitorTlonProvider(opts = {}) {
|
|
|
3577
3535
|
}
|
|
3578
3536
|
{
|
|
3579
3537
|
const processedGroupInvites = /* @__PURE__ */ new Set();
|
|
3580
|
-
const processPendingInvites = async (foreigns) => {
|
|
3538
|
+
const processPendingInvites = async (foreigns, propagateWriteFailures = false) => {
|
|
3581
3539
|
if (!foreigns || typeof foreigns !== "object") return;
|
|
3540
|
+
let firstWriteError;
|
|
3582
3541
|
for (const [groupFlag, foreign] of Object.entries(foreigns)) {
|
|
3583
3542
|
if (processedGroupInvites.has(groupFlag)) continue;
|
|
3584
3543
|
if (!foreign.invites || foreign.invites.length === 0) continue;
|
|
3585
3544
|
const validInvite = foreign.invites.find((inv) => inv.valid);
|
|
3586
3545
|
if (!validInvite) continue;
|
|
3587
3546
|
const inviterShip = validInvite.from;
|
|
3588
|
-
|
|
3547
|
+
const ownerInvite = isOwner(inviterShip);
|
|
3548
|
+
if (ownerInvite || effectiveAutoAcceptGroupInvites && isGroupInviteAllowed(inviterShip, effectiveGroupInviteAllowlist)) {
|
|
3589
3549
|
try {
|
|
3590
3550
|
await api.poke({
|
|
3591
3551
|
app: "groups",
|
|
@@ -3596,68 +3556,46 @@ async function monitorTlonProvider(opts = {}) {
|
|
|
3596
3556
|
}
|
|
3597
3557
|
});
|
|
3598
3558
|
processedGroupInvites.add(groupFlag);
|
|
3599
|
-
runtime.log?.(`[tlon] Auto-accepted group invite from owner: ${groupFlag}`);
|
|
3559
|
+
runtime.log?.(ownerInvite ? `[tlon] Auto-accepted group invite from owner: ${groupFlag}` : `[tlon] Auto-accepted group invite: ${groupFlag} (from ${inviterShip})`);
|
|
3600
3560
|
} catch (err) {
|
|
3601
|
-
runtime.error?.(`[tlon] Failed to accept group invite from owner: ${String(err)}`);
|
|
3602
|
-
|
|
3603
|
-
continue;
|
|
3604
|
-
}
|
|
3605
|
-
if (!effectiveAutoAcceptGroupInvites) {
|
|
3606
|
-
if (effectiveOwnerShip) {
|
|
3607
|
-
const approval = createPendingApproval({
|
|
3608
|
-
type: "group",
|
|
3609
|
-
requestingShip: inviterShip,
|
|
3610
|
-
groupFlag
|
|
3611
|
-
});
|
|
3612
|
-
await queueApprovalRequest(approval);
|
|
3613
|
-
processedGroupInvites.add(groupFlag);
|
|
3561
|
+
runtime.error?.(ownerInvite ? `[tlon] Failed to accept group invite from owner: ${String(err)}` : `[tlon] Failed to auto-accept group ${groupFlag}: ${String(err)}`);
|
|
3562
|
+
if (propagateWriteFailures && firstWriteError === void 0) firstWriteError = err instanceof Error ? err : new Error(formatErrorMessage(err));
|
|
3614
3563
|
}
|
|
3615
3564
|
continue;
|
|
3616
3565
|
}
|
|
3617
|
-
if (
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
processedGroupInvites.add(groupFlag);
|
|
3626
|
-
} else {
|
|
3627
|
-
runtime.log?.(`[tlon] Rejected group invite from ${inviterShip} (not in groupInviteAllowlist): ${groupFlag}`);
|
|
3628
|
-
processedGroupInvites.add(groupFlag);
|
|
3629
|
-
}
|
|
3566
|
+
if (effectiveOwnerShip) {
|
|
3567
|
+
const approval = createPendingApproval({
|
|
3568
|
+
type: "group",
|
|
3569
|
+
requestingShip: inviterShip,
|
|
3570
|
+
groupFlag
|
|
3571
|
+
});
|
|
3572
|
+
await queueApprovalRequest(approval);
|
|
3573
|
+
processedGroupInvites.add(groupFlag);
|
|
3630
3574
|
continue;
|
|
3631
3575
|
}
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
app: "groups",
|
|
3635
|
-
mark: "group-join",
|
|
3636
|
-
json: {
|
|
3637
|
-
flag: groupFlag,
|
|
3638
|
-
"join-all": true
|
|
3639
|
-
}
|
|
3640
|
-
});
|
|
3576
|
+
if (effectiveAutoAcceptGroupInvites) {
|
|
3577
|
+
runtime.log?.(`[tlon] Rejected group invite from ${inviterShip} (not in groupInviteAllowlist): ${groupFlag}`);
|
|
3641
3578
|
processedGroupInvites.add(groupFlag);
|
|
3642
|
-
runtime.log?.(`[tlon] Auto-accepted group invite: ${groupFlag} (from ${validInvite.from})`);
|
|
3643
|
-
} catch (err) {
|
|
3644
|
-
runtime.error?.(`[tlon] Failed to auto-accept group ${groupFlag}: ${String(err)}`);
|
|
3645
3579
|
}
|
|
3646
3580
|
}
|
|
3581
|
+
if (firstWriteError !== void 0) throw firstWriteError;
|
|
3647
3582
|
};
|
|
3648
|
-
if (initForeigns)
|
|
3583
|
+
if (initForeigns) try {
|
|
3584
|
+
await processPendingInvites(initForeigns);
|
|
3585
|
+
} catch (error) {
|
|
3586
|
+
runtime.error?.(`[tlon] Error handling initial foreigns: ${formatErrorMessage(error)}`);
|
|
3587
|
+
}
|
|
3649
3588
|
try {
|
|
3650
3589
|
await api.subscribe({
|
|
3651
3590
|
app: "groups",
|
|
3652
3591
|
path: "/v1/foreigns",
|
|
3653
|
-
event: (data) => {
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
})();
|
|
3592
|
+
event: async (data) => {
|
|
3593
|
+
try {
|
|
3594
|
+
await processPendingInvites(data, true);
|
|
3595
|
+
} catch (error) {
|
|
3596
|
+
runtime.error?.(`[tlon] Error handling foreigns event: ${formatErrorMessage(error)}`);
|
|
3597
|
+
throw error;
|
|
3598
|
+
}
|
|
3661
3599
|
},
|
|
3662
3600
|
err: (error) => {
|
|
3663
3601
|
runtime.error?.(`[tlon] Foreigns subscription error: ${String(error)}`);
|
package/openclaw.plugin.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/tlon",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.9.1-beta.1",
|
|
4
4
|
"description": "OpenClaw Tlon/Urbit channel plugin for chat workflows.",
|
|
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.
|
|
11
|
+
"@aws-sdk/client-s3": "3.1113.0",
|
|
12
|
+
"@aws-sdk/s3-request-presigner": "3.1113.0",
|
|
13
|
+
"@tloncorp/tlon-skill": "0.5.0",
|
|
14
14
|
"@urbit/aura": "3.0.0",
|
|
15
15
|
"zod": "4.4.3"
|
|
16
16
|
},
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"openclaw": "workspace:*"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
|
-
"openclaw": ">=2026.
|
|
22
|
+
"openclaw": ">=2026.9.1-beta.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-beta.1"
|
|
124
124
|
},
|
|
125
125
|
"build": {
|
|
126
|
-
"openclawVersion": "2026.
|
|
126
|
+
"openclawVersion": "2026.9.1-beta.1"
|
|
127
127
|
},
|
|
128
128
|
"release": {
|
|
129
129
|
"bundleRuntimeDependencies": false,
|