bb-plugins
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesebb plugins
bb 插件
bb plugins are TypeScript packages that run inside bb. They are how bb extends itself.
Many first-party features are plugins: GitHub, Docs, Memory, Tasks, Connect, Automations, Secrets, Keep Awake, and the coding-agent providers.
bb 插件是运行在 bb 内部的 TypeScript 包,是 bb 实现自我扩展的方式。
许多官方功能都是以插件形式存在的:GitHub、Docs、Memory、Tasks、Connect、Automations、Secrets、Keep Awake,以及 coding-agent 提供程序。
Trust
信任机制
Plugins are full-trust. Server code runs in-process. App UI is same-origin page code, not a sandbox. Host workers run as Node on enrolled machines.
Review source before installing third-party plugins. Keep credentials in settings.
secret: true插件拥有完全权限:服务端代码在进程内运行;应用 UI 是同源页面代码,而非沙箱环境;主机 worker 在已注册机器上以 Node 进程运行。
安装第三方插件前请先审核源代码。请将凭据存储在的设置项中。
secret: trueThis skill vs others
本技能与其他技能的区别
- Use this skill to create, install, or change a plugin.
- Use to operate bb (threads, projects, environments).
bb-cli - For exact API signatures, read the skill if it is available, then run
bb-plugin-authoring. In the plugin directory, runbb guide pluginsbefore trusting local SDK types. Do not guess from minifiedbb plugin typesfiles.dist/
- 使用本技能创建、安装或修改插件。
- 使用技能操作 bb(线程、项目、环境)。
bb-cli - 如需了解准确的 API 签名,请先查看技能(若可用),然后运行
bb-plugin-authoring。在插件目录中,使用本地 SDK 类型前请先运行bb guide plugins。不要从压缩后的bb plugin types文件中猜测 API。dist/
Scaffold
脚手架搭建
sh
bb plugin new hello # add --app for a React UI
cd bb-plugin-hello
bb plugin install . --yes
bb plugin dev # rebuild + reload on saveThe manifest is the object in . Required: , , , . Optional: , , , .
bbpackage.jsonbb.namebb.descriptionbb.branding.iconbb.serverbb.appbb.hostbb.skillsbb.themesPlugin id is the last package-name segment with a prefix stripped. and both become .
bb-plugin-bb-plugin-hello@acme/bb-plugin-hellohelloPut runtime imports in . Leave types and tooling in . Git installs run .
dependenciesdevDependenciesnpm install --omit=devsh
bb plugin new hello # 添加 --app 参数以创建 React UI
cd bb-plugin-hello
bb plugin install . --yes
bb plugin dev # 保存时自动重建并重载清单是中的对象。必填项:、、、。可选项:、、、。
package.jsonbbbb.namebb.descriptionbb.branding.iconbb.serverbb.appbb.hostbb.skillsbb.themes插件 ID 是包名的最后一段,去掉前缀。和的插件 ID 均为。
bb-plugin-bb-plugin-hello@acme/bb-plugin-hellohello将运行时依赖放入,类型和工具依赖放入。Git 安装时会执行。
dependenciesdevDependenciesnpm install --omit=devWhat a plugin can add
插件可扩展的功能
A default-export factory in receives and registers surfaces:
server.tsBbPluginApi- settings, kv + SQLite storage, HTTP, RPC, realtime
- background services and cron
- one top-level command
bb <name> … - agent tools, folders, extra instructions
skills/ - mention providers
- optional host workers and experimental agent providers
app.tsxdefinePluginAppDo not copy the full API into this skill. Read when implementing a surface.
bb-plugin-authoringserver.tsBbPluginApi- 设置、键值存储 + SQLite 存储、HTTP、RPC、实时通信
- 后台服务与定时任务
- 一个顶级命令
bb <name> … - Agent 工具、文件夹、额外指令
skills/ - 提及提供程序
- 可选的主机 worker 和实验性 Agent 提供程序
app.tsxdefinePluginApp请勿将完整 API 复制到本技能中。实现功能面时请查阅技能。
bb-plugin-authoringInstall and ship
安装与发布
sh
bb plugin install . # local path
bb plugin install github # bundled official plugin
bb plugin install npm:bb-plugin-notes@^1.0.0
bb plugin install git:https://github.com/acme/bb-plugin-notes.git@^1.2.0
bb plugin list
bb plugin reload <id>
bb plugin logs <id> -fInstalls prompt because the code is full-trust. Pass to skip.
--yesA failed managed update rolls back. Catalog refresh never installs code.
Community listings live at https://getbb.app/marketplace/v1/marketplace.json. Submit via a PR to https://github.com/get-bb/marketplace. Use the skill for that workflow.
submit-a-pluginsh
bb plugin install . # 本地路径
bb plugin install github # 官方捆绑插件
bb plugin install npm:bb-plugin-notes@^1.0.0
bb plugin install git:https://github.com/acme/bb-plugin-notes.git@^1.2.0
bb plugin list
bb plugin reload <id>
bb plugin logs <id> -f安装时会弹出提示(因为代码拥有完全权限),可添加参数跳过提示。
--yes失败的托管更新会回滚。目录刷新不会自动安装代码。
社区插件列表位于 https://getbb.app/marketplace/v1/marketplace.json。可通过向 https://github.com/get-bb/marketplace 提交 PR 来发布插件,该流程可使用技能。
submit-a-pluginCheck the work
验证工作成果
- shows the plugin
bb plugin list.running - If it added a CLI, works.
bb <command> --help - If it added UI, open the page or panel in bb and confirm it loads.
- If the factory throws, the plugin is . Read
errorand fix, thenbb plugin logs <id>.bb plugin reload <id>
- 显示插件状态为
bb plugin list。running - 若插件添加了 CLI 命令,可正常运行。
bb <command> --help - 若插件添加了 UI,在 bb 中打开对应的页面或面板,确认可正常加载。
- 若工厂函数抛出错误,插件状态为。查看
error并修复问题,然后运行bb plugin logs <id>。bb plugin reload <id>