feat(plan): add 'communicate' tool kind (#17341)

This commit is contained in:
Jerop Kipruto
2026-01-22 16:38:15 -05:00
committed by GitHub
parent 62dd9b5b3c
commit 50985d38c4
3 changed files with 28 additions and 4 deletions
@@ -31,6 +31,7 @@ import {
resolveModel, resolveModel,
createWorkingStdio, createWorkingStdio,
startupProfiler, startupProfiler,
Kind,
} from '@google/gemini-cli-core'; } from '@google/gemini-cli-core';
import * as acp from '@agentclientprotocol/sdk'; import * as acp from '@agentclientprotocol/sdk';
import { AcpFileSystemService } from './fileSystemService.js'; import { AcpFileSystemService } from './fileSystemService.js';
@@ -463,7 +464,7 @@ export class Session {
title: invocation.getDescription(), title: invocation.getDescription(),
content, content,
locations: invocation.toolLocations(), locations: invocation.toolLocations(),
kind: tool.kind, kind: toAcpToolKind(tool.kind),
}, },
}; };
@@ -502,7 +503,7 @@ export class Session {
title: invocation.getDescription(), title: invocation.getDescription(),
content: [], content: [],
locations: invocation.toolLocations(), locations: invocation.toolLocations(),
kind: tool.kind, kind: toAcpToolKind(tool.kind),
}); });
} }
@@ -798,7 +799,7 @@ export class Session {
title: invocation.getDescription(), title: invocation.getDescription(),
content: [], content: [],
locations: invocation.toolLocations(), locations: invocation.toolLocations(),
kind: readManyFilesTool.kind, kind: toAcpToolKind(readManyFilesTool.kind),
}); });
const result = await invocation.execute(abortSignal); const result = await invocation.execute(abortSignal);
@@ -988,3 +989,25 @@ function toPermissionOptions(
} }
} }
} }
/**
* Maps our internal tool kind to the ACP ToolKind.
* Fallback to 'other' for kinds that are not supported by the ACP protocol.
*/
function toAcpToolKind(kind: Kind): acp.ToolKind {
switch (kind) {
case Kind.Read:
case Kind.Edit:
case Kind.Delete:
case Kind.Move:
case Kind.Search:
case Kind.Execute:
case Kind.Think:
case Kind.Fetch:
case Kind.Other:
return kind as acp.ToolKind;
case Kind.Communicate:
default:
return 'other';
}
}
+1 -1
View File
@@ -35,7 +35,7 @@ export class AskUserTool extends BaseDeclarativeTool<
ASK_USER_TOOL_NAME, ASK_USER_TOOL_NAME,
'Ask User', 'Ask User',
'Ask the user one or more questions to gather preferences, clarify requirements, or make decisions.', 'Ask the user one or more questions to gather preferences, clarify requirements, or make decisions.',
Kind.Other, Kind.Communicate,
{ {
type: 'object', type: 'object',
required: ['questions'], required: ['questions'],
+1
View File
@@ -745,6 +745,7 @@ export enum Kind {
Execute = 'execute', Execute = 'execute',
Think = 'think', Think = 'think',
Fetch = 'fetch', Fetch = 'fetch',
Communicate = 'communicate',
Other = 'other', Other = 'other',
} }