copilotAgentSession.ts ×8

Frontier kind: Code frontier

unlabeled · c_896eeaa7b49b

2 tests · 43798 LOC · 243 files · introduces 0 tests · 28 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
8 ranges28 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
4025 ranges43798 lines · 243 files · Browse complete extent
All tests (intent)
2 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: 28 introduced LOC across 8 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts 28 introduced LOC · 8 ranges

Open complete file

213 case 'integer':
214 case 'number':
215 > return { copilotAgentSession.ts
216 > ...base,
217 > kind: field.type === 'integer' ? ChatInputQuestionKind.Integer : ChatInputQuestionKind.Number,
218 > min: field.minimum,
219 > max: field.maximum,
220 > defaultValue: field.default,
221 > };
222 case 'array': {
223 const options: ChatInputOption[] = hasKey(field.items, { enum: true })
233 }
234 case 'string': {
235 > if (hasKey(field, { enum: true })) { copilotAgentSession.ts
236 const enumNames = field.enumNames;
237 const options: ChatInputOption[] = field.enum.map((value, idx) => ({ id: value, label: enumNames?.[idx] ?? value }));
238 return { ...base, kind: ChatInputQuestionKind.SingleSelect, options };
239 }
240 > if (hasKey(field, { oneOf: true })) { copilotAgentSession.ts
241 const options: ChatInputOption[] = field.oneOf.map(option => ({ id: option.const, label: option.title }));
242 return { ...base, kind: ChatInputQuestionKind.SingleSelect, options };
243 }
244 > return { copilotAgentSession.ts
245 > ...base,
246 > kind: ChatInputQuestionKind.Text,
247 > format: field.format,
248 > min: field.minLength,
249 > max: field.maxLength,
250 > defaultValue: field.default,
251 > };
252 > }
253 }
254 }
260 * cannot be coerced to the field's declared type.
261 */
262 > function elicitationAnswerToFieldValue(field: ElicitationSchemaField, answer: ChatInputAnswer | undefined): ElicitationFieldValue | undefined { copilotAgentSession.ts
263 > if (!answer || answer.state === ChatInputAnswerState.Skipped) {
264 return undefined;
265 }
274 return undefined;
275 }
276 > if (field.type === 'number' || field.type === 'integer') { copilotAgentSession.ts
277 if (value.kind === ChatInputAnswerValueKind.Number) {
278 return field.type === 'integer' ? Math.trunc(value.value) : value.value;
2816 return { action: 'accept' };
2817 }
2818 > const content: Record<string, ElicitationFieldValue> = {}; copilotAgentSession.ts
2819 > for (const [fieldName, field] of Object.entries(schema.properties)) {
2820 > const value = elicitationAnswerToFieldValue(field, answers[fieldName]);
2821 > if (value !== undefined) {
2822 content[fieldName] = value;
2823 }
2825 > return { action: 'accept', content };
2826 > } catch (error) {
2827 this._logService.error(error, `[Copilot:${this.sessionId}] Failed to handle elicitation request: message="${messagePreview}"`);
2828 throw error;