Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/extensions/copilot/src/extension/agentDebug/common/toolResultRenderer.ts
13399 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { createServiceIdentifier } from '../../../util/common/services';
7
8
export const IToolResultContentRenderer = createServiceIdentifier<IToolResultContentRenderer>('IToolResultContentRenderer');
9
10
/**
11
* Renders tool result content parts into human-readable strings.
12
* Injected from the vscode-node layer to avoid layering violations
13
* (the rendering depends on @vscode/prompt-tsx which lives in vscode-node).
14
*/
15
export interface IToolResultContentRenderer {
16
readonly _serviceBrand: undefined;
17
18
/**
19
* Extracts a text representation from the content parts of a tool result.
20
* Handles LanguageModelTextPart, LanguageModelPromptTsxPart, and LanguageModelDataPart.
21
* Uses lightweight string conversion to avoid expensive rendering on the hot path.
22
*/
23
renderToolResultContent(content: Iterable<unknown>): string[];
24
}
25
26