chatModes.ts ×8

Frontier kind: Joint frontier

unlabeled · c_049b8c19d553

6 tests · 50595 LOC · 228 files · introduces 1 test · 38 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
8 ranges38 lines · 1 files
Tests
1 test

Contains — complete concept membership

All code (extent)
4353 ranges50595 lines · 228 files · Browse complete extent
All tests (intent)
6 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.

1 test introduced at this concept.

Introduced code

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

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

src/vs/workbench/contrib/chat/common/chatModes.ts 38 introduced LOC · 8 ranges

Open complete file

112 // When the harness service is the source, also react to its change events for our session type.
113 this._register(this.customizationHarnessService.onDidChangeCustomAgents(e => {
114 > if (e.sessionType === sessionType) { chatModes.ts
115 > this._pendingRefresh = this.triggerRefresh();
116 > }
117 }));
118 this._register(this.storageService.onWillSaveState(() => this.saveCachedModes()));
252 const seenUris = new Set<string>();
253 for (const customMode of customModes) {
254 > if (!customMode.visibility.userInvocable || !customMode.enabled) { chatModes.ts
255 continue;
256 }
257 > chatModes.ts
258 > const uriString = customMode.uri.toString();
259 > seenUris.add(uriString);
260 >
261 > let modeInstance = this._customModeInstances.get(uriString);
262 > if (modeInstance) {
263 // Update existing instance with new data
264 if (modeInstance.updateData(customMode)) {
265 hasChanges = true;
266 }
267 > } else { chatModes.ts
268 > // Create new instance
269 > modeInstance = new CustomChatMode(customMode);
270 > this._customModeInstances.set(uriString, modeInstance);
271 > hasChanges = true;
272 > }
273 > }
274
275 // Clean up instances for modes that no longer exist
276 for (const [uriString] of this._customModeInstances.entries()) {
277 > if (!seenUris.has(uriString)) { chatModes.ts
278 this._customModeInstances.delete(uriString);
279 hasChanges = true;
280 }
281 > } chatModes.ts
282
283 this.hasCustomModes.set(this._customModeInstances.size > 0);
292 }
293 if (hasChanges) {
294 > this._onDidChange.fire(); chatModes.ts
295 > }
296 }
297
546
547 constructor(
548 > customChatMode: ICustomAgent chatModes.ts
549 > ) {
550 > this.id = customChatMode.uri.toString();
551 > this._nameObservable = observableValue('name', customChatMode.name);
552 > this._descriptionObservable = observableValue('description', customChatMode.description);
553 > this._customToolsObservable = observableValue('customTools', customChatMode.tools);
554 > this._modelObservable = observableValue('model', customChatMode.model);
555 > this._argumentHintObservable = observableValue('argumentHint', customChatMode.argumentHint);
556 > this._handoffsObservable = observableValue('handOffs', customChatMode.handOffs);
557 > this._targetObservable = observableValue('target', customChatMode.target);
558 > this._visibilityObservable = observableValue('visibility', customChatMode.visibility);
559 > this._agentsObservable = observableValue('agents', customChatMode.agents);
560 > this._modeInstructions = observableValue('_modeInstructions', customChatMode.agentInstructions);
561 > this._uriObservable = observableValue('uri', customChatMode.uri);
562 > this._source = customChatMode.source;
563 > this._sessionTypes = customChatMode.sessionTypes;
564 > }
565
566 /**