feat: 落地插件宿主、示例模板与脱敏插件 - #30
Merged
Merged
Conversation
- 在 `.env.example` 中添加插件目录和 RPC 超时的环境变量示例。 - 更新 `AGENTS.md` 文档,详细说明插件 SDK 和宿主的结构,明确插件与 Agent 的交互方式。 - 在 CI 配置中调整 `gofmt` 检查路径,确保插件示例代码的格式化。 - 新增 `plugin.md` 文档,提供插件开发指南和示例。 - 在 `example/hello` 目录中添加示例插件代码,展示如何实现和使用插件。 - [ ] 确保 `.env.example` 中的插件配置正确。 - [ ] 运行示例插件并验证其功能。 - [ ] 检查文档是否清晰,能否指导用户创建和使用插件。 相关 Issue / Related issue:#21 Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
- 在 `coordinator_test.go` 中添加了对 `ask` 模式的状态加载测试,确保插件方法在状态合并后仍然可用。 - 在 `hello_plugin_test.go` 中新增测试以验证 `hello` 方法的可执行性和对禁止参数的处理。 - 在 `loop_test.go` 中添加测试以确认在活跃运行时的冲突处理和插件的输入处理。 - 在 `host_test.go` 中增加测试以确保保留方法不能被插件覆盖。 确保所有新增测试通过并覆盖相关功能。
- 在 `ChatPage` 组件中引入 `useEffect` 钩子,以在组件挂载后从本地存储读取上次的工作区草稿。 - 将 `workspaceDraft` 的初始状态设置为空字符串,以避免 SSR 文本不一致的问题。 - 添加中文注释以增强代码可读性。 确保草稿在用户会话中正确加载。
- 新增 `example/redact` 目录,包含脱敏插件的实现,能够在多个接口中将敏感信息替换为占位符。 - 更新 `AGENTS.md` 文档,详细说明脱敏插件的功能和使用方法。 - 在 CI 配置中添加对 `example/redact` 的测试,确保插件功能正常。 - 增加 `redact_plugin_test.go` 测试用例,验证插件在处理用户输入和工具回包时的脱敏效果。 确保敏感信息在用户会话中不会泄露。
- 删除 `example/hello` 和 `example/redact` 目录,迁移示例插件到 `plugin/` 目录下,更新相关文档以反映新的插件结构。 - 修改 `.env.example` 中的插件目录示例,确保与新结构一致。 - 更新 CI 配置,调整测试路径以支持新的插件位置。 - 在 `AGENTS.md` 和 `plugin.md` 中更新插件使用说明,确保用户能够正确理解和使用新的插件结构。 确保插件示例和文档与代码结构保持一致,提升可维护性。
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
同时留下 PLUGIN_DIR 与 CODEX_BIN,ChatPage 继续用系统选目录并避免 hydration 对不齐。 Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
改了什么 / What changed
PLUGIN_DIR时主循环不变。plugin/example是拷贝模板:不订阅、不改正文、不换向、不登记方法,装进PLUGIN_DIR也不改对话。plugin/redact在 input / request / post-execute 把秘密换成占位符,不拦工具。localStorage当初值。Closes #16
Closes #28
怎么验证 / How to verify
cd server && go test ./...cd plugin/redact && go test .gofmt -l server plugin无输出;go vet ./...;go build ./cmd/serverpnpm test:clientpnpm lint:web相关 Issue / Related issue:#16 ,#28
Made with Cursor