sessionServerTools.ts ×14

Frontier kind: Joint frontier

unlabeled · c_bd0aefbc3288

1 test · 22222 LOC · 87 files · introduces 1 test · 38 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
14 ranges38 lines · 1 files
Tests
1 test

Contains — complete concept membership

All code (extent)
2007 ranges22222 lines · 87 files · Browse complete extent
All tests (intent)
1 testBrowse 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 14 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/shared/sessionServerTools.ts 38 introduced LOC · 14 ranges

Open complete file

400 throw new Error(`Invalid ${toolName} input: ${field} must be a boolean.`);
401 }
402 > return value; sessionServerTools.ts
403 > }
404
405 function getOptionalTimestamp(value: unknown, field: string, toolName: string): number | undefined {
414 throw new Error(`Invalid ${toolName} input: ${field} must be a valid ISO-8601 timestamp (e.g. 2025-01-31T00:00:00Z).`);
415 }
416 > return parsed; sessionServerTools.ts
417 > }
418
419 /** Validates and normalizes the optional `list_sessions` filter arguments. */
430 throw new Error(`Invalid ${listSessionsToolName} input: unknown status value(s) ${invalid.join(', ')}. Valid values: ${listSessionsStatusValues.join(', ')}.`);
431 }
432 > status = new Set(args.status as string[]); sessionServerTools.ts
433 > }
434
435 return {
447
448 /** Whether a session has any pending worktree changes (insertions, deletions, or changed files). */
449 > function sessionHasChanges(session: IAgentSessionMetadata): boolean { sessionServerTools.ts
450 > const changes = session.changes;
451 > return !!changes && ((changes.files ?? 0) > 0 || (changes.additions ?? 0) > 0 || (changes.deletions ?? 0) > 0);
452 > }
453
454 /** Whether a session is archived (either the metadata flag or the status bit). */
458
459 /** Whether a session's working directory matches the given folder (absolute path or URI). */
460 > function sessionMatchesWorkspace(session: IAgentSessionMetadata, workspace: string): boolean { sessionServerTools.ts
461 > const dir = session.workingDirectory;
462 > if (!dir) {
463 return false;
464 }
465 > if (dir.toString() === workspace || dir.fsPath === workspace) { sessionServerTools.ts
466 > return true;
467 > }
468 > const parsed = parseWorkspaceUri(workspace);
469 > return !!parsed && parsed.toString() === dir.toString();
470 > }
471
472 /** Applies the {@link IListSessionsArgs} filters to a set of sessions. */
480 return sessions.filter(session => {
481 if (args.status) {
482 > const names = describeSessionStatusNames(session); sessionServerTools.ts
483 > if (!names.some(name => args.status!.has(name))) {
484 > return false;
485 > }
486 > }
487 if (args.workspace !== undefined && !sessionMatchesWorkspace(session, args.workspace)) {
488 > return false; sessionServerTools.ts
489 > }
490 if (args.withChanges && !sessionHasChanges(session)) {
491 > return false; sessionServerTools.ts
492 > }
493 if (args.unread && session.isRead !== false) {
494 > return false; sessionServerTools.ts
495 > }
496 if (args.withPullRequest && !readSessionGitHubState(session._meta)?.pullRequestUrl) {
497 > return false; sessionServerTools.ts
498 > }
499 // Archived sessions are hidden unless explicitly requested, either via
500 // `includeArchived` or by asking for the `archived` status directly.
501 if (args.includeArchived !== true && !args.status?.has('archived') && sessionIsArchived(session)) {
502 > return false; sessionServerTools.ts
503 > }
504 if (args.createdAfter !== undefined && session.startTime < args.createdAfter) {
505 > return false; sessionServerTools.ts
506 > }
507 if (args.createdBefore !== undefined && session.startTime > args.createdBefore) {
508 > return false; sessionServerTools.ts
509 > }
510 return true;
511 });