diff --git a/.bunfig.toml b/.bunfig.toml new file mode 100644 index 0000000..d6bb75b --- /dev/null +++ b/.bunfig.toml @@ -0,0 +1,3 @@ +[install.lockfile] + +save = false diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 7707b1a..ae2208c 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -4,6 +4,7 @@ - [ ] ✨ feat - [ ] 🐛 fix +- [ ] ♻️ refactor - [ ] 💄 style - [ ] 🔨 chore - [ ] 📝 docs diff --git a/.github/workflows/contributor-help.yml b/.github/workflows/contributor-help.yml deleted file mode 100644 index cc48142..0000000 --- a/.github/workflows/contributor-help.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Contributor Helper - -on: - schedule: [{ cron: '0 18 * * *' }] - workflow_dispatch: -jobs: - contributor: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - - - uses: actions-cool/contributor-helper@v1 - with: - token: ${{ secrets.GH_TOKEN }} - style: 'simple' - update-files: 'README.md' - update-places: '/' - - - name: Commit and push if changed - run: |- - git diff - git config --global user.name "lobehubbot" - git config --global user.email "i@lobehub.com" - git pull - git add -A - git commit -m "🤖 docs: Auto update contributors" || exit 0 - git push diff --git a/.github/workflows/issue-auto-comments.yml b/.github/workflows/issue-auto-comments.yml new file mode 100644 index 0000000..65b3c98 --- /dev/null +++ b/.github/workflows/issue-auto-comments.yml @@ -0,0 +1,72 @@ +name: Issue Auto Comment +on: + issues: + types: + - opened + - closed + - assigned + pull_request_target: + types: + - opened + - closed + +permissions: + contents: read + +jobs: + run: + permissions: + issues: write # for actions-cool/issues-helper to update issues + pull-requests: write # for actions-cool/issues-helper to update PRs + runs-on: ubuntu-latest + steps: + - name: Auto Comment on Issues Opened + uses: wow-actions/auto-comment@v1 + with: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN}} + issuesOpened: | + 👀 @{{ author }} + Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible. + Please make sure you have given us as much context as possible.\ + 非常感谢您提交 issue。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。 + - name: Auto Comment on Issues Closed + uses: wow-actions/auto-comment@v1 + with: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN}} + issuesClosed: | + ✅ @{{ author }} +
+ This issue is closed, If you have any questions, you can comment and reply.\ + 此问题已经关闭。如果您有任何问题,可以留言并回复。 + - name: Auto Comment on Pull Request Opened + uses: wow-actions/auto-comment@v1 + with: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN}} + pullRequestOpened: | + 👍 @{{ author }} +
+ Thank you for raising your pull request and contributing to our Community + Please make sure you have followed our contributing guidelines. We will review it as soon as possible. + If you encounter any problems, please feel free to connect with us.\ + 非常感谢您提出拉取请求并为我们的社区做出贡献,请确保您已经遵循了我们的贡献指南,我们会尽快审查它。 + 如果您遇到任何问题,请随时与我们联系。 + - name: Auto Comment on Pull Request Merged + uses: actions-cool/pr-welcome@main + if: github.event.pull_request.merged == true + with: + token: ${{ secrets.GH_TOKEN }} + comment: | + ❤️ Great PR @${{ github.event.pull_request.user.login }} ❤️ +
+ The growth of project is inseparable from user feedback and contribution, thanks for your contribution!\ + 项目的成长离不开用户反馈和贡献,感谢您的贡献! + emoji: 'hooray' + pr-emoji: '+1, heart' + - name: Remove inactive + if: github.event.issue.state == 'open' && github.actor == github.event.issue.user.login + uses: actions-cool/issues-helper@v3 + with: + actions: 'remove-labels' + token: ${{ secrets.GH_TOKEN }} + issue-number: ${{ github.event.issue.number }} + labels: 'Inactive' diff --git a/.github/workflows/issue-check-inactive.yml b/.github/workflows/issue-check-inactive.yml index d37c4c3..a5ae1fb 100644 --- a/.github/workflows/issue-check-inactive.yml +++ b/.github/workflows/issue-check-inactive.yml @@ -18,5 +18,6 @@ jobs: uses: actions-cool/issues-helper@v3 with: actions: 'check-inactive' + token: ${{ secrets.GH_TOKEN }} inactive-label: 'Inactive' inactive-day: 30 diff --git a/.github/workflows/issue-close-require.yml b/.github/workflows/issue-close-require.yml index 68d6b6c..e64d0cd 100644 --- a/.github/workflows/issue-close-require.yml +++ b/.github/workflows/issue-close-require.yml @@ -18,29 +18,35 @@ jobs: uses: actions-cool/issues-helper@v3 with: actions: 'close-issues' + token: ${{ secrets.GH_TOKEN }} labels: '✅ Fixed' inactive-day: 3 body: | - Since the issue was labeled with `✅ Fixed`, but no response in 3 days. This issue will be closed. If you have any questions, you can comment and reply. - + 👋 @{{ github.event.issue.user.login }} +
+ Since the issue was labeled with `✅ Fixed`, but no response in 3 days. This issue will be closed. If you have any questions, you can comment and reply.\ 由于该 issue 被标记为已修复,同时 3 天未收到回应。现关闭 issue,若有任何问题,可评论回复。 - name: need reproduce uses: actions-cool/issues-helper@v3 with: actions: 'close-issues' + token: ${{ secrets.GH_TOKEN }} labels: '🤔 Need Reproduce' inactive-day: 3 body: | - Since the issue was labeled with `🤔 Need Reproduce`, but no response in 3 days. This issue will be closed. If you have any questions, you can comment and reply. - + 👋 @{{ github.event.issue.user.login }} +
+ Since the issue was labeled with `🤔 Need Reproduce`, but no response in 3 days. This issue will be closed. If you have any questions, you can comment and reply.\ 由于该 issue 被标记为需要更多信息,却 3 天未收到回应。现关闭 issue,若有任何问题,可评论回复。 - name: need reproduce uses: actions-cool/issues-helper@v3 with: actions: 'close-issues' + token: ${{ secrets.GH_TOKEN }} labels: "🙅🏻‍♀️ WON'T DO" inactive-day: 3 body: | - Since the issue was labeled with `🙅🏻‍♀️ WON'T DO`, and no response in 3 days. This issue will be closed. If you have any questions, you can comment and reply. - + 👋 @{{ github.event.issue.user.login }} +
+ Since the issue was labeled with `🙅🏻‍♀️ WON'T DO`, and no response in 3 days. This issue will be closed. If you have any questions, you can comment and reply.\ 由于该 issue 被标记为暂不处理,同时 3 天未收到回应。现关闭 issue,若有任何问题,可评论回复。 diff --git a/.github/workflows/issue-remove-inactive.yml b/.github/workflows/issue-remove-inactive.yml deleted file mode 100644 index dbe42dd..0000000 --- a/.github/workflows/issue-remove-inactive.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Issue Remove Inactive - -on: - issues: - types: [edited] - issue_comment: - types: [created, edited] - -permissions: - contents: read - -jobs: - issue-remove-inactive: - permissions: - issues: write # for actions-cool/issues-helper to update issues - pull-requests: write # for actions-cool/issues-helper to update PRs - runs-on: ubuntu-latest - steps: - - name: remove inactive - if: github.event.issue.state == 'open' && github.actor == github.event.issue.user.login - uses: actions-cool/issues-helper@v3 - with: - actions: 'remove-labels' - issue-number: ${{ github.event.issue.number }} - labels: 'Inactive' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index aae65a7..148e7e5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,53 +5,29 @@ on: - main jobs: - test: - name: Test + release: + name: Release runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - - name: Install pnpm - uses: pnpm/action-setup@v2 - with: - version: 8 + - uses: actions/checkout@v4 - - name: Setup Node.js environment - uses: actions/setup-node@v3 - with: - node-version: '18' + - name: Install bun + uses: oven-sh/setup-bun@v1 - name: Install deps - run: pnpm install + run: bun i - name: CI - run: pnpm run ci + run: bun run ci - name: Test - run: pnpm run test + run: bun run test - release: - needs: test - name: Release - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Install pnpm - uses: pnpm/action-setup@v2 - with: - version: 8 - - - name: Setup Node.js environment - uses: actions/setup-node@v3 - with: - node-version: '18' - - - name: Install deps - run: pnpm install + - name: Build + run: bun run build - - name: release - run: pnpm run release + - name: Release + run: bun run release env: GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5a7ecde..9e0238f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,31 +1,27 @@ -name: Test -on: [push] - +name: Test CI +on: + pull_request: + push: + branches: + - '!main' jobs: test: - name: Test runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Install pnpm - uses: pnpm/action-setup@v2 - with: - version: 8 + steps: + - uses: actions/checkout@v4 - - name: Setup Node.js environment - uses: actions/setup-node@v3 - with: - node-version: '18' + - name: Install bun + uses: oven-sh/setup-bun@v1 - name: Install deps - run: pnpm install + run: bun i - name: CI - run: pnpm run ci + run: bun run ci - name: Test and coverage - run: pnpm run test:coverage + run: bun run test:coverage - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 diff --git a/.gitignore b/.gitignore index 7eea562..8235041 100644 --- a/.gitignore +++ b/.gitignore @@ -45,3 +45,4 @@ test-output .vercel public/dist docs-dist +bun.lockb \ No newline at end of file diff --git a/README.md b/README.md index b798d8d..427a6f8 100644 --- a/README.md +++ b/README.md @@ -10,18 +10,18 @@ This plugin allows for the use of the SerpApi search engine -[Changelog](./CHANGELOG.md) · [Report Bug][issues-url] · [Request Feature][issues-url] - - - -[![plugin][plugin-shield]][plugin-url] -[![releaseDate][release-date-shield]][release-date-url] -[![ciTest][ci-test-shield]][ci-test-url] -[![ciRelease][ci-release-shield]][ci-release-url]
-[![contributors][contributors-shield]][contributors-url] -[![forks][forks-shield]][forks-url] -[![stargazers][stargazers-shield]][stargazers-url] -[![issues][issues-shield]][issues-url] +[![][🤯-🧩-lobehub-shield]][🤯-🧩-lobehub-link] +[![][github-release-shield]][github-release-link] +[![][github-releasedate-shield]][github-releasedate-link] +[![][github-action-test-shield]][github-action-test-link] +[![][github-action-release-shield]][github-action-release-link]
+[![][github-contributors-shield]][github-contributors-link] +[![][github-forks-shield]][github-forks-link] +[![][github-stars-shield]][github-stars-link] +[![][github-issues-shield]][github-issues-link] +[![][github-license-shield]][github-license-link] + +[Changelog](./CHANGELOG.md) · [Report Bug][github-issues-link] · [Request Feature][github-issues-link] ![](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png) @@ -33,8 +33,10 @@ This plugin allows for the use of the SerpApi search engine #### TOC - [🤯 Usage](#-usage) +- [📦 Plugin Ecosystem](#-plugin-ecosystem) - [⌨️ Local Development](#️-local-development) - [🤝 Contributing](#-contributing) +- [🔗 Links](#-links) #### @@ -50,19 +52,36 @@ This is a function calling plugin for [Lobe Chat](https://github.com/lobehub/lob +## 📦 Plugin Ecosystem + +Plugins provide a means to extend the \[Function Calling]\[fc-link] capabilities of LobeChat. They can be used to introduce new function calls and even new ways to render message results. If you are interested in plugin development, please refer to our [📘 Plugin Development Guide](https://github.com/lobehub/lobe-chat/wiki/Plugin-Development) in the Wiki. + +- [lobe-chat-plugins][lobe-chat-plugins]: This is the plugin index for LobeChat. It accesses index.json from this repository to display a list of available plugins for LobeChat to the user. +- [chat-plugin-template][chat-plugin-template]: This is the plugin template for LobeChat plugin development. +- [@lobehub/chat-plugin-sdk][chat-plugin-sdk]: The LobeChat Plugin SDK assists you in creating exceptional chat plugins for Lobe Chat. +- [@lobehub/chat-plugins-gateway][chat-plugins-gateway]: The LobeChat Plugins Gateway is a backend service that provides a gateway for LobeChat plugins. We deploy this service using Vercel. The primary API POST /api/v1/runner is deployed as an Edge Function. + +
+ +[![][back-to-top]](#readme-top) + +
+ ## ⌨️ Local Development -You can use Gitpod for online development: +You can use Github Codespaces for online development: -[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][gitpod-url] +[![][github-codespace-shield]][github-codespace-link] Or clone it for local development: +[![][bun-shield]][bun-link] + ```bash $ git clone https://github.com/lobehub/chat-plugin-search-engine.git -$ cd lobe-ui -$ pnpm install -$ pnpm start +$ cd chat-plugin-search-engine +$ bun install +$ bun dev ```
@@ -73,21 +92,22 @@ $ pnpm start ## 🤝 Contributing - +Contributions of all types are more than welcome, if you are interested in contributing code, feel free to check out our GitHub [Issues][github-issues-link] to get stuck in to show us what you’re made of. + +[![][pr-welcome-shield]][pr-welcome-link] -> 📊 Total: **3** +[![][github-contrib-shield]][github-contrib-link] + +
+ +[![][back-to-top]](#readme-top) + +
- - - - - - - - - +## 🔗 Links - +- **[🤖 Lobe Chat](https://github.com/lobehub/lobe-chat)** - An open-source, extensible (Function Calling), high-performance chatbot framework. It supports one-click free deployment of your private ChatGPT/LLM web application. +- **[🧩 / 🏪 Plugin Index](https://github.com/lobehub/lobe-chat-plugins)** - This is the plugin index for LobeChat. It accesses index.json from this repository to display a list of available plugins for Function Calling to the user.
@@ -99,27 +119,42 @@ $ pnpm start #### 📝 License -Copyright © 2023 [LobeHub][profile-url].
+Copyright © 2023 [LobeHub][profile-link].
This project is [MIT](./LICENSE) licensed. -[back-to-top]: https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square -[ci-release-shield]: https://github.com/lobehub/chat-plugin-search-engine/actions/workflows/release.yml/badge.svg -[ci-release-url]: https://github.com/lobehub/chat-plugin-search-engine/actions/workflows/release.yml -[ci-test-shield]: https://github.com/lobehub/chat-plugin-search-engine/actions/workflows/test.yml/badge.svg -[ci-test-url]: https://github.com/lobehub/chat-plugin-search-engine/actions/workflows/test.yml -[contributors-shield]: https://img.shields.io/github/contributors/lobehub/chat-plugin-search-engine.svg?style=flat -[contributors-url]: https://github.com/lobehub/chat-plugin-search-engine/graphs/contributors -[forks-shield]: https://img.shields.io/github/forks/lobehub/chat-plugin-search-engine.svg?style=flat -[forks-url]: https://github.com/lobehub/chat-plugin-search-engine/network/members -[gitpod-url]: https://gitpod.io/#https://github.com/lobehub/chat-plugin-search-engine -[issues-shield]: https://img.shields.io/github/issues/lobehub/chat-plugin-search-engine.svg?style=flat -[issues-url]: https://github.com/lobehub/chat-plugin-search-engine/issues/new/choose -[plugin-shield]: https://img.shields.io/badge/%F0%9F%A4%AF_LobeChat-plugin-cyan -[plugin-url]: https://github.com/lobehub/lobe-chat-plugins -[profile-url]: https://github.com/lobehub -[release-date-shield]: https://img.shields.io/github/release-date/lobehub/chat-plugin-search-engine?style=flat -[release-date-url]: https://github.com/lobehub/chat-plugin-search-engine/releases -[stargazers-shield]: https://img.shields.io/github/stars/lobehub/chat-plugin-search-engine.svg?style=flat -[stargazers-url]: https://github.com/lobehub/chat-plugin-search-engine/stargazers +[🤯-🧩-lobehub-link]: https://github.com/lobehub/lobe-chat-plugins +[🤯-🧩-lobehub-shield]: https://img.shields.io/badge/%F0%9F%A4%AF%20%26%20%F0%9F%A7%A9%20LobeHub-Plugin-95f3d9?labelColor=black&style=flat-square +[back-to-top]: https://img.shields.io/badge/-BACK_TO_TOP-black?style=flat-square +[bun-link]: https://bun.sh +[bun-shield]: https://img.shields.io/badge/-speedup%20with%20bun-black?logo=bun&style=for-the-badge +[chat-plugin-sdk]: https://github.com/lobehub/chat-plugin-sdk +[chat-plugin-template]: https://github.com/lobehub/chat-plugin- +[chat-plugins-gateway]: https://github.com/lobehub/chat-plugins-gateway +[github-action-release-link]: https://github.com/lobehub/chat-plugin-search-engine/actions/workflows/release.yml +[github-action-release-shield]: https://img.shields.io/github/actions/workflow/status/lobehub/chat-plugin-search-engine/release.yml?label=release&labelColor=black&logo=githubactions&logoColor=white&style=flat-square +[github-action-test-link]: https://github.com/lobehub/chat-plugin-search-engine/actions/workflows/test.yml +[github-action-test-shield]: https://img.shields.io/github/actions/workflow/status/lobehub/chat-plugin-search-engine/test.yml?label=test&labelColor=black&logo=githubactions&logoColor=white&style=flat-square +[github-codespace-link]: https://codespaces.new/lobehub/chat-plugin-search-engine +[github-codespace-shield]: https://github.com/codespaces/badge.svg +[github-contrib-link]: https://github.com/lobehub/chat-plugin-search-engine/graphs/contributors +[github-contrib-shield]: https://contrib.rocks/image?repo=lobehub%2Fchat-plugin-search-engine +[github-contributors-link]: https://github.com/lobehub/chat-plugin-search-engine/graphs/contributors +[github-contributors-shield]: https://img.shields.io/github/contributors/lobehub/chat-plugin-search-engine?color=c4f042&labelColor=black&style=flat-square +[github-forks-link]: https://github.com/lobehub/chat-plugin-search-engine/network/members +[github-forks-shield]: https://img.shields.io/github/forks/lobehub/chat-plugin-search-engine?color=8ae8ff&labelColor=black&style=flat-square +[github-issues-link]: https://github.com/lobehub/chat-plugin-search-engine/issues +[github-issues-shield]: https://img.shields.io/github/issues/lobehub/chat-plugin-search-engine?color=ff80eb&labelColor=black&style=flat-square +[github-license-link]: https://github.com/lobehub/chat-plugin-search-engine/blob/main/LICENSE +[github-license-shield]: https://img.shields.io/github/license/lobehub/chat-plugin-search-engine?color=white&labelColor=black&style=flat-square +[github-release-link]: https://github.com/lobehub/chat-plugin-search-engine/releases +[github-release-shield]: https://img.shields.io/github/v/release/lobehub/chat-plugin-search-engine?color=369eff&labelColor=black&logo=github&style=flat-square +[github-releasedate-link]: https://github.com/lobehub/chat-plugin-search-engine/releases +[github-releasedate-shield]: https://img.shields.io/github/release-date/lobehub/chat-plugin-search-engine?labelColor=black&style=flat-square +[github-stars-link]: https://github.com/lobehub/chat-plugin-search-engine/network/stargazers +[github-stars-shield]: https://img.shields.io/github/stars/lobehub/chat-plugin-search-engine?color=ffcb47&labelColor=black&style=flat-square +[lobe-chat-plugins]: https://github.com/lobehub/lobe-chat-plugins +[pr-welcome-link]: https://github.com/lobehub/chat-plugin-search-engine/pulls +[pr-welcome-shield]: https://img.shields.io/badge/%F0%9F%A4%AF%20PR%20WELCOME-%E2%86%92-ffcb47?labelColor=black&style=for-the-badge +[profile-link]: https://github.com/lobehub