mockLanguageModelToolsService.ts ×22

Frontier kind: Code frontier

unlabeled · c_1837d65db71d

99 tests · 49399 LOC · 208 files · introduces 0 tests · 72 LOC · 3 files

Introduces — evidence that enters the hierarchy at this concept

Code
25 ranges72 lines · 3 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
3750 ranges49399 lines · 208 files · Browse complete extent
All tests (intent)
99 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.

3 files ranked by introduced lines: 72 introduced LOC across 25 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

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

Open complete file

33
34 constructor() {
36 > }
37 >
38 > readonly onDidChangeTools: Event<void> = Event.None;
39 > readonly onDidPrepareToolCallBecomeUnresponsive: Event<{ sessionResource: URI; toolData: IToolData }> = Event.None;
40 > readonly onDidInvokeTool = this._onDidInvokeTool.event;
41 >
42 > fireOnDidInvokeTool(event: IToolInvokedEvent): void {
43 this._onDidInvokeTool.fire(event);
44 }
46 > registerToolData(toolData: IToolData): IDisposable {
47 return Disposable.None;
48 }
50 > resetToolAutoConfirmation(): void {
51
52 }
54 > getToolPostExecutionAutoConfirmation(toolId: string): 'workspace' | 'profile' | 'session' | 'never' {
55 return 'never';
56 }
58 > resetToolPostExecutionAutoConfirmation(): void {
59
60 }
62 > flushToolUpdates(): void {
63
64 }
66 > cancelToolCallsForRequest(requestId: string): void {
67
68 }
70 > // eslint-disable-next-line @typescript-eslint/no-explicit-any
71 > setToolAutoConfirmation(toolId: string, scope: any): void {
72
73 }
75 > getToolAutoConfirmation(toolId: string): 'never' {
76 return 'never';
77 }
79 > registerToolImplementation(name: string, tool: IToolImpl): IDisposable {
80 return Disposable.None;
81 }
83 > registerTool(toolData: IToolData, tool: IToolImpl): IDisposable {
84 return Disposable.None;
85 }
87 > getTools(): Iterable<IToolData> {
88 return [];
89 }
91 > getAllToolsIncludingDisabled(): Iterable<IToolData> {
92 return [];
93 }
95 > addRegisteredToolId(id: string): void {
96 this._registeredToolIds.add(id);
97 }
99 > getTool(id: string): IToolData | undefined {
100 if (this._registeredToolIds.has(id)) {
101 return { id, source: ToolDataSource.Internal, displayName: id, modelDescription: id };
103 return undefined;
104 }
106 > observeTools(): IObservable<readonly IToolData[]> {
107 return constObservable([]);
108 }
110 > getToolByName(name: string): IToolData | undefined {
111 return undefined;
112 }
114 > acceptProgress(sessionId: string | undefined, callId: string, progress: IProgressStep): void {
115
116 }
118 > async invokeTool(dto: IToolInvocation, countTokens: CountTokensCallback, token: CancellationToken): Promise<IToolResult> {
119 return {
120 content: [{ kind: 'text', value: 'result' }]
121 };
122 }
124 > beginToolCall(_options: IBeginToolCallOptions): IChatToolInvocation | undefined {
125 // Mock implementation - return undefined
126 return undefined;
127 }
129 > async updateToolStream(_toolCallId: string, _partialInput: unknown, _token: CancellationToken): Promise<void> {
130 // Mock implementation - do nothing
131 }
133 > toolSets: IObservable<readonly IToolSet[]> = constObservable([]);
134
135 getToolSetsForModel(model: ILanguageModelChatMetadata | undefined, reader?: IReader): Iterable<IToolSet> {
src/vs/workbench/contrib/chat/common/tools/languageModelToolsService.ts 15 introduced LOC · 2 ranges

Open complete file

500
501 constructor(
502 > readonly id: string, languageModelToolsService.ts
503 > readonly referenceName: string,
504 > readonly icon: ThemeIcon,
505 > readonly source: ToolDataSource,
506 > readonly description: string | undefined,
507 > readonly detail: string | undefined,
508 > readonly legacyFullNames: string[] | undefined,
509 > readonly deprecated: boolean | undefined,
510 > readonly hiddenInToolsPicker: boolean | undefined,
511 > private readonly _contextKeyService: IContextKeyService,
512 > ) {
513 >
514 > this.isHomogenous = derived(r => {
515 return !Iterable.some(this._tools.observable.read(r), tool => !ToolDataSource.equals(tool.source, this.source))
516 && !Iterable.some(this._toolSets.observable.read(r), toolSet => !ToolDataSource.equals(toolSet.source, this.source));
518 > }
519
520 addTool(data: IToolData, tx?: ITransaction): IDisposable {
src/vs/base/common/observableInternal/set.ts 6 introduced LOC · 1 range

Open complete file

8
9 export class ObservableSet<T> implements Set<T> {
10 > set.ts
11 > private readonly _data = new Set<T>();
12 >
13 > private _obs = observableValueOpts({ equalsFn: () => false }, this);
14 >
15 > readonly observable: IObservable<Set<T>> = this._obs;
16
17 get size(): number {