Skip to content

Tlon(插件)

Tlon 是基于 Urbit 构建的去中心化消息应用。OpenClaw 连接到你的 Urbit ship,可以响应私信和群组聊天消息。群组回复默认需要 @ 提及,还可以通过白名单进一步限制访问。

状态:通过插件支持。支持私信、群组提及、帖子回复、富文本格式和图片上传。暂不支持反应和投票。

需要安装插件

Tlon 以插件形式发布,不包含在核心安装包中。

通过 CLI 安装(npm 仓库):

bash
openclaw plugins install @openclaw/tlon

本地 checkout(从 git 仓库运行时):

bash
openclaw plugins install ./extensions/tlon

详情:插件系统

配置步骤

  1. 安装 Tlon 插件。
  2. 准备你的 ship URL 和登录码。
  3. 配置 channels.tlon
  4. 重启 Gateway。
  5. 给机器人发私信,或在群组频道中提及它——你的龙虾就活了!

最小配置(单账号):

json5
{
  channels: {
    tlon: {
      enabled: true,
      ship: "~sampel-palnet",
      url: "https://your-ship-host",
      code: "lidlut-tabwed-pillex-ridrup",
      ownerShip: "~your-main-ship", // 推荐:你的 ship,始终允许
    },
  },
}

私有/局域网 Ship

默认情况下,OpenClaw 会阻止私有/内网主机名和 IP 段(SSRF 防护)。如果你的 ship 运行在私有网络(localhost、局域网 IP 或内部主机名),必须显式开启:

json5
{
  channels: {
    tlon: {
      url: "http://localhost:8080",
      allowPrivateNetwork: true,
    },
  },
}

适用于以下 URL:

  • http://localhost:8080
  • http://192.168.x.x:8080
  • http://my-ship.local:8080

警告: 仅在信任本地网络的情况下启用。此设置会禁用对 ship URL 的 SSRF 防护。

群组频道

默认启用自动发现。也可以手动指定频道:

json5
{
  channels: {
    tlon: {
      groupChannels: ["chat/~host-ship/general", "chat/~host-ship/support"],
    },
  },
}

禁用自动发现:

json5
{
  channels: {
    tlon: {
      autoDiscoverChannels: false,
    },
  },
}

访问控制

私信白名单(空列表 = 不允许私信,使用 ownerShip 走审批流程):

json5
{
  channels: {
    tlon: {
      dmAllowlist: ["~zod", "~nec"],
    },
  },
}

群组授权(默认限制访问):

json5
{
  channels: {
    tlon: {
      defaultAuthorizedShips: ["~zod"],
      authorization: {
        channelRules: {
          "chat/~host-ship/general": {
            mode: "restricted",
            allowedShips: ["~zod", "~nec"],
          },
          "chat/~host-ship/announcements": {
            mode: "open",
          },
        },
      },
    },
  },
}

Owner 与审批系统

设置 owner ship,当未授权用户尝试交互时接收审批请求:

json5
{
  channels: {
    tlon: {
      ownerShip: "~your-main-ship",
    },
  },
}

Owner ship 在任何地方自动获得授权——私信邀请自动接受,频道消息始终允许。无需将 owner 添加到 dmAllowlistdefaultAuthorizedShips

设置后,owner 会收到以下场景的私信通知:

  • 不在白名单中的 ship 发起私信请求
  • 在无授权的频道中被提及
  • 群组邀请请求

自动接受设置

自动接受白名单中 ship 的私信邀请:

json5
{
  channels: {
    tlon: {
      autoAcceptDmInvites: true,
    },
  },
}

自动接受群组邀请:

json5
{
  channels: {
    tlon: {
      autoAcceptGroupInvites: true,
    },
  },
}

投递目标(CLI/定时任务)

配合 openclaw message send 或定时任务投递使用:

  • 私信:~sampel-palnetdm/~sampel-palnet
  • 群组:chat/~host-ship/channelgroup:~host-ship/channel

内置技能

Tlon 插件包含一个内置技能(@tloncorp/tlon-skill),提供 Tlon 操作的 CLI 访问:

  • 联系人:获取/更新档案、列出联系人
  • 频道:列出、创建、发布消息、获取历史记录
  • 群组:列出、创建、管理成员
  • 私信:发送消息、对消息做反应
  • 反应:添加/移除帖子和私信的表情反应
  • 设置:通过斜杠命令管理插件权限

安装插件后技能自动可用。

功能支持情况

功能状态
私信支持
群组/频道支持(默认需要提及)
帖子回复支持(自动在帖子内回复)
富文本支持(Markdown 转换为 Tlon 格式)
图片支持(上传到 Tlon 存储)
反应通过内置技能支持
投票暂不支持
原生命令支持(默认仅 Owner 可用)

故障排查

先跑一遍诊断梯子:

bash
openclaw status
openclaw gateway status
openclaw logs --follow
openclaw doctor

常见问题:

  • 私信被忽略:发送方不在 dmAllowlist 中,且未配置 ownerShip 走审批流程。
  • 群组消息被忽略:频道未被发现,或发送方未授权。
  • 连接错误:检查 ship URL 是否可访问;本地 ship 需要启用 allowPrivateNetwork
  • 认证错误:验证登录码是否最新(登录码会轮换)。

配置参考

完整配置文档:Gateway 配置

主要配置项:

  • channels.tlon.enabled:启用/禁用渠道。
  • channels.tlon.ship:机器人 Urbit ship 名称(如 ~sampel-palnet)。
  • channels.tlon.url:ship URL(如 https://sampel-palnet.tlon.network)。
  • channels.tlon.code:ship 登录码。
  • channels.tlon.allowPrivateNetwork:允许 localhost/局域网 URL(绕过 SSRF)。
  • channels.tlon.ownerShip:审批系统的 owner ship(始终授权)。
  • channels.tlon.dmAllowlist:允许私信的 ship 列表(空 = 无)。
  • channels.tlon.autoAcceptDmInvites:自动接受白名单 ship 的私信邀请。
  • channels.tlon.autoAcceptGroupInvites:自动接受所有群组邀请。
  • channels.tlon.autoDiscoverChannels:自动发现群组频道(默认:true)。
  • channels.tlon.groupChannels:手动指定的频道 nest 列表。
  • channels.tlon.defaultAuthorizedShips:对所有频道授权的 ship 列表。
  • channels.tlon.authorization.channelRules:每频道授权规则。
  • channels.tlon.showModelSignature:在消息末尾附加模型名称。

注意事项

  • 群组回复需要提及(如 ~your-bot-ship)才会响应。
  • 帖子回复:如果入站消息在帖子中,OpenClaw 会在帖子内回复。
  • 富文本:Markdown 格式(粗体、斜体、代码、标题、列表)会转换为 Tlon 原生格式。
  • 图片:URL 会上传到 Tlon 存储并以图片块嵌入。