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-ibkr-agent

v0.1.3

Published

对接 ibkr 分析服务的 Koishi 薄适配层。

Readme

koishi-plugin-aka-ibkr-agent

对接 ibkr 分析服务的 Koishi 薄适配层。

这个插件只做三件事:

  • 把 Koishi 命令或聊天消息转成 ibkr/api/v1/analyze 请求
  • ibkr 返回的文本直接发回会话
  • ibkr 迭代过程中提供一个低成本 smoke 检查

当前边界

  • 依赖 ibkr 当前的 GET /healthPOST /api/v1/analyze
  • 默认按只读分析使用
  • 不在 Koishi 侧重复实现意图识别和交易逻辑
  • 仅在上游真正产出确认字段后,再考虑确认执行流

配置

  • baseUrl: ibkr 服务基础地址,默认 http://127.0.0.1:8000
  • timeout: HTTP 超时,默认 30000
  • authToken: 可选 Bearer Token
  • defaultResponseMode: 命令默认输出模式
  • showDiagnostics: 是否附加上游来源和错误信息
  • minAuthority: 最小 authority,默认 4
  • allowedUsers: 额外允许的用户列表,支持 userIdplatform:userId
  • chatCommandName: 主聊天命令名,默认 ib
  • commandAliases: 兼容命令别名,默认包含 ibchatibkr
  • enableMiddleware: 是否启用聊天式转发
  • middlewarePrefixes: 聊天入口前缀,默认 ib ibkr
  • middlewareResponseMode: 聊天入口输出模式
  • allowDirectChat: 私聊允许不带前缀直接转发
  • ignoreSelf: 忽略机器人自身消息
  • privateOnly: 仅在私聊触发聊天转发
  • platforms: 平台白名单,为空表示不限
  • channelWhitelist: 频道白名单,格式 platform:channelId

命令

ib <message>
ib.health

默认还兼容:

ibchat <message>
ibchat.health
ibkr <message>
ibkr.health

可选参数:

  • -m <mode>: brief / full / push
  • -f: 强制 full
  • -p: 强制 push
  • -e: 允许上游尝试进入执行分支
  • -d: 本次附加诊断信息

权限

默认只允许 authority 不低于 4 的用户调用。

如果你希望授权固定用户,可以配置:

aka-ibkr-agent:xxxxxx:
  minAuthority: 4
  allowedUsers:
    - "onebot:123456789"
    - "987654321"

权限判断规则:

  • 命中 allowedUsers 则允许调用
  • 否则要求 session.user.authority >= minAuthority
  • 命令入口和 middleware 都使用同一套权限逻辑

联调

pnpm typecheck
pnpm build
pnpm run smoke

可选环境变量:

IBKR_AGENT_BASE_URL=http://127.0.0.1:8000
IBKR_AGENT_AUTH_TOKEN=
IBKR_AGENT_TIMEOUT=30000
IBKR_AGENT_MESSAGE=帮我看看今晚持仓风险

smoke 会检查:

  • /health 是否可用
  • /api/v1/analyze 是否仍返回关键字段

这样在 ibkr 迭代时,可以第一时间发现接口漂移。