Disallow Object.create() and reflect. (#22408)

This commit is contained in:
Christian Gunderman
2026-03-16 16:24:27 +00:00
committed by GitHub
parent e3df87cf1a
commit ef5627eece
9 changed files with 229 additions and 66 deletions

View File

@@ -233,6 +233,15 @@ export class ToolRegistry {
return this.messageBus;
}
/**
* Creates a shallow clone of the registry and its current known tools.
*/
clone(): ToolRegistry {
const clone = new ToolRegistry(this.config, this.messageBus);
clone.allKnownTools = new Map(this.allKnownTools);
return clone;
}
/**
* Registers a tool definition.
*