npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

koishi-plugin-aka-chatluna-lark-message-bridge

v0.0.1

Published

Draft ChatLuna bridge plugin for preserving selected Lark message resources as model-consumable multimodal content.

Readme

koishi-plugin-aka-chatluna-lark-message-bridge

用于 ChatLuna 的附挂式消息资源桥接草案插件,目标是优先拦截入站消息里的受保护资源元素,避免默认读取流程把这些资源落地为本地临时文件并再改写成 127.0.0.1 一类仅本机可访问的 URL。

当前草案主要面向这条链路:

  • aka-adapter-lark 已把飞书图片转成 data:image/...
  • ChatLuna 已经可以读取这张图
  • 但默认 img 转换器后续又把图片改写成 localhost URL

这个插件的第一版策略是:

  • ctx.chatluna.messageTransformer 上对 img / image 注册高优先级拦截
  • 对命中的图片 URL 直接写入 ChatLuna 多模态消息内容: [{ type: 'image_url', image_url: { url } }]
  • 返回已处理,尽量不再走默认图片转换器

Current Status

这是一个源码草案,不是已验证完成的正式修复。它优先尝试在 ChatLuna 的“消息读取层”解决问题。

当前实现仍然只拦截图片元素,但插件命名改成了 message-bridge,因为后续很可能会继续扩到文件等其他消息资源类型。

如果实际运行后发现:

  • 命中了这个插件的拦截逻辑
  • 但最终发往模型前依然被改写成 127.0.0.1

那就说明问题进一步落在 adapter-openai-like 的请求组装层,下一步应优先 fork ChatLuna 的 adapter-openai-like,而不是继续改这个外围插件。

Config

  • preserveDataUrl: 是否保留 data:image/...,默认 true
  • preserveHttpUrl: 是否保留 http:// 图片 URL,默认 false
  • preserveHttpsUrl: 是否保留 https:// 图片 URL,默认 false
  • skipLocalhostLikeUrls: 是否跳过 localhost / 127.0.0.1 / 0.0.0.0 / ::1 这类 URL,默认 true
  • interceptPriority: ChatLuna 消息转换拦截优先级,默认 -100
  • debug: 是否输出命中日志,默认 false

建议你的飞书场景先只开默认配置,也就是只保留 data:image/...

Runtime Assumptions

  • 运行环境中已经安装并启用了 koishi-plugin-chatluna
  • ChatLuna 暴露了 ctx.chatluna.messageTransformer
  • 默认图片元素类型为 img,若运行时还存在 image 类型也会一起拦截
  • ChatLuna 当前多模态消息内容仍接受: { type: 'image_url', image_url: { url } }

Scripts

pnpm build
pnpm typecheck

Publish

pnpm run prepublishOnly
npm publish