feat: add DynamicToolRegistry for hot-loadable tool extensions#1
Closed
AP3X-Dev wants to merge 1 commit into
Closed
feat: add DynamicToolRegistry for hot-loadable tool extensions#1AP3X-Dev wants to merge 1 commit into
AP3X-Dev wants to merge 1 commit into
Conversation
Introduces a mutable handler map that sits behind a single compiled StateGraph node. Extensions register/unregister at runtime without recompiling the graph — the topology never changes. - DynamicToolRegistry class with register, unregister, list, has, asNode (StateGraph-compatible node fn), asSchema (OpenAI format) - ToolHandler / ToolResult types - Subpath export at @oni.bot/core/registry - 18 tests across 4 files covering execution, unknown-tool error handling, lifecycle, and schema output
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.
Summary
DynamicToolRegistry— a mutable handler map behind a single compiledStateGraphnode, allowing tool extensions to be registered/unregistered at runtime without recompiling the graphToolHandlerandToolResulttypes,asNode()for graph integration, andasSchema()for OpenAI-format tool definitions@oni.bot/core/registry(opt-in, not added to root barrel)Test plan
register-and-execute.test.ts— register a tool, execute via node, verify result in messages (4 tests)unknown-tool.test.ts— call unregistered tool, verify structured error returned not thrown (3 tests)register-unregister.test.ts— lifecycle: register, unregister, hot-swap, list/has reflection (6 tests)schema-output.test.ts— 3 tools with different arg shapes, validate JSON schema output (4 tests)tsc --noEmit)Summary by CodeRabbit
New Features
Documentation