protocolServerHandler.ts ×5

Frontier kind: Code frontier

unlabeled · c_303d2545b16a

2 tests · 28506 LOC · 148 files · introduces 0 tests · 19 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
5 ranges19 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
2702 ranges28506 lines · 148 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: 19 introduced LOC across 5 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/protocolServerHandler.ts 19 introduced LOC · 5 ranges

Open complete file

111
112 /** True when `value` is a non-null params object (as opposed to an array or primitive). */
113 > function isParamsObject(value: unknown): value is Record<string, unknown> { protocolServerHandler.ts
114 > return typeof value === 'object' && value !== null && !Array.isArray(value);
115 > }
116
117 /**
121 * other params shape.
122 */
123 > function readMcpChannel(params: unknown): string | undefined { protocolServerHandler.ts
124 > if (!isParamsObject(params)) {
125 return undefined;
126 }
127 > const channel = params['channel']; protocolServerHandler.ts
128 > if (typeof channel !== 'string' || !channel.startsWith('mcp://')) {
129 > return undefined;
130 > }
131 return channel;
132 }
1428 return;
1429 }
1431 > // MCP side-channel: requests targeting an `mcp://` channel carry the
1432 > // channel URI in `params.channel`. We forward them through the
1433 > // agent service, which routes by `<providerId>/<sessionId>/<serverName>`
1434 > // to the owning agent's MCP App implementation. Unknown channels and
1435 > // unknown methods are rejected with `-32601`.
1436 > const mcpChannel = readMcpChannel(params);
1437 > if (mcpChannel !== undefined) {
1438 const paramsObj = isParamsObject(params) ? params : undefined;
1439 this._agentService.handleMcpRequest(mcpChannel, method, paramsObj).then(result => {
1449 return;
1450 }
1452 > client.transport.send(jsonRpcError(id, JsonRpcErrorCodes.MethodNotFound, `Method not found: ${method}`));
1453 }
1454