-
Notifications
You must be signed in to change notification settings - Fork 94
[Server] Rework registry to combine provider and registry interface, move capabilities out and enable Registry injection in Builder #150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
adb9c93 to
39edab4
Compare
39edab4 to
075dda0
Compare
…bilities out and enable Registry injection in Builder
075dda0 to
819b311
Compare
|
@soyuka & @camilleislasse we would merge that instead of #75 and #146 - does that work for the use-cases you have in mind? |
soyuka
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice I like that we take the capabilities out of the registry.
| public function getTool(string $name): ToolReference | ||
| { | ||
| return $this->tools[$name] ?? throw new ToolNotFoundException($name); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it'd be nice for reviewing to keep the previous order of methods :D.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea fair, i think we're currently a bit rough with PR scopes 😬
| $cursor, | ||
| $limit | ||
| ); | ||
| throw new ResourceNotFoundException($uri); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
weird to log and to throw ?
| if ($includeTemplates) { | ||
| foreach ($this->resourceTemplates as $template) { | ||
| if ($template->matches($uri)) { | ||
| return $template; | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if ($includeTemplates) { | |
| foreach ($this->resourceTemplates as $template) { | |
| if ($template->matches($uri)) { | |
| return $template; | |
| } | |
| } | |
| if (!$includeTemplates) { | |
| throw new ResourceNotFoundException($uri); | |
| } | |
| foreach ($this->resourceTemplates as $template) { | |
| if ($template->matches($uri)) { | |
| return $template; | |
| } | |
| } |
Now that modelcontextprotocol/php-sdk#150 is merged, the Registry can be injected directly into the Builder. This allows replacing the ProfilingLoader with a cleaner TraceableRegistry decorator pattern.
Alternative to #146
Outer interface does not change => no docs changes required
Fixes #74