mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-01 23:44:15 -07:00
feat(core): restore MessageBus optionality for soft migration (Phase 1) (#15774)
This commit is contained in:
@@ -172,7 +172,7 @@ Signal: Signal number or \`(none)\` if no signal was received.
|
||||
|
||||
protected createInvocation(
|
||||
params: ToolParams,
|
||||
_messageBus?: MessageBus,
|
||||
messageBus?: MessageBus,
|
||||
_toolName?: string,
|
||||
_displayName?: string,
|
||||
): ToolInvocation<ToolParams, ToolResult> {
|
||||
@@ -181,7 +181,7 @@ Signal: Signal number or \`(none)\` if no signal was received.
|
||||
this.originalName,
|
||||
this.name,
|
||||
params,
|
||||
_messageBus,
|
||||
messageBus,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -194,11 +194,8 @@ export class ToolRegistry {
|
||||
private config: Config;
|
||||
private messageBus?: MessageBus;
|
||||
|
||||
constructor(config: Config) {
|
||||
constructor(config: Config, messageBus?: MessageBus) {
|
||||
this.config = config;
|
||||
}
|
||||
|
||||
setMessageBus(messageBus: MessageBus): void {
|
||||
this.messageBus = messageBus;
|
||||
}
|
||||
|
||||
@@ -206,6 +203,15 @@ export class ToolRegistry {
|
||||
return this.messageBus;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated migration only - will be removed in PR 3 (Enforcement)
|
||||
* TODO: DELETE ME in PR 3. This is a temporary shim to allow for soft migration
|
||||
* of tools while the core infrastructure is updated to require a MessageBus at birth.
|
||||
*/
|
||||
setMessageBus(messageBus: MessageBus): void {
|
||||
this.messageBus = messageBus;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a tool definition.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user