mockLanguageModelToolsService.ts ×15

Frontier kind: Code frontier

unlabeled · c_210a8e5d8de9

108 tests · 49190 LOC · 208 files · introduces 0 tests · 61 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
15 ranges61 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
3691 ranges49190 lines · 208 files · Browse complete extent
All tests (intent)
108 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

1 file ranked by introduced lines: 61 introduced LOC across 15 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/workbench/contrib/chat/test/common/tools/mockLanguageModelToolsService.ts 61 introduced LOC · 15 ranges

Open complete file

1 > /*--------------------------------------------------------------------------------------------- mockLanguageModelToolsService.ts
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 { CancellationToken } from '../../../../../../base/common/cancellation.js';
7 > import { Codicon } from '../../../../../../base/common/codicons.js';
8 > import { Emitter, Event } from '../../../../../../base/common/event.js';
9 > import { Disposable, IDisposable } from '../../../../../../base/common/lifecycle.js';
10 > import { constObservable, IObservable, IReader } from '../../../../../../base/common/observable.js';
11 > import { ThemeIcon } from '../../../../../../base/common/themables.js';
12 > import { URI } from '../../../../../../base/common/uri.js';
13 > import { MockContextKeyService } from '../../../../../../platform/keybinding/test/common/mockKeybindingService.js';
14 > import { IProgressStep } from '../../../../../../platform/progress/common/progress.js';
15 > import { ChatRequestToolReferenceEntry } from '../../../common/attachments/chatVariableEntries.js';
16 > import { IVariableReference } from '../../../common/chatModes.js';
17 > import { IChatToolInvocation } from '../../../common/chatService/chatService.js';
18 > import { ILanguageModelChatMetadata } from '../../../common/languageModels.js';
19 > import { CountTokensCallback, IBeginToolCallOptions, ILanguageModelToolsService, ToolAndToolSetEnablementMap, IToolData, IToolImpl, IToolInvocation, IToolInvokedEvent, IToolResult, IToolSet, ToolDataSource, ToolSet } from '../../../common/tools/languageModelToolsService.js';
20 >
21 > export class MockLanguageModelToolsService extends Disposable implements ILanguageModelToolsService {
22 > _serviceBrand: undefined;
23 > vscodeToolSet: ToolSet = new ToolSet('vscode', 'vscode', ThemeIcon.fromId(Codicon.code.id), ToolDataSource.Internal, undefined, undefined, undefined, undefined, undefined, new MockContextKeyService());
24 > executeToolSet: ToolSet = new ToolSet('execute', 'execute', ThemeIcon.fromId(Codicon.terminal.id), ToolDataSource.Internal, undefined, undefined, undefined, undefined, undefined, new MockContextKeyService());
25 > readToolSet: ToolSet = new ToolSet('read', 'read', ThemeIcon.fromId(Codicon.book.id), ToolDataSource.Internal, undefined, undefined, undefined, undefined, undefined, new MockContextKeyService());
26 > agentToolSet: ToolSet = new ToolSet('agent', 'agent', ThemeIcon.fromId(Codicon.agent.id), ToolDataSource.Internal, undefined, undefined, undefined, undefined, undefined, new MockContextKeyService());
27 >
28 > private readonly _onDidInvokeTool = this._register(new Emitter<IToolInvokedEvent>());
29 >
30 > private readonly _registeredToolIds = new Set<string>();
31 > private readonly _registeredToolSetNames = new Set<string>();
32 > private readonly _toolSetTools = new Map<string, IToolData[]>();
33 >
34 > constructor() {
35 super();
36 }
132
133 toolSets: IObservable<readonly IToolSet[]> = constObservable([]);
135 > getToolSetsForModel(model: ILanguageModelChatMetadata | undefined, reader?: IReader): Iterable<IToolSet> {
136 return [];
137 }
139 > addRegisteredToolSetName(name: string, tools?: IToolData[]): void {
140 this._registeredToolSetNames.add(name);
141 if (tools) {
143 }
144 }
146 > getToolSetByName(name: string): IToolSet | undefined {
147 if (this._registeredToolSetNames.has(name)) {
148 const tools = this._toolSetTools.get(name) ?? [];
151 return undefined;
152 }
154 > getToolSet(id: string): IToolSet | undefined {
155 return undefined;
156 }
158 > createToolSet(): ToolSet & IDisposable {
159 throw new Error('Method not implemented.');
160 }
162 > toToolAndToolSetEnablementMap(toolOrToolSetNames: readonly string[]): ToolAndToolSetEnablementMap {
163 throw new Error('Method not implemented.');
164 }
166 > toToolReferences(variableReferences: readonly IVariableReference[]): ChatRequestToolReferenceEntry[] {
167 throw new Error('Method not implemented.');
168 }
170 > getFullReferenceNames(): Iterable<string> {
171 throw new Error('Method not implemented.');
172 }
174 > getToolByFullReferenceName(qualifiedName: string): IToolData | IToolSet | undefined {
175 throw new Error('Method not implemented.');
176 }
178 > getFullReferenceName(tool: IToolData | IToolSet, set?: IToolSet): string {
179 throw new Error('Method not implemented.');
180 }
182 > getFullReferenceNameMap(): Map<IToolData | IToolSet, string> {
183 throw new Error('Method not implemented.');
184 }
186 > toFullReferenceNames(map: ToolAndToolSetEnablementMap): string[] {
187 throw new Error('Method not implemented.');
188 }
190 > getDeprecatedFullReferenceNames(): Map<string, Set<string>> {
191 throw new Error('Method not implemented.');
192 }