mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-06 11:21:15 -07:00
feat(core,cli): enforce mandatory MessageBus injection (Phase 3 Hard Migration) (#15776)
This commit is contained in:
@@ -47,7 +47,7 @@ class MockToolInvocation extends BaseToolInvocation<
|
||||
constructor(
|
||||
private readonly tool: MockTool,
|
||||
params: { [key: string]: unknown },
|
||||
messageBus?: MessageBus,
|
||||
messageBus: MessageBus,
|
||||
) {
|
||||
super(params, messageBus, tool.name, tool.displayName);
|
||||
}
|
||||
@@ -98,9 +98,9 @@ export class MockTool extends BaseDeclarativeTool<
|
||||
options.description ?? options.name,
|
||||
Kind.Other,
|
||||
options.params,
|
||||
options.messageBus ?? createMockMessageBus(),
|
||||
options.isOutputMarkdown ?? false,
|
||||
options.canUpdateOutput ?? false,
|
||||
options.messageBus ?? createMockMessageBus(),
|
||||
);
|
||||
|
||||
if (options.shouldConfirmExecute) {
|
||||
@@ -122,11 +122,11 @@ export class MockTool extends BaseDeclarativeTool<
|
||||
|
||||
protected createInvocation(
|
||||
params: { [key: string]: unknown },
|
||||
messageBus?: MessageBus,
|
||||
messageBus: MessageBus,
|
||||
_toolName?: string,
|
||||
_toolDisplayName?: string,
|
||||
): ToolInvocation<{ [key: string]: unknown }, ToolResult> {
|
||||
return new MockToolInvocation(this, params, messageBus ?? this.messageBus);
|
||||
return new MockToolInvocation(this, params, messageBus);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ export class MockModifiableToolInvocation extends BaseToolInvocation<
|
||||
constructor(
|
||||
private readonly tool: MockModifiableTool,
|
||||
params: Record<string, unknown>,
|
||||
messageBus?: MessageBus,
|
||||
messageBus: MessageBus,
|
||||
) {
|
||||
super(params, messageBus, tool.name, tool.displayName);
|
||||
}
|
||||
@@ -207,9 +207,9 @@ export class MockModifiableTool
|
||||
type: 'object',
|
||||
properties: { param: { type: 'string' } },
|
||||
},
|
||||
createMockMessageBus(),
|
||||
true,
|
||||
false,
|
||||
createMockMessageBus(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -230,14 +230,10 @@ export class MockModifiableTool
|
||||
|
||||
protected createInvocation(
|
||||
params: Record<string, unknown>,
|
||||
messageBus?: MessageBus,
|
||||
messageBus: MessageBus,
|
||||
_toolName?: string,
|
||||
_toolDisplayName?: string,
|
||||
): ToolInvocation<Record<string, unknown>, ToolResult> {
|
||||
return new MockModifiableToolInvocation(
|
||||
this,
|
||||
params,
|
||||
messageBus ?? this.messageBus,
|
||||
);
|
||||
return new MockModifiableToolInvocation(this, params, messageBus);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user