Files
CLIProxyAPI/examples/plugin/README_CN.md
Luis Pater 0ed85bb88b feat(pluginhost): refactor and enhance plugin system with new execution and thinking capabilities
- Removed `examples/plugin/main.go` and `internal/pluginhost/loader_plugin.go` after migrating to a more modular system.
- Introduced `streamBridge` in `internal/pluginhost/stream_bridge.go` for efficient stream handling and communication.
- Added examples of `thinking` plugins written in both Rust and Go under `examples/plugin/thinking`.
- Enhanced test coverage for plugin host system changes, including stream chunk translation and thinking logic.
- Improved API compatibility and ensured backward-compatible upgrades for plugin execution.
2026-06-07 03:20:04 +08:00

1.4 KiB

标准动态库插件示例

本目录包含 CLIProxyAPI C ABI 的标准动态库插件示例。

目录布局

  • simple/:声明全部支持能力的完整骨架示例。
  • model/:只演示模型能力。
  • auth/:只演示认证提供方能力。
  • frontend-auth/:只演示前端认证提供方能力。
  • executor/:只演示执行器能力。
  • protocol-format/:使用最小执行器重点演示输入和输出格式声明。
  • request-translator/:只演示请求转换能力。
  • request-normalizer/:只演示请求规整能力。
  • response-translator/:只演示响应转换能力。
  • response-normalizer/:只演示响应规整能力。
  • thinking/:只演示 Thinking 处理能力。
  • usage/:只演示 Usage 观察能力。
  • cli/:只演示命令行扩展能力。
  • management-api/:只演示 Management API 扩展能力。
  • host-callback/:使用最小 Management API 路由演示宿主回调。

每个示例目录都包含 go/c/rust/ 三个子目录。

构建全部示例

make -C examples/plugin list
make -C examples/plugin build

构建产物会写入 examples/plugin/bin

说明

protocol-format 使用最小执行器承载,因为格式声明属于执行器能力。

host-callback 使用最小 Management API 路由承载,因为宿主回调只能从插件方法内部发起,不是独立能力。