@openclaw/tlon 2026.8.1-beta.3 → 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-CoKm1n5s.js";
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-BShnsKnQ.js"));
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-CoKm1n5s.js";
1
+ import { t as tlonPlugin } from "./channel-BhqDxdrd.js";
2
2
  export { tlonPlugin };
@@ -1532,7 +1532,7 @@ function formatPendingList(approvals) {
1532
1532
  //#region extensions/tlon/src/monitor/approval-runtime.ts
1533
1533
  function createTlonApprovalRuntime(params) {
1534
1534
  const { api, runtime, botShipName, getPendingApprovals, setPendingApprovals, getCurrentSettings, setCurrentSettings, getEffectiveDmAllowlist, setEffectiveDmAllowlist, getEffectiveOwnerShip, processApprovedMessage, refreshWatchedChannels } = params;
1535
- const savePendingApprovals = async () => {
1535
+ const savePendingApprovals = async (required = false) => {
1536
1536
  try {
1537
1537
  await api.poke({
1538
1538
  app: "settings",
@@ -1546,6 +1546,7 @@ function createTlonApprovalRuntime(params) {
1546
1546
  });
1547
1547
  } catch (err) {
1548
1548
  runtime.error?.(`[tlon] Failed to save pending approvals: ${String(err)}`);
1549
+ if (required) throw err;
1549
1550
  }
1550
1551
  };
1551
1552
  const addToDmAllowlist = async (ship) => {
@@ -1684,12 +1685,12 @@ function createTlonApprovalRuntime(params) {
1684
1685
  existing.messagePreview = approval.messagePreview;
1685
1686
  }
1686
1687
  runtime.log?.(`[tlon] Updated existing approval for ${approval.requestingShip} (${approval.type}) - re-sending notification`);
1687
- await savePendingApprovals();
1688
+ await savePendingApprovals(true);
1688
1689
  await sendOwnerNotification(formatApprovalRequest(existing));
1689
1690
  return;
1690
1691
  }
1691
1692
  setPendingApprovals([...approvals, approval]);
1692
- await savePendingApprovals();
1693
+ await savePendingApprovals(true);
1693
1694
  await sendOwnerNotification(formatApprovalRequest(approval));
1694
1695
  runtime.log?.(`[tlon] Queued approval request: ${approval.id} (${approval.type} from ${approval.requestingShip})`);
1695
1696
  };
@@ -2962,7 +2963,6 @@ async function monitorTlonProvider(opts = {}) {
2962
2963
  }
2963
2964
  });
2964
2965
  const dispatchStartTime = Date.now();
2965
- const responsePrefix = core.channel.reply.resolveEffectiveMessagesConfig(cfg, route.agentId).responsePrefix;
2966
2966
  const humanDelay = resolveHumanDelayConfig(cfg, route.agentId);
2967
2967
  const deliveryTarget = isGroup ? groupChannel : senderShip;
2968
2968
  const prepareReplyPayload = (payload) => {
@@ -2996,6 +2996,7 @@ async function monitorTlonProvider(opts = {}) {
2996
2996
  sessionKey: route.sessionKey
2997
2997
  },
2998
2998
  ctxPayload,
2999
+ replyPipeline: {},
2999
3000
  delivery: {
3000
3001
  preparePayload: prepareReplyPayload,
3001
3002
  durable: deliveryTarget ? () => ({
@@ -3038,10 +3039,7 @@ async function monitorTlonProvider(opts = {}) {
3038
3039
  runtime.error?.(`[tlon] ${info.kind} reply failed after ${dispatchDuration}ms: ${String(err)}`);
3039
3040
  }
3040
3041
  },
3041
- dispatcherOptions: {
3042
- responsePrefix,
3043
- humanDelay
3044
- },
3042
+ dispatcherOptions: { humanDelay },
3045
3043
  ...turnAdoptionLifecycle || promptMedia.media.length > 0 ? { replyOptions } : {},
3046
3044
  record: { onRecordError: (err) => {
3047
3045
  runtime.error?.(`[tlon] failed updating session meta: ${String(err)}`);
@@ -3249,7 +3247,9 @@ async function monitorTlonProvider(opts = {}) {
3249
3247
  const ships = processedDmInvites.beginSnapshot(event.map((invite) => normalizeShip(invite.ship || "")).filter(Boolean));
3250
3248
  for (const ship of ships) {
3251
3249
  if (processedDmInvites.has(ship)) continue;
3252
- if (isOwner(ship)) {
3250
+ const ownerInvite = isOwner(ship);
3251
+ const allowed = ownerInvite || await isDmAllowedWithIngress(ship, effectiveDmAllowlist);
3252
+ if (ownerInvite || effectiveAutoAcceptDmInvites && allowed) {
3253
3253
  try {
3254
3254
  await api.poke({
3255
3255
  app: "chat",
@@ -3260,27 +3260,10 @@ async function monitorTlonProvider(opts = {}) {
3260
3260
  }
3261
3261
  });
3262
3262
  processedDmInvites.add(ship);
3263
- 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}`);
3264
3264
  } catch (err) {
3265
- runtime.error?.(`[tlon] Failed to auto-accept DM from owner: ${String(err)}`);
3266
- }
3267
- continue;
3268
- }
3269
- const allowed = await isDmAllowedWithIngress(ship, effectiveDmAllowlist);
3270
- if (effectiveAutoAcceptDmInvites && allowed) {
3271
- try {
3272
- await api.poke({
3273
- app: "chat",
3274
- mark: "chat-dm-rsvp",
3275
- json: {
3276
- ship,
3277
- ok: true
3278
- }
3279
- });
3280
- processedDmInvites.add(ship);
3281
- runtime.log?.(`[tlon] Auto-accepted DM invite from ${ship}`);
3282
- } catch (err) {
3283
- 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;
3284
3267
  }
3285
3268
  continue;
3286
3269
  }
@@ -3503,74 +3486,41 @@ async function monitorTlonProvider(opts = {}) {
3503
3486
  await api.subscribe({
3504
3487
  app: "groups",
3505
3488
  path: "/groups/ui",
3506
- event: (event) => {
3507
- (async () => {
3508
- try {
3509
- const eventRecord = asNullableRecord(event);
3510
- if (eventRecord) {
3511
- const channels = asNullableRecord(eventRecord.channels);
3512
- if (channels) for (const [channelNest, _channelData] of Object.entries(channels)) {
3513
- if (!channelNest.startsWith("chat/")) continue;
3514
- if (!watchedChannels.has(channelNest)) {
3515
- watchedChannels.add(channelNest);
3516
- runtime.log?.(`[tlon] Auto-detected new channel (invite accepted): ${channelNest}`);
3517
- if (effectiveAutoAcceptGroupInvites) try {
3518
- const currentChannels = currentSettings.groupChannels || [];
3519
- if (!currentChannels.includes(channelNest)) {
3520
- const updatedChannels = [...currentChannels, channelNest];
3521
- await api.poke({
3522
- app: "settings",
3523
- mark: "settings-event",
3524
- json: { "put-entry": {
3525
- "bucket-key": "tlon",
3526
- "entry-key": "groupChannels",
3527
- value: updatedChannels,
3528
- desk: "moltbot"
3529
- } }
3530
- });
3531
- runtime.log?.(`[tlon] Persisted ${channelNest} to settings store`);
3532
- }
3533
- } catch (err) {
3534
- runtime.error?.(`[tlon] Failed to persist channel to settings: ${String(err)}`);
3535
- }
3536
- }
3537
- }
3538
- const join = asNullableRecord(eventRecord.join);
3539
- if (join) {
3540
- const joinChannels = Array.isArray(join.channels) ? join.channels : [];
3541
- if (joinChannels.length > 0) for (const channelNest of joinChannels) {
3542
- if (typeof channelNest !== "string") continue;
3543
- if (!channelNest.startsWith("chat/")) continue;
3544
- if (!watchedChannels.has(channelNest)) {
3545
- watchedChannels.add(channelNest);
3546
- runtime.log?.(`[tlon] Auto-detected joined channel: ${channelNest}`);
3547
- if (effectiveAutoAcceptGroupInvites) try {
3548
- const currentChannels = currentSettings.groupChannels || [];
3549
- if (!currentChannels.includes(channelNest)) {
3550
- const updatedChannels = [...currentChannels, channelNest];
3551
- await api.poke({
3552
- app: "settings",
3553
- mark: "settings-event",
3554
- json: { "put-entry": {
3555
- "bucket-key": "tlon",
3556
- "entry-key": "groupChannels",
3557
- value: updatedChannels,
3558
- desk: "moltbot"
3559
- } }
3560
- });
3561
- runtime.log?.(`[tlon] Persisted ${channelNest} to settings store`);
3562
- }
3563
- } catch (err) {
3564
- runtime.error?.(`[tlon] Failed to persist channel to settings: ${String(err)}`);
3565
- }
3566
- }
3567
- }
3568
- }
3569
- }
3570
- } catch (error) {
3571
- 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}`);
3572
3499
  }
3573
- })();
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
+ }
3574
3524
  },
3575
3525
  err: (error) => {
3576
3526
  runtime.error?.(`[tlon] Groups-ui subscription error: ${String(error)}`);
@@ -3585,15 +3535,17 @@ async function monitorTlonProvider(opts = {}) {
3585
3535
  }
3586
3536
  {
3587
3537
  const processedGroupInvites = /* @__PURE__ */ new Set();
3588
- const processPendingInvites = async (foreigns) => {
3538
+ const processPendingInvites = async (foreigns, propagateWriteFailures = false) => {
3589
3539
  if (!foreigns || typeof foreigns !== "object") return;
3540
+ let firstWriteError;
3590
3541
  for (const [groupFlag, foreign] of Object.entries(foreigns)) {
3591
3542
  if (processedGroupInvites.has(groupFlag)) continue;
3592
3543
  if (!foreign.invites || foreign.invites.length === 0) continue;
3593
3544
  const validInvite = foreign.invites.find((inv) => inv.valid);
3594
3545
  if (!validInvite) continue;
3595
3546
  const inviterShip = validInvite.from;
3596
- if (isOwner(inviterShip)) {
3547
+ const ownerInvite = isOwner(inviterShip);
3548
+ if (ownerInvite || effectiveAutoAcceptGroupInvites && isGroupInviteAllowed(inviterShip, effectiveGroupInviteAllowlist)) {
3597
3549
  try {
3598
3550
  await api.poke({
3599
3551
  app: "groups",
@@ -3604,68 +3556,46 @@ async function monitorTlonProvider(opts = {}) {
3604
3556
  }
3605
3557
  });
3606
3558
  processedGroupInvites.add(groupFlag);
3607
- 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})`);
3608
3560
  } catch (err) {
3609
- runtime.error?.(`[tlon] Failed to accept group invite from owner: ${String(err)}`);
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));
3610
3563
  }
3611
3564
  continue;
3612
3565
  }
3613
- if (!effectiveAutoAcceptGroupInvites) {
3614
- if (effectiveOwnerShip) {
3615
- const approval = createPendingApproval({
3616
- type: "group",
3617
- requestingShip: inviterShip,
3618
- groupFlag
3619
- });
3620
- await queueApprovalRequest(approval);
3621
- processedGroupInvites.add(groupFlag);
3622
- }
3623
- continue;
3624
- }
3625
- if (!isGroupInviteAllowed(inviterShip, effectiveGroupInviteAllowlist)) {
3626
- if (effectiveOwnerShip) {
3627
- const approval = createPendingApproval({
3628
- type: "group",
3629
- requestingShip: inviterShip,
3630
- groupFlag
3631
- });
3632
- await queueApprovalRequest(approval);
3633
- processedGroupInvites.add(groupFlag);
3634
- } else {
3635
- runtime.log?.(`[tlon] Rejected group invite from ${inviterShip} (not in groupInviteAllowlist): ${groupFlag}`);
3636
- processedGroupInvites.add(groupFlag);
3637
- }
3566
+ if (effectiveOwnerShip) {
3567
+ const approval = createPendingApproval({
3568
+ type: "group",
3569
+ requestingShip: inviterShip,
3570
+ groupFlag
3571
+ });
3572
+ await queueApprovalRequest(approval);
3573
+ processedGroupInvites.add(groupFlag);
3638
3574
  continue;
3639
3575
  }
3640
- try {
3641
- await api.poke({
3642
- app: "groups",
3643
- mark: "group-join",
3644
- json: {
3645
- flag: groupFlag,
3646
- "join-all": true
3647
- }
3648
- });
3576
+ if (effectiveAutoAcceptGroupInvites) {
3577
+ runtime.log?.(`[tlon] Rejected group invite from ${inviterShip} (not in groupInviteAllowlist): ${groupFlag}`);
3649
3578
  processedGroupInvites.add(groupFlag);
3650
- runtime.log?.(`[tlon] Auto-accepted group invite: ${groupFlag} (from ${validInvite.from})`);
3651
- } catch (err) {
3652
- runtime.error?.(`[tlon] Failed to auto-accept group ${groupFlag}: ${String(err)}`);
3653
3579
  }
3654
3580
  }
3581
+ if (firstWriteError !== void 0) throw firstWriteError;
3655
3582
  };
3656
- if (initForeigns) await processPendingInvites(initForeigns);
3583
+ if (initForeigns) try {
3584
+ await processPendingInvites(initForeigns);
3585
+ } catch (error) {
3586
+ runtime.error?.(`[tlon] Error handling initial foreigns: ${formatErrorMessage(error)}`);
3587
+ }
3657
3588
  try {
3658
3589
  await api.subscribe({
3659
3590
  app: "groups",
3660
3591
  path: "/v1/foreigns",
3661
- event: (data) => {
3662
- (async () => {
3663
- try {
3664
- await processPendingInvites(data);
3665
- } catch (error) {
3666
- runtime.error?.(`[tlon] Error handling foreigns event: ${formatErrorMessage(error)}`);
3667
- }
3668
- })();
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
+ }
3669
3599
  },
3670
3600
  err: (error) => {
3671
3601
  runtime.error?.(`[tlon] Foreigns subscription error: ${String(error)}`);
@@ -108,6 +108,11 @@
108
108
  "type": "string",
109
109
  "minLength": 1
110
110
  },
111
+ "historyLimit": {
112
+ "type": "integer",
113
+ "minimum": 0,
114
+ "maximum": 9007199254740991
115
+ },
111
116
  "authorization": {
112
117
  "type": "object",
113
118
  "properties": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/tlon",
3
- "version": "2026.8.1-beta.3",
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.1095.0",
12
- "@aws-sdk/s3-request-presigner": "3.1095.0",
13
- "@tloncorp/tlon-skill": "0.4.5",
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.8.1-beta.3"
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.8.1-beta.3"
123
+ "pluginApi": ">=2026.9.1-beta.1"
124
124
  },
125
125
  "build": {
126
- "openclawVersion": "2026.8.1-beta.3"
126
+ "openclawVersion": "2026.9.1-beta.1"
127
127
  },
128
128
  "release": {
129
129
  "bundleRuntimeDependencies": false,