agentModelByokMeta.ts ×2

Frontier kind: Code frontier

unlabeled · c_cd2d5f6b1d9c

694 tests · 10332 LOC · 37 files · introduces 0 tests · 32 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
2 ranges32 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
638 ranges10332 lines · 37 files · Browse complete extent
All tests (intent)
694 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: 32 introduced LOC across 2 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/common/agentModelByokMeta.ts 32 introduced LOC · 2 ranges

Open complete file

1 > /*--------------------------------------------------------------------------------------------- agentModelByokMeta.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 type { SessionModelInfo } from './state/protocol/state.js';
7 > import type { IAgentModelInfo } from './agentService.js';
8 >
9 > /**
10 > * Well-known key for the renderer LM-service identifier of the BYOK model an
11 > * agent-host model is a copy of, carried under a model's open `_meta` bag (see
12 > * {@link IAgentModelInfo._meta} / {@link SessionModelInfo._meta}).
13 > *
14 > * A renderer BYOK model is registered under `<vendor>/<group>/<id>` (or `<vendor>/<id>`
15 > * without a configured group) — exactly the id the "Manage Models" view keys visibility
16 > * by. That identifier is not otherwise recoverable once the model round-trips the
17 > * agent-host bridge, so the renderer attaches it here so the chat model picker can honour
18 > * the model's visibility toggle.
19 > */
20 > export const BYOK_MODEL_IDENTIFIER_META_KEY = 'byokModelIdentifier';
21 >
22 > /**
23 > * Builds a `_meta` payload carrying the BYOK model identifier, or `undefined` when there
24 > * is none so callers can avoid attaching an empty `_meta` object.
25 > */
26 > export function createAgentModelByokMeta(modelIdentifier: string | undefined): Record<string, unknown> | undefined {
27 return modelIdentifier !== undefined ? { [BYOK_MODEL_IDENTIFIER_META_KEY]: modelIdentifier } : undefined;
28 }
30 > /**
31 > * Reads the BYOK model identifier from a model's open `_meta` bag, ignoring unrelated
32 > * keys and values of the wrong type.
33 > */
34 > export function readAgentModelByokIdentifier(model: IAgentModelInfo | SessionModelInfo): string | undefined {
35 const meta = model._meta;
36 if (!meta) {