sessionServerTools.ts ×5

Frontier kind: Code frontier

unlabeled · c_d84c02aa1018

4 tests · 21767 LOC · 87 files · introduces 0 tests · 28 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
5 ranges28 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1837 ranges21767 lines · 87 files · Browse complete extent
All tests (intent)
4 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 5 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/shared/sessionServerTools.ts 28 introduced LOC · 5 ranges

Open complete file

393 }
394
395 > function getOptionalBoolean(value: unknown, field: string, toolName: string): boolean | undefined { sessionServerTools.ts
396 > if (value === undefined) {
397 > return undefined;
398 > }
399 if (typeof value !== 'boolean') {
400 throw new Error(`Invalid ${toolName} input: ${field} must be a boolean.`);
403 }
404
405 > function getOptionalTimestamp(value: unknown, field: string, toolName: string): number | undefined { sessionServerTools.ts
406 > if (value === undefined) {
407 > return undefined;
408 > }
409 if (typeof value !== 'string') {
410 throw new Error(`Invalid ${toolName} input: ${field} must be an ISO-8601 timestamp string.`);
419 /** Validates and normalizes the optional `list_sessions` filter arguments. */
420 export function getListSessionsArgs(rawArgs: unknown): IListSessionsArgs {
421 > const args = (rawArgs ?? {}) as { session?: unknown; status?: unknown; workspace?: unknown; withChanges?: unknown; unread?: unknown; withPullRequest?: unknown; includeArchived?: unknown; createdAfter?: unknown; createdBefore?: unknown }; sessionServerTools.ts
422 >
423 > let status: Set<string> | undefined;
424 > if (args.status !== undefined) {
425 if (!Array.isArray(args.status) || args.status.some(value => typeof value !== 'string')) {
426 throw new Error(`Invalid ${listSessionsToolName} input: status must be an array of status names.`);
432 status = new Set(args.status as string[]);
433 }
435 > return {
436 > session: getOptionalString(args.session, 'session', listSessionsToolName),
437 > status,
438 > workspace: getOptionalString(args.workspace, 'workspace', listSessionsToolName),
439 > withChanges: getOptionalBoolean(args.withChanges, 'withChanges', listSessionsToolName),
440 > unread: getOptionalBoolean(args.unread, 'unread', listSessionsToolName),
441 > withPullRequest: getOptionalBoolean(args.withPullRequest, 'withPullRequest', listSessionsToolName),
442 > includeArchived: getOptionalBoolean(args.includeArchived, 'includeArchived', listSessionsToolName),
443 > createdAfter: getOptionalTimestamp(args.createdAfter, 'createdAfter', listSessionsToolName),
444 > createdBefore: getOptionalTimestamp(args.createdBefore, 'createdBefore', listSessionsToolName),
445 > };
446 > }
447
448 /** Whether a session has any pending worktree changes (insertions, deletions, or changed files). */
472 /** Applies the {@link IListSessionsArgs} filters to a set of sessions. */
473 export function filterSessions(sessions: readonly IAgentSessionMetadata[], args: IListSessionsArgs): readonly IAgentSessionMetadata[] {
474 > // A direct `session` lookup returns just that session, bypassing the other sessionServerTools.ts
475 > // filters (including the default archived exclusion).
476 > if (args.session !== undefined) {
477 const target = parseOpenSessionLinkUri(args.session)?.toString() ?? args.session;
478 return sessions.filter(session => session.session.toString() === target);