You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Drop the isManual flag from ElementReference and the discovery-state methods
from RegistryInterface. The Registry becomes a flat last-write-wins map;
DiscoveryLoader owns its own owned-set bookkeeping so re-running discovery
only removes elements it itself contributed. Adds ChainLoader for explicit
composition. Manual-over-discovered precedence is preserved via loader
ordering, not a flag on the reference.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
*`DiscoveryLoader` now refreshes only its own previously written entries; manual registrations (via `Builder::addTool()` etc. or runtime `$registry->registerTool()` calls) survive rediscovery, and a same-name manual registration takes precedence over discovery on collision.
12
+
*[BC Break] Removed `ElementReference::$isManual` public property and the `bool $isManual` parameter from all `*Reference` constructors. Origin tracking is no longer carried on the element; manual-over-discovered precedence is encoded by loader execution order.
13
+
*[BC Break]`RegistryInterface::registerTool()`, `registerResource()`, `registerResourceTemplate()`, `registerPrompt()` lost their trailing `bool $isManual = false` parameter. Callers using positional arguments must drop the flag.
14
+
*[BC Break] Removed `RegistryInterface::clear()`, `getDiscoveryState()`, `setDiscoveryState()`. Rediscovery now goes through `DiscoveryLoader::load()` directly.
15
+
*`Registry::register*()` semantics changed to plain last-write-wins (overwrites silently). The previous "discovered registration is ignored when a manual one already exists" debug-logged skip is gone — order your loaders to encode precedence instead.
if ($existing && !$isManual && $existing->isManual) {
77
-
$this->logger->debug(
78
-
\sprintf('Ignoring discovered tool "%s" as it conflicts with a manually registered one.', $toolName),
79
-
);
80
-
81
-
return;
82
-
}
83
-
84
-
if (!$this->nameValidator->isValid($toolName)) {
72
+
if (!$this->nameValidator->isValid($tool->name)) {
85
73
$this->logger->warning(
86
-
\sprintf('Tool name "%s" is invalid. Tool names should only contain letters (a-z, A-Z), numbers, dots, hyphens, underscores, and forward slashes.', $toolName),
74
+
\sprintf('Tool name "%s" is invalid. Tool names should only contain letters (a-z, A-Z), numbers, dots, hyphens, underscores, and forward slashes.', $tool->name),
0 commit comments