mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-14 13:53:02 -07:00
feat(cli): Partial threading of AgentLoopContext. (#22978)
This commit is contained in:
@@ -21,7 +21,7 @@ const agentsListCommand: SlashCommand = {
|
||||
kind: CommandKind.BUILT_IN,
|
||||
autoExecute: true,
|
||||
action: async (context: CommandContext) => {
|
||||
const { config } = context.services;
|
||||
const config = context.services.agentContext?.config;
|
||||
if (!config) {
|
||||
return {
|
||||
type: 'message',
|
||||
@@ -61,7 +61,8 @@ async function enableAction(
|
||||
context: CommandContext,
|
||||
args: string,
|
||||
): Promise<SlashCommandActionReturn | void> {
|
||||
const { config, settings } = context.services;
|
||||
const config = context.services.agentContext?.config;
|
||||
const { settings } = context.services;
|
||||
if (!config) {
|
||||
return {
|
||||
type: 'message',
|
||||
@@ -137,7 +138,8 @@ async function disableAction(
|
||||
context: CommandContext,
|
||||
args: string,
|
||||
): Promise<SlashCommandActionReturn | void> {
|
||||
const { config, settings } = context.services;
|
||||
const config = context.services.agentContext?.config;
|
||||
const { settings } = context.services;
|
||||
if (!config) {
|
||||
return {
|
||||
type: 'message',
|
||||
@@ -216,7 +218,7 @@ async function configAction(
|
||||
context: CommandContext,
|
||||
args: string,
|
||||
): Promise<SlashCommandActionReturn | void> {
|
||||
const { config } = context.services;
|
||||
const config = context.services.agentContext?.config;
|
||||
if (!config) {
|
||||
return {
|
||||
type: 'message',
|
||||
@@ -266,7 +268,8 @@ async function configAction(
|
||||
}
|
||||
|
||||
function completeAgentsToEnable(context: CommandContext, partialArg: string) {
|
||||
const { config, settings } = context.services;
|
||||
const config = context.services.agentContext?.config;
|
||||
const { settings } = context.services;
|
||||
if (!config) return [];
|
||||
|
||||
const overrides = settings.merged.agents.overrides;
|
||||
@@ -278,7 +281,7 @@ function completeAgentsToEnable(context: CommandContext, partialArg: string) {
|
||||
}
|
||||
|
||||
function completeAgentsToDisable(context: CommandContext, partialArg: string) {
|
||||
const { config } = context.services;
|
||||
const config = context.services.agentContext?.config;
|
||||
if (!config) return [];
|
||||
|
||||
const agentRegistry = config.getAgentRegistry();
|
||||
@@ -287,7 +290,7 @@ function completeAgentsToDisable(context: CommandContext, partialArg: string) {
|
||||
}
|
||||
|
||||
function completeAllAgents(context: CommandContext, partialArg: string) {
|
||||
const { config } = context.services;
|
||||
const config = context.services.agentContext?.config;
|
||||
if (!config) return [];
|
||||
|
||||
const agentRegistry = config.getAgentRegistry();
|
||||
@@ -328,7 +331,7 @@ const agentsReloadCommand: SlashCommand = {
|
||||
description: 'Reload the agent registry',
|
||||
kind: CommandKind.BUILT_IN,
|
||||
action: async (context: CommandContext) => {
|
||||
const { config } = context.services;
|
||||
const config = context.services.agentContext?.config;
|
||||
const agentRegistry = config?.getAgentRegistry();
|
||||
if (!agentRegistry) {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user