feat(kit): support runtime tool providers#365
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
🚧 Files skipped from review as they are similar to previous changes (2)
Walkthrough
ChangesRuntime Tool Provisioning and toolSource Tracking
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/src/tools/message.md`:
- Around line 256-257: Update the type signatures in the options table for both
getTools and callTool methods to match the actual plugin contract. For getTools,
add the BasePluginContext parameter to the function signature and change the
return type from Promise<Array<Tool | RuntimeTool>> to
MaybePromise<ToolProviderItem[]> to correctly indicate that it can return either
a synchronous or asynchronous result. For callTool, update the return type to
reflect that it can return either a synchronous value (string | Record<string,
any>) or an async/streaming value, rather than only showing the async variant.
These changes will ensure the documentation accurately represents what the
actual plugin implementation expects and returns.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 4530f256-4fdc-43db-821b-fbe8351c3f94
📒 Files selected for processing (10)
docs/src/tools/message.mdpackages/kit/src/message/core/engine.tspackages/kit/src/message/plugins/index.tspackages/kit/src/message/plugins/toolPlugin.tspackages/kit/src/message/test/mockResponseProvider.tspackages/kit/src/message/test/toolPlugin.test.tspackages/kit/src/message/types.tspackages/kit/src/message/utils.tspackages/kit/src/vue/message/mockResponseProvider.tspackages/kit/src/vue/message/plugins/toolPlugin.ts
📦 Package Previewpnpm add https://pkg.pr.new/@opentiny/tiny-robot@10dfcb8 pnpm add https://pkg.pr.new/@opentiny/tiny-robot-kit@10dfcb8 pnpm add https://pkg.pr.new/@opentiny/tiny-robot-svgs@10dfcb8 commit: 10dfcb8 |
…syncStreamableResult types

PR 描述
为 message 工具调用增加 runtime tool provider 能力,让插件可以在请求前动态提供工具 schema,并可选绑定本地 handler 直接处理对应 tool call。
主要改动:
toolPlugin支持RuntimeTool,通过function.name路由到对应 handler。provideTools(context)暴露工具,由toolPlugin统一收集。toolSource,标记工具来自toolPlugin、外部 provider 或未知来源。tools,并检测重复工具名。toolPlugin关键流程测试。验证:
pnpm -F @opentiny/tiny-robot-kit test -- --run src/message/test/toolPlugin.test.ts pnpm buildSummary by CodeRabbit
Summary by CodeRabbit
Release Notes