├── .changelogrc.js
├── .commitlintrc.js
├── .editorconfig
├── .eslintignore
├── .eslintrc.js
├── .github
├── ISSUE_TEMPLATE
│ ├── 1_bug_report.yml
│ ├── 2_feature_request.yml
│ ├── 3_question.yml
│ └── other.md
├── PULL_REQUEST_TEMPLATE.md
└── workflows
│ ├── contributor-help.yml
│ ├── issue-check-inactive.yml
│ ├── issue-close-require.yml
│ ├── issue-remove-inactive.yml
│ ├── release.yml
│ └── test.yml
├── .gitignore
├── .husky
├── commit-msg
└── pre-commit
├── .npmrc
├── .prettierignore
├── .prettierrc.js
├── .releaserc.js
├── .remarkrc.js
├── .stylelintrc.js
├── CHANGELOG.md
├── LICENSE
├── README.md
├── next-env.d.ts
├── next.config.mjs
├── package.json
├── public
└── manifest-dev.json
├── src
├── data.ts
├── pages
│ ├── _app.tsx
│ ├── api
│ │ ├── clothes.ts
│ │ └── gateway.ts
│ ├── global.css
│ └── index.tsx
└── type.ts
├── tsconfig.json
└── vitest.config.ts
/.changelogrc.js:
--------------------------------------------------------------------------------
1 | module.exports = require('@lobehub/lint').changelog;
2 |
--------------------------------------------------------------------------------
/.commitlintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = require('@lobehub/lint').commitlint;
2 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # http://editorconfig.org
2 | root = true
3 |
4 | [*]
5 | indent_style = space
6 | indent_size = 2
7 | end_of_line = lf
8 | charset = utf-8
9 | trim_trailing_whitespace = true
10 | insert_final_newline = true
11 |
12 | [*.md]
13 | trim_trailing_whitespace = false
14 |
15 | [Makefile]
16 | indent_style = tab
--------------------------------------------------------------------------------
/.eslintignore:
--------------------------------------------------------------------------------
1 | # Eslintignore for LobeHub
2 | ################################################################
3 |
4 | # dependencies
5 | node_modules
6 |
7 | # ci
8 | coverage
9 | .coverage
10 |
11 | # test
12 | jest*
13 | _test_
14 | __test__
15 |
16 | # umi
17 | .umi
18 | .umi-production
19 | .umi-test
20 | .dumi/tmp*
21 | !.dumirc.ts
22 |
23 | # production
24 | dist
25 | es
26 | lib
27 | logs
28 |
29 | # misc
30 | # add other ignore file below
31 |
--------------------------------------------------------------------------------
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = require('@lobehub/lint').eslint;
2 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/1_bug_report.yml:
--------------------------------------------------------------------------------
1 | name: '🐛 反馈缺陷 Bug Report'
2 | description: '反馈一个问题缺陷 | Report an bug'
3 | title: '[Bug] '
4 | labels: '🐛 Bug'
5 | body:
6 | - type: dropdown
7 | attributes:
8 | label: '💻 系统环境 | Operating System'
9 | options:
10 | - Windows
11 | - macOS
12 | - Ubuntu
13 | - Other Linux
14 | - Other
15 | validations:
16 | required: true
17 | - type: dropdown
18 | attributes:
19 | label: '🌐 浏览器 | Browser'
20 | options:
21 | - Chrome
22 | - Edge
23 | - Safari
24 | - Firefox
25 | - Other
26 | validations:
27 | required: true
28 | - type: textarea
29 | attributes:
30 | label: '🐛 问题描述 | Bug Description'
31 | description: A clear and concise description of the bug.
32 | validations:
33 | required: true
34 | - type: textarea
35 | attributes:
36 | label: '🚦 期望结果 | Expected Behavior'
37 | description: A clear and concise description of what you expected to happen.
38 | - type: textarea
39 | attributes:
40 | label: '📷 复现步骤 | Recurrence Steps'
41 | description: A clear and concise description of how to recurrence.
42 | - type: textarea
43 | attributes:
44 | label: '📝 补充信息 | Additional Information'
45 | description: If your problem needs further explanation, or if the issue you're seeing cannot be reproduced in a gist, please add more information here.
46 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/2_feature_request.yml:
--------------------------------------------------------------------------------
1 | name: '🌠 功能需求 Feature Request'
2 | description: '需求或建议 | Suggest an idea'
3 | title: '[Request] '
4 | labels: '🌠 Feature Request'
5 | body:
6 | - type: textarea
7 | attributes:
8 | label: '🥰 需求描述 | Feature Description'
9 | description: Please add a clear and concise description of the problem you are seeking to solve with this feature request.
10 | validations:
11 | required: true
12 | - type: textarea
13 | attributes:
14 | label: '🧐 解决方案 | Proposed Solution'
15 | description: Describe the solution you'd like in a clear and concise manner.
16 | validations:
17 | required: true
18 | - type: textarea
19 | attributes:
20 | label: '📝 补充信息 | Additional Information'
21 | description: Add any other context about the problem here.
22 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/3_question.yml:
--------------------------------------------------------------------------------
1 | name: '😇 疑问或帮助 Help Wanted'
2 | description: '疑问或需要帮助 | Need help'
3 | title: '[Question] '
4 | labels: '😇 Help Wanted'
5 | body:
6 | - type: textarea
7 | attributes:
8 | label: '🧐 问题描述 | Proposed Solution'
9 | description: A clear and concise description of the proplem.
10 | validations:
11 | required: true
12 | - type: textarea
13 | attributes:
14 | label: '📝 补充信息 | Additional Information'
15 | description: Add any other context about the problem here.
16 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/other.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: '📝 其他 Other'
3 | about: '其他问题 | Other issues'
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 | ---
8 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | #### 💻 变更类型 | Change Type
2 |
3 |
4 |
5 | - [ ] ✨ feat
6 | - [ ] 🐛 fix
7 | - [ ] 💄 style
8 | - [ ] 🔨 chore
9 | - [ ] 📝 docs
10 |
11 | #### 🔀 变更说明 | Description of Change
12 |
13 |
14 |
15 | #### 📝 补充信息 | Additional Information
16 |
17 |
18 |
--------------------------------------------------------------------------------
/.github/workflows/contributor-help.yml:
--------------------------------------------------------------------------------
1 | name: Contributor Helper
2 |
3 | on:
4 | schedule: [{ cron: '0 18 * * *' }]
5 | workflow_dispatch:
6 | jobs:
7 | contributor:
8 | runs-on: ubuntu-latest
9 | steps:
10 | - uses: actions/checkout@master
11 |
12 | - uses: actions-cool/contributor-helper@v1
13 | with:
14 | token: ${{ secrets.GH_TOKEN }}
15 | style: 'simple'
16 | update-files: 'README.md'
17 | update-places: '/'
18 |
19 | - name: Commit and push if changed
20 | run: |-
21 | git diff
22 | git config --global user.name "lobehubbot"
23 | git config --global user.email "i@lobehub.com"
24 | git pull
25 | git add -A
26 | git commit -m "🤖 docs: Auto update contributors" || exit 0
27 | git push
28 |
--------------------------------------------------------------------------------
/.github/workflows/issue-check-inactive.yml:
--------------------------------------------------------------------------------
1 | name: Issue Check Inactive
2 |
3 | on:
4 | schedule:
5 | - cron: '0 0 */15 * *'
6 |
7 | permissions:
8 | contents: read
9 |
10 | jobs:
11 | issue-check-inactive:
12 | permissions:
13 | issues: write # for actions-cool/issues-helper to update issues
14 | pull-requests: write # for actions-cool/issues-helper to update PRs
15 | runs-on: ubuntu-latest
16 | steps:
17 | - name: check-inactive
18 | uses: actions-cool/issues-helper@v3
19 | with:
20 | actions: 'check-inactive'
21 | inactive-label: 'Inactive'
22 | inactive-day: 30
23 |
--------------------------------------------------------------------------------
/.github/workflows/issue-close-require.yml:
--------------------------------------------------------------------------------
1 | name: Issue Close Require
2 |
3 | on:
4 | schedule:
5 | - cron: '0 0 * * *'
6 |
7 | permissions:
8 | contents: read
9 |
10 | jobs:
11 | issue-close-require:
12 | permissions:
13 | issues: write # for actions-cool/issues-helper to update issues
14 | pull-requests: write # for actions-cool/issues-helper to update PRs
15 | runs-on: ubuntu-latest
16 | steps:
17 | - name: need reproduce
18 | uses: actions-cool/issues-helper@v3
19 | with:
20 | actions: 'close-issues'
21 | labels: '✅ Fixed'
22 | inactive-day: 3
23 | body: |
24 | 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.
25 |
26 | 由于该 issue 被标记为已修复,同时 3 天未收到回应。现关闭 issue,若有任何问题,可评论回复。
27 | - name: need reproduce
28 | uses: actions-cool/issues-helper@v3
29 | with:
30 | actions: 'close-issues'
31 | labels: '🤔 Need Reproduce'
32 | inactive-day: 3
33 | body: |
34 | 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.
35 |
36 | 由于该 issue 被标记为需要更多信息,却 3 天未收到回应。现关闭 issue,若有任何问题,可评论回复。
37 | - name: need reproduce
38 | uses: actions-cool/issues-helper@v3
39 | with:
40 | actions: 'close-issues'
41 | labels: "🙅🏻♀️ WON'T DO"
42 | inactive-day: 3
43 | body: |
44 | 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.
45 |
46 | 由于该 issue 被标记为暂不处理,同时 3 天未收到回应。现关闭 issue,若有任何问题,可评论回复。
47 |
--------------------------------------------------------------------------------
/.github/workflows/issue-remove-inactive.yml:
--------------------------------------------------------------------------------
1 | name: Issue Remove Inactive
2 |
3 | on:
4 | issues:
5 | types: [edited]
6 | issue_comment:
7 | types: [created, edited]
8 |
9 | permissions:
10 | contents: read
11 |
12 | jobs:
13 | issue-remove-inactive:
14 | permissions:
15 | issues: write # for actions-cool/issues-helper to update issues
16 | pull-requests: write # for actions-cool/issues-helper to update PRs
17 | runs-on: ubuntu-latest
18 | steps:
19 | - name: remove inactive
20 | if: github.event.issue.state == 'open' && github.actor == github.event.issue.user.login
21 | uses: actions-cool/issues-helper@v3
22 | with:
23 | actions: 'remove-labels'
24 | issue-number: ${{ github.event.issue.number }}
25 | labels: 'Inactive'
26 |
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 | name: Release CI
2 | on:
3 | push:
4 | branches:
5 | - main
6 |
7 | jobs:
8 | test:
9 | name: Test
10 | runs-on: ubuntu-latest
11 | steps:
12 | - uses: actions/checkout@v3
13 |
14 | - name: Install pnpm
15 | uses: pnpm/action-setup@v2
16 | with:
17 | version: 8
18 |
19 | - name: Setup Node.js environment
20 | uses: actions/setup-node@v3
21 | with:
22 | node-version: '18'
23 |
24 | - name: Install deps
25 | run: pnpm install
26 |
27 | - name: CI
28 | run: pnpm run ci
29 |
30 | - name: Test
31 | run: pnpm run test
32 |
33 | release:
34 | needs: test
35 | name: Release
36 | runs-on: ubuntu-latest
37 | steps:
38 | - uses: actions/checkout@v3
39 |
40 | - name: Install pnpm
41 | uses: pnpm/action-setup@v2
42 | with:
43 | version: 8
44 |
45 | - name: Setup Node.js environment
46 | uses: actions/setup-node@v3
47 | with:
48 | node-version: '18'
49 |
50 | - name: Install deps
51 | run: pnpm install
52 |
53 | - name: release
54 | run: pnpm run release
55 | env:
56 | GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
57 | NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
58 |
--------------------------------------------------------------------------------
/.github/workflows/test.yml:
--------------------------------------------------------------------------------
1 | name: Test
2 | on: [push]
3 |
4 | jobs:
5 | test:
6 | name: Test
7 | runs-on: ubuntu-latest
8 | steps:
9 | - uses: actions/checkout@v3
10 |
11 | - name: Install pnpm
12 | uses: pnpm/action-setup@v2
13 | with:
14 | version: 8
15 |
16 | - name: Setup Node.js environment
17 | uses: actions/setup-node@v3
18 | with:
19 | node-version: '20'
20 |
21 | - name: Install deps
22 | run: pnpm install
23 |
24 | - name: CI
25 | run: pnpm run ci
26 |
27 | - name: Test and coverage
28 | run: pnpm run test:coverage
29 |
30 | - name: Upload coverage to Codecov
31 | uses: codecov/codecov-action@v3
32 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Gitignore for LobeHub
2 | ################################################################
3 |
4 | # general
5 | .DS_Store
6 | .idea
7 | .vscode
8 | .history
9 | .temp
10 | .env.local
11 | venv
12 | temp
13 | tmp
14 |
15 | # dependencies
16 | node_modules
17 | *.log
18 | *.lock
19 | package-lock.json
20 |
21 | # ci
22 | coverage
23 | .coverage
24 | .eslintcache
25 | .stylelintcache
26 |
27 | # production
28 | dist
29 | es
30 | lib
31 | logs
32 | test-output
33 |
34 | # umi
35 | .umi
36 | .umi-production
37 | .umi-test
38 | .dumi/tmp*
39 |
40 | # husky
41 | .husky/prepare-commit-msg
42 |
43 | # misc
44 | # add other ignore file below
45 | build
46 | .vercel
47 | public/dist
48 | docs-dist
49 | .next
50 |
--------------------------------------------------------------------------------
/.husky/commit-msg:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 | . "$(dirname -- "$0")/_/husky.sh"
3 |
4 | npx --no -- commitlint --edit ${1}
5 |
--------------------------------------------------------------------------------
/.husky/pre-commit:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 | . "$(dirname -- "$0")/_/husky.sh"
3 |
4 | npx --no-install lint-staged
5 |
--------------------------------------------------------------------------------
/.npmrc:
--------------------------------------------------------------------------------
1 | lockfile=false
2 | resolution-mode=highest
3 | public-hoist-pattern[]=*@umijs/lint*
4 | public-hoist-pattern[]=*changelog*
5 | public-hoist-pattern[]=*commitlint*
6 | public-hoist-pattern[]=*eslint*
7 | public-hoist-pattern[]=*postcss*
8 | public-hoist-pattern[]=*prettier*
9 | public-hoist-pattern[]=*remark*
10 | public-hoist-pattern[]=*semantic-release*
11 | public-hoist-pattern[]=*stylelint*
12 |
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | # Prettierignore for LobeHub
2 | ################################################################
3 |
4 | # general
5 | .DS_Store
6 | .editorconfig
7 | .idea
8 | .vscode
9 | .history
10 | .temp
11 | .env.local
12 | .husky
13 | .npmrc
14 | .gitkeep
15 | venv
16 | temp
17 | tmp
18 | LICENSE
19 |
20 | # dependencies
21 | node_modules
22 | *.log
23 | *.lock
24 | package-lock.json
25 |
26 | # ci
27 | coverage
28 | .coverage
29 | .eslintcache
30 | .stylelintcache
31 | test-output
32 | __snapshots__
33 | *.snap
34 |
35 | # production
36 | dist
37 | es
38 | lib
39 | logs
40 |
41 | # umi
42 | .umi
43 | .umi-production
44 | .umi-test
45 | .dumi/tmp*
46 |
47 | # ignore files
48 | .*ignore
49 |
50 | # docker
51 | docker
52 | Dockerfile*
53 |
54 | # image
55 | *.webp
56 | *.gif
57 | *.png
58 | *.jpg
59 |
60 | # misc
61 | # add other ignore file below
62 |
--------------------------------------------------------------------------------
/.prettierrc.js:
--------------------------------------------------------------------------------
1 | module.exports = require('@lobehub/lint').prettier;
2 |
--------------------------------------------------------------------------------
/.releaserc.js:
--------------------------------------------------------------------------------
1 | module.exports = require('@lobehub/lint').semanticRelease;
2 |
--------------------------------------------------------------------------------
/.remarkrc.js:
--------------------------------------------------------------------------------
1 | module.exports = require('@lobehub/lint').remarklint;
2 |
--------------------------------------------------------------------------------
/.stylelintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = require('@lobehub/lint').stylelint;
2 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lobehub/chat-plugin-open-interpreter/792001de4503e4d1603be72e5265bd3012403375/CHANGELOG.md
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 LobeHub
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |

6 |

7 |
8 |
9 |
● Open Interpreter
LobeChat Plugin
10 |
11 | This plugin integrates Open Interpreter into LobeChat, allowing you to control your computer with a chat interface
12 |
13 | [Changelog](./CHANGELOG.md) · [Report Bug][issues-url] · [Request Feature][issues-url]
14 |
15 |
16 |
17 | [![plugin][plugin-shield]][plugin-url]
18 | [![releaseDate][release-date-shield]][release-date-url]
19 | [![ciTest][ci-test-shield]][ci-test-url]
20 | [![ciRelease][ci-release-shield]][ci-release-url]
21 | [![contributors][contributors-shield]][contributors-url]
22 | [![forks][forks-shield]][forks-url]
23 | [![stargazers][stargazers-shield]][stargazers-url]
24 | [![issues][issues-shield]][issues-url]
25 |
26 | 
27 |
28 |
29 |
30 |
31 | Table of contents
32 |
33 | #### TOC
34 |
35 | - [🤯 Usage](#-usage)
36 | - [⌨️ Local Development](#️-local-development)
37 | - [🤝 Contributing](#-contributing)
38 |
39 | ####
40 |
41 |
42 |
43 | ## 🌟 Features
44 |
45 | - 💨 **Quick start with low learning curve**: This template provides a quick start option, allowing users to get started quickly. Additionally, the template includes detailed documentation to help users understand and use the features easily.
46 | - 📚 **Beautiful and comprehensive documentation**: The template aims for aesthetics, with carefully designed interfaces and layouts that make the documentation more intuitive, readable, and user-friendly. Moreover, the template offers a wide range of styles and components for users to customize the appearance and functionality of their documentation.
47 | - 🔄 **Complete workflow, automatic publishing and partner updates**: The template provides a complete workflow, including automatic publishing and automatic partner updates. Users can easily complete the publishing and updating tasks by following the specified steps.
48 | - 🖱️ **One-click document generation**: The template offers a one-click document generation feature, allowing users to quickly generate complete documentation with simple operations. This saves users a significant amount of time and effort, allowing them to focus on improving the content and quality of their documentation.
49 |
50 | ## 🤯 Usage
51 |
52 | This is a function calling plugin for [Lobe Chat](https://github.com/lobehub/lobe-chat), you can install it in plugin setting page.
53 |
54 |
55 |
56 | [![][back-to-top]](#readme-top)
57 |
58 |
59 |
60 | ## ⌨️ Local Development
61 |
62 | You can use Gitpod for online development:
63 |
64 | [][gitpod-url]
65 |
66 | Or clone it for local development:
67 |
68 | ```bash
69 | $ git clone https://github.com/lobehub/chat-plugin-open-interpreter.git
70 | $ cd chat-plugin-open-interpreter
71 | $ pnpm install
72 | $ pnpm run dev
73 | ```
74 |
75 |
76 |
77 | [![][back-to-top]](#readme-top)
78 |
79 |
80 |
81 | ## 🤝 Contributing
82 |
83 |
84 |
85 | > 📊 Total: **2**
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 | [![][back-to-top]](#readme-top)
99 |
100 |
101 |
102 | ---
103 |
104 | #### 📝 License
105 |
106 | Copyright © 2023 [LobeHub][profile-url].
107 | This project is [MIT](./LICENSE) licensed.
108 |
109 |
110 |
111 | [back-to-top]: https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square
112 | [ci-release-shield]: https://github.com/lobehub/chat-plugin-open-interpreter/actions/workflows/release.yml/badge.svg
113 | [ci-release-url]: https://github.com/lobehub/chat-plugin-open-interpreter/actions/workflows/release.yml
114 | [ci-test-shield]: https://github.com/lobehub/chat-plugin-open-interpreter/actions/workflows/test.yml/badge.svg
115 | [ci-test-url]: https://github.com/lobehub/chat-plugin-open-interpreter/actions/workflows/test.yml
116 | [contributors-shield]: https://img.shields.io/github/contributors/lobehub/chat-plugin-open-interpreter.svg?style=flat
117 | [contributors-url]: https://github.com/lobehub/chat-plugin-open-interpreter/graphs/contributors
118 | [forks-shield]: https://img.shields.io/github/forks/lobehub/chat-plugin-open-interpreter.svg?style=flat
119 | [forks-url]: https://github.com/lobehub/chat-plugin-open-interpreter/network/members
120 | [gitpod-url]: https://gitpod.io/#https://github.com/lobehub/chat-plugin-open-interpreter
121 | [issues-shield]: https://img.shields.io/github/issues/lobehub/chat-plugin-open-interpreter.svg?style=flat
122 | [issues-url]: https://github.com/lobehub/chat-plugin-open-interpreter/issues/new/choose
123 | [plugin-shield]: https://img.shields.io/badge/%F0%9F%A4%AF_LobeChat-plugin-cyan
124 | [plugin-url]: https://github.com/lobehub/lobe-chat-plugins
125 | [profile-url]: https://github.com/lobehub
126 | [release-date-shield]: https://img.shields.io/github/release-date/lobehub/chat-plugin-open-interpreter?style=flat
127 | [release-date-url]: https://github.com/lobehub/chat-plugin-open-interpreter/releases
128 | [stargazers-shield]: https://img.shields.io/github/stars/lobehub/chat-plugin-open-interpreter.svg?style=flat
129 | [stargazers-url]: https://github.com/lobehub/chat-plugin-open-interpreter/stargazers
130 |
--------------------------------------------------------------------------------
/next-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 | ///
3 |
4 | // NOTE: This file should not be edited
5 | // see https://nextjs.org/docs/basic-features/typescript for more information.
6 |
--------------------------------------------------------------------------------
/next.config.mjs:
--------------------------------------------------------------------------------
1 | /** @type {import('next').NextConfig} */
2 | const nextConfig = {
3 | reactStrictMode: true,
4 | transpilePackages: ['@lobehub/ui'],
5 | async headers() {
6 | return [
7 | {
8 | // matching all API routes
9 | source: '/:path*',
10 | headers: [
11 | { key: 'Access-Control-Allow-Credentials', value: 'true' },
12 | { key: 'Access-Control-Allow-Origin', value: '*' },
13 | { key: 'Access-Control-Allow-Methods', value: 'GET,OPTIONS,PATCH,DELETE,POST,PUT' },
14 | {
15 | key: 'Access-Control-Allow-Headers',
16 | value:
17 | 'X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version',
18 | },
19 | ],
20 | },
21 | ];
22 | },
23 | };
24 |
25 | export default nextConfig;
26 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "open-interpreter",
3 | "version": "1.0.0",
4 | "private": true,
5 | "description": "This is the plugin template for LobeChat plugin development",
6 | "homepage": "https://github.com/lobehub/chat-plugin-open-interpreter",
7 | "repository": "https://github.com/lobehub/chat-plugin-open-interpreter.git",
8 | "scripts": {
9 | "build": "next build",
10 | "ci": "npm run lint && npm run type-check",
11 | "dev": "next dev -p 3400",
12 | "lint": "eslint \"{src,api,docs}/**/*.{js,jsx,ts,tsx}\" --fix",
13 | "lint:md": "remark . --quiet --frail --output",
14 | "lint:style": "stylelint \"src/**/*.{js,jsx,ts,tsx}\" --fix",
15 | "prepare": "husky install",
16 | "prepublishOnly": "npm run doctor && npm run build",
17 | "prettier": "prettier -c --write \"**/**\"",
18 | "release": "semantic-release",
19 | "start": "next start",
20 | "test": "vitest --passWithNoTests",
21 | "test:coverage": "vitest --coverage --passWithNoTests",
22 | "type-check": "tsc --noEmit"
23 | },
24 | "lint-staged": {
25 | "*.md": [
26 | "remark --quiet --output --",
27 | "prettier --write --no-error-on-unmatched-pattern"
28 | ],
29 | "*.json": [
30 | "prettier --write --no-error-on-unmatched-pattern"
31 | ],
32 | "*.{js,jsx}": [
33 | "prettier --write",
34 | "stylelint --fix",
35 | "eslint --fix"
36 | ],
37 | "*.{ts,tsx}": [
38 | "prettier --parser=typescript --write",
39 | "stylelint --fix",
40 | "eslint --fix"
41 | ]
42 | },
43 | "browserslist": [
44 | "> 1%",
45 | "last 2 versions",
46 | "not ie <= 10"
47 | ],
48 | "dependencies": {
49 | "@lobehub/chat-plugin-sdk": "^1",
50 | "@lobehub/chat-plugins-gateway": "^1",
51 | "@lobehub/ui": "latest",
52 | "antd": "^5",
53 | "antd-style": "^3",
54 | "dayjs": "^1",
55 | "next": "13",
56 | "react": "^18",
57 | "react-dom": "^18",
58 | "react-layout-kit": "^1"
59 | },
60 | "devDependencies": {
61 | "@commitlint/cli": "^17",
62 | "@lobehub/lint": "latest",
63 | "@types/react": "18",
64 | "@types/react-dom": "18",
65 | "@vercel/node": "^2",
66 | "@vitest/coverage-v8": "latest",
67 | "commitlint": "^17",
68 | "cross-env": "^7",
69 | "eslint": "^8",
70 | "father": "4.3.1",
71 | "husky": "^8",
72 | "lint-staged": "^13",
73 | "prettier": "^3",
74 | "remark": "^14",
75 | "remark-cli": "^11",
76 | "semantic-release": "^21",
77 | "stylelint": "^15",
78 | "typescript": "^5",
79 | "vitest": "latest"
80 | },
81 | "peerDependencies": {
82 | "react": ">=18",
83 | "react-dom": ">=18"
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/public/manifest-dev.json:
--------------------------------------------------------------------------------
1 | {
2 | "api": [
3 | {
4 | "url": "http://localhost:3400/api/clothes",
5 | "name": "recommendClothes",
6 | "description": "根据用户的心情,给用户推荐他有的衣服",
7 | "parameters": {
8 | "properties": {
9 | "mood": {
10 | "description": "用户当前的心情,可选值有:开心(happy), 难过(sad),生气 (anger),害怕(fear),惊喜( surprise),厌恶 (disgust)",
11 | "enums": ["happy", "sad", "anger", "fear", "surprise", "disgust"],
12 | "type": "string"
13 | },
14 | "gender": {
15 | "type": "string",
16 | "enum": ["man", "woman"],
17 | "description": "对话用户的性别,需要询问用户后才知道这个信息"
18 | }
19 | },
20 | "required": ["mood", "gender"],
21 | "type": "object"
22 | }
23 | }
24 | ],
25 | "gateway": "http://localhost:3400/api/gateway",
26 | "identifier": "open-interpreter",
27 | "ui": {
28 | "url": "http://localhost:3400",
29 | "height": 200
30 | },
31 | "version": "1"
32 | }
33 |
--------------------------------------------------------------------------------
/src/data.ts:
--------------------------------------------------------------------------------
1 | export const manClothes = {
2 | anger: [
3 | {
4 | description: '这款黑色皮夹克可以让你在生气时释放压力。',
5 | name: '黑色皮夹克',
6 | },
7 | {
8 | description: '这款深红色的衬衫可以让你在生气时感到力量。',
9 | name: '深红色长袖衬衫',
10 | },
11 | {
12 | description: '这款军绿色的工装裤可以让你在生气时感到坚韧。',
13 | name: '军绿色工装裤',
14 | },
15 | ],
16 | disgust: [
17 | {
18 | description: '这款黑色的T恤可以让你在厌恶时感到冷静。',
19 | name: '黑色修身T恤',
20 | },
21 | {
22 | description: '这款深色的裤子可以让你在厌恶时感到自在。',
23 | name: '深色直筒休闲裤',
24 | },
25 | {
26 | description: '这款军绿色的夹克可以让你在厌恶时感到坚定。',
27 | name: '军绿色工装夹克',
28 | },
29 | ],
30 | fear: [
31 | {
32 | description: '这款宽松的卫衣可以让你在害怕时感到安全。',
33 | name: '灰色宽松连帽卫衣',
34 | },
35 | {
36 | description: '这款黑色的裤子可以让你在害怕时感到舒适。',
37 | name: '黑色直筒休闲裤',
38 | },
39 | {
40 | description: '这款深色的夹克可以让你在害怕时感到保护。',
41 | name: '深蓝色牛仔夹克',
42 | },
43 | ],
44 | happy: [
45 | {
46 | description: '这款明亮的T恤可以增强你的快乐气氛。',
47 | name: '亮黄色夏日T恤',
48 | },
49 | {
50 | description: '这款活泼的短裤可以让你的心情保持愉快。',
51 | name: '卡通图案运动短裤',
52 | },
53 | {
54 | description: '这款色彩明亮的衬衫可以让你看起来更加开朗。',
55 | name: '彩色条纹休闲衬衫',
56 | },
57 | ],
58 | sad: [
59 | {
60 | description: '舒适的卫衣可以让你在难过的时候感到舒适。',
61 | name: '深色宽松卫衣',
62 | },
63 | {
64 | description: '这款深色的夹克可以让你在难过的时候感到安慰。',
65 | name: '黑色牛仔夹克',
66 | },
67 | {
68 | description: '简单的黑色T恤可以让你在难过的时候感到平静。',
69 | name: '简洁黑色长袖T恤',
70 | },
71 | ],
72 | surprise: [
73 | {
74 | description: '这款亮色的T恤可以让你在惊喜时感到愉悦。',
75 | name: '亮色图案T恤',
76 | },
77 | {
78 | description: '这款鲜艳的短裤可以让你在惊喜时感到活力。',
79 | name: '鲜艳色彩运动短裤',
80 | },
81 | {
82 | description: '这款多彩条纹的衬衫可以让你在惊喜时感到快乐。',
83 | name: '多彩条纹衬衫',
84 | },
85 | ],
86 | };
87 |
88 | export const womanClothes = {
89 | anger: [
90 | {
91 | description: '这款黑色皮夹克可以让你在生气时释放压力。',
92 | name: '黑色皮夹克',
93 | },
94 | {
95 | description: '这款深红色的衬衫可以让你在生气时感到力量。',
96 | name: '深红色长袖衬衫',
97 | },
98 | {
99 | description: '这款军绿色的工装裤可以让你在生气时感到坚韧。',
100 | name: '军绿色工装裤',
101 | },
102 | ],
103 | disgust: [
104 | {
105 | description: '这款黑色的连衣裙可以让你在厌恶时感到冷静。',
106 | name: '黑色修身连衣裙',
107 | },
108 | {
109 | description: '这款深色的裤子可以让你在厌恶时感到自在。',
110 | name: '深色直筒休闲裤',
111 | },
112 | {
113 | description: '这款军绿色的夹克可以让你在厌恶时感到坚定。',
114 | name: '军绿色工装夹克',
115 | },
116 | ],
117 | fear: [
118 | {
119 | description: '这款宽松的卫衣可以让你在害怕时感到安全。',
120 | name: '灰色宽松连帽卫衣',
121 | },
122 | {
123 | description: '这款黑色的裤子可以让你在害怕时感到舒适。',
124 | name: '黑色直筒休闲裤',
125 | },
126 | {
127 | description: '这款深色的夹克可以让你在害怕时感到保护。',
128 | name: '深蓝色牛仔夹克',
129 | },
130 | ],
131 | happy: [
132 | {
133 | description: '这款明亮的连衣裙可以增强你的快乐气氛。',
134 | name: '亮黄色夏日连衣裙',
135 | },
136 | {
137 | description: '这款活泼的短裤可以让你的心情保持愉快。',
138 | name: '卡通图案运动短裤',
139 | },
140 | {
141 | description: '这款色彩明亮的衬衫可以让你看起来更加开朗。',
142 | name: '彩色条纹休闲衬衫',
143 | },
144 | ],
145 | sad: [
146 | {
147 | description: '舒适的连衣裙可以让你在难过的时候感到舒适。',
148 | name: '深色宽松连衣裙',
149 | },
150 | {
151 | description: '这款深色的夹克可以让你在难过的时候感到安慰。',
152 | name: '黑色牛仔夹克',
153 | },
154 | {
155 | description: '简单的黑色T恤可以让你在难过的时候感到平静。',
156 | name: '简洁黑色长袖T恤',
157 | },
158 | ],
159 | surprise: [
160 | {
161 | description: '这款亮色的连衣裙可以让你在惊喜时感到愉悦。',
162 | name: '亮色图案连衣裙',
163 | },
164 | {
165 | description: '这款鲜艳的短裤可以让你在惊喜时感到活力。',
166 | name: '鲜艳色彩运动短裤',
167 | },
168 | {
169 | description: '这款多彩条纹的衬衫可以让你在惊喜时感到快乐。',
170 | name: '多彩条纹衬衫',
171 | },
172 | ],
173 | };
174 |
--------------------------------------------------------------------------------
/src/pages/_app.tsx:
--------------------------------------------------------------------------------
1 | import { ThemeProvider } from '@lobehub/ui';
2 | import type { AppProps } from 'next/app';
3 |
4 | import './global.css';
5 |
6 | export default function App({ Component, pageProps }: AppProps) {
7 | return (
8 |
9 |
10 |
11 | );
12 | }
13 |
--------------------------------------------------------------------------------
/src/pages/api/clothes.ts:
--------------------------------------------------------------------------------
1 | import { PluginErrorType, createErrorResponse } from '@lobehub/chat-plugin-sdk';
2 |
3 | import { manClothes, womanClothes } from '@/data';
4 | import { RequestData, ResponseData } from '@/type';
5 |
6 | export const config = {
7 | runtime: 'edge',
8 | };
9 |
10 | export default async (req: Request) => {
11 | if (req.method !== 'POST') return createErrorResponse(PluginErrorType.MethodNotAllowed);
12 |
13 | const { gender, mood } = (await req.json()) as RequestData;
14 |
15 | const clothes = gender === 'man' ? manClothes : womanClothes;
16 |
17 | const result: ResponseData = {
18 | clothes: clothes[mood] || [],
19 | mood,
20 | today: Date.now(),
21 | };
22 |
23 | return new Response(JSON.stringify(result));
24 | };
25 |
--------------------------------------------------------------------------------
/src/pages/api/gateway.ts:
--------------------------------------------------------------------------------
1 | import { createLobeChatPluginGateway } from '@lobehub/chat-plugins-gateway';
2 |
3 | export const config = {
4 | runtime: 'edge',
5 | };
6 |
7 | export default async (req: Request) => {
8 | if (process.env.NODE_ENV === 'development') {
9 | return createLobeChatPluginGateway()(req);
10 | }
11 |
12 | return;
13 | };
14 |
--------------------------------------------------------------------------------
/src/pages/global.css:
--------------------------------------------------------------------------------
1 | html,
2 | body {
3 | background: transparent !important;
4 |
5 | /*
6 | When using iframe embedding, if you still need to keep the transparent background in dark mode
7 | you need to force the color-scheme to light
8 |
9 | 使用 iframe 嵌入时,如果在暗色模式下仍需要保持透明背景,需要强制设定 color-scheme 为 light
10 | */
11 | color-scheme: light !important;
12 | }
13 |
--------------------------------------------------------------------------------
/src/pages/index.tsx:
--------------------------------------------------------------------------------
1 | import { fetchPluginMessage } from '@lobehub/chat-plugin-sdk/client';
2 | import { Card } from 'antd';
3 | import { createStyles } from 'antd-style';
4 | import dayjs from 'dayjs';
5 | import { memo, useEffect, useState } from 'react';
6 | import { Flexbox } from 'react-layout-kit';
7 |
8 | import { ResponseData } from '@/type';
9 |
10 | const useStyles = createStyles(({ css, token }) => ({
11 | date: css`
12 | color: ${token.colorTextQuaternary};
13 | `,
14 | }));
15 |
16 | const Render = memo(() => {
17 | const [data, setData] = useState();
18 | const { styles } = useStyles();
19 |
20 | useEffect(() => {
21 | fetchPluginMessage().then((e: ResponseData) => {
22 | setData(e);
23 | });
24 | }, []);
25 |
26 | return (
27 |
28 |
29 | 🌟心情:{data?.mood}
30 | {dayjs(data?.today).format('YYYY/MM/DD')}
31 |
32 |
33 | 推荐衣物
34 |
35 | {data?.clothes?.map((item) => (
36 |
37 | {item.description}
38 |
39 | ))}
40 |
41 |
42 |
43 | );
44 | });
45 |
46 | export default Render;
47 |
--------------------------------------------------------------------------------
/src/type.ts:
--------------------------------------------------------------------------------
1 | export interface ClothesItem {
2 | description: string;
3 | name: string;
4 | }
5 | type Mood = 'happy' | 'sad' | 'anger' | 'fear' | 'surprise' | 'disgust';
6 |
7 | export interface ResponseData {
8 | clothes: ClothesItem[];
9 | mood: Mood;
10 | today: number;
11 | }
12 |
13 | export interface RequestData {
14 | gender: 'man' | 'woman';
15 | mood: Mood;
16 | }
17 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "module": "CommonJS",
4 | "target": "ES5",
5 | "lib": ["dom", "dom.iterable", "esnext"],
6 | "sourceMap": true,
7 | "skipDefaultLibCheck": true,
8 | "jsx": "react-jsx",
9 | "baseUrl": ".",
10 | "allowSyntheticDefaultImports": true,
11 | "moduleResolution": "node",
12 | "forceConsistentCasingInFileNames": true,
13 | "noImplicitReturns": true,
14 | "noUnusedLocals": true,
15 | "resolveJsonModule": true,
16 | "skipLibCheck": true,
17 | "strict": true,
18 | "paths": {
19 | "@/*": ["src/*"]
20 | },
21 | "types": ["vitest/globals"]
22 | },
23 | "include": ["src", "next-env.d.ts", "*.ts"]
24 | }
25 |
--------------------------------------------------------------------------------
/vitest.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'vitest/config';
2 |
3 | export default defineConfig({
4 | test: {
5 | environment: 'node',
6 | globals: true,
7 | },
8 | });
9 |
--------------------------------------------------------------------------------