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-yesimbot-extension-online-prompt

v1.0.3

Published

YesImBot 在线提示词加载扩展,由AI完成编写,不保证可靠性,可能出现奇怪问题

Readme

koishi-plugin-yesimbot-extension-online-prompt

一个为 YesImBot 设计的 Koishi 插件,用于从在线源动态加载自定义提示词。支持 GitHub Gist、Notion 等多种平台的实时同步。

⚠️ 注意:本插件由 AI 完成编写,不保证可用性。

作者:我是小鸭头

📖 介绍

这是一个为 YesImBot 设计的在线提示词加载扩展插件。它允许你从在线源(如 GitHub Gist、Notion 等)动态加载自定义提示词,实现提示词的实时同步和更新。

✨ 特性

  • 🌐 多源支持: 支持从多个在线源加载提示词
  • 🔄 自动刷新: 可配置的自动刷新间隔
  • 💾 智能缓存: 内置缓存机制,减少网络请求
  • 🔁 重试机制: 网络请求失败时自动重试
  • 优先级控制: 支持设置不同提示词源的优先级
  • 🛡️ 错误处理: 完善的错误处理和日志记录

🚀 安装

  1. 将此插件放置在 YesImBot 项目的 packages 目录下
  2. 在项目根目录运行构建命令:
    npm run build

📝 配置

基本配置

plugins:
  yesimbot-extension-online-prompt:
    urls:
      - name: "my-custom-prompt"
        url: "https://gist.githubusercontent.com/username/gist-id/raw/prompt.txt"
        priority: 10
        enabled: true
        headers:
          Authorization: "token your-github-token"  # 可选
      - name: "notion-prompt"
        url: "https://your-notion-export-url.com/prompt.txt"
        priority: 20
        enabled: true
    refreshInterval: 300  # 5分钟刷新一次
    timeout: 10
    retryAttempts: 3
    enableCache: true
    cacheExpiry: 3600  # 1小时缓存过期

配置项说明

| 配置项 | 类型 | 默认值 | 说明 | |--------|------|--------|------| | urls | Array | [] | 在线提示词源配置列表 | | refreshInterval | Number | 300 | 自动刷新间隔(秒),0 表示不自动刷新 | | timeout | Number | 10 | 请求超时时间(秒) | | retryAttempts | Number | 3 | 请求失败时的重试次数 | | enableCache | Boolean | true | 是否启用缓存 | | cacheExpiry | Number | 3600 | 缓存过期时间(秒) |

URL 配置项说明

| 配置项 | 类型 | 必填 | 说明 | |--------|------|------|------| | name | String | ✅ | 提示词源的名称,用于生成占位符 | | url | String | ✅ | 提示词内容的 URL | | priority | Number | ❌ | 优先级,数字越小越靠前(默认:10) | | enabled | Boolean | ❌ | 是否启用此提示词源(默认:true) | | headers | Object | ❌ | 可选的 HTTP 请求头 |

🎯 使用方法

1. 在提示词中使用占位符

配置完成后,你可以在 YesImBot 的提示词模板中使用以下占位符:

{{online.my-custom-prompt}}
{{online.notion-prompt}}

占位符格式为:{{online.{name}}},其中 {name} 是你在配置中设置的提示词源名称。

2. 示例提示词模板

你是一个AI助手。

{{online.my-custom-prompt}}

当前时间:{{date.now}}
用户:{{user.name}}

请根据以上信息回复用户。

🔗 支持的在线源

GitHub Gist

  1. 创建一个 GitHub Gist
  2. 获取 Raw URL(格式:https://gist.githubusercontent.com/username/gist-id/raw/filename
  3. 在配置中使用该 URL

Notion

  1. 在 Notion 中创建包含提示词的页面
  2. 导出为 Markdown 或纯文本
  3. 将导出的文件上传到可公开访问的位置
  4. 在配置中使用该 URL

其他平台

任何能够提供纯文本内容的 HTTP(S) URL 都可以作为提示词源。

🔧 高级用法

1. 使用认证头

对于需要认证的私有源,可以在配置中添加认证头:

headers:
  Authorization: "Bearer your-token"
  X-API-Key: "your-api-key"

2. 优先级控制

通过设置不同的 priority 值来控制提示词的加载顺序:

urls:
  - name: "system-prompt"
    priority: 1  # 最高优先级
  - name: "user-prompt"
    priority: 10  # 较低优先级

3. 条件启用

可以通过 enabled 字段来临时禁用某个提示词源:

urls:
  - name: "debug-prompt"
    enabled: false  # 临时禁用

🐛 故障排除

常见问题

  1. 提示词内容为空

    • 检查 URL 是否可访问
    • 确认网络连接正常
    • 查看日志中的错误信息
  2. 请求超时

    • 增加 timeout 配置值
    • 检查网络延迟
  3. 认证失败

    • 确认认证头配置正确
    • 检查 token 是否有效

日志查看

插件会输出详细的日志信息,包括:

  • 提示词加载状态
  • 网络请求结果
  • 缓存操作
  • 错误信息

📄 许可证

MIT License

🤝 贡献

欢迎提交 Issue 和 Pull Request!