sessionServerTools.ts ×3

Frontier kind: Joint frontier

unlabeled · c_2fc5939970a8

1 test · 21924 LOC · 87 files · introduces 1 test · 22 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
3 ranges22 lines · 1 files
Tests
1 test

Contains — complete concept membership

All code (extent)
1892 ranges21924 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: 22 introduced LOC across 3 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/shared/sessionServerTools.ts 22 introduced LOC · 3 ranges

Open complete file

706 */
707 export function getSendMessageArgs(rawArgs: unknown, sessions: readonly IAgentSessionMetadata[]): IResolvedSendMessageArgs {
708 > const args = (rawArgs ?? {}) as ISendMessageArgs; sessionServerTools.ts
709 > const message = getRequiredString(args.message, 'message', sendMessageToolName);
710 > const sessionInput = getRequiredString(args.session, 'session', sendMessageToolName);
711 > const session = resolveKnownSession(sessionInput, sessions);
712 > if (!session) {
713 > throw new Error(`Invalid ${sendMessageToolName} input: session must match the URI of a known session (see list_sessions).`);
714 > }
715 > const chatId = parseOpenSessionLinkChatId(sessionInput);
716 > const chat = URI.parse(chatId ? buildChatUri(session.toString(), chatId) : buildDefaultChatUri(session.toString()));
717 > return { session, chat, message, ...(chatId !== undefined ? { chatId } : {}) };
718 > }
719
720 /**
723 * to avoid a session trivially messaging itself in a loop.
724 */
725 > export async function applySendMessageTool(accessor: ISessionServerToolAccessor, rawArgs: unknown, currentChannel?: ProtocolURI): Promise<string> { sessionServerTools.ts
726 > const sessions = await accessor.listSessions();
727 > const { session, chat, chatId, message } = getSendMessageArgs(rawArgs, sessions);
728 > if (currentChannel && chat.toString() === URI.parse(currentChannel).toString()) {
729 > throw new Error(`Invalid ${sendMessageToolName} input: refusing to send a message to the current chat.`);
730 > }
731 > await accessor.startPrompt(session, chat, message);
732 > return formatSendMessageResult(buildOpenSessionLinkUri(session, chatId));
733 > }
734
735 /** Builds the model-facing `send_message` result. */
736 export function formatSendMessageResult(openLink: string): string {
737 > return `Message sent (${openLink}). Reply with one short sentence confirming the message was sent; do not print the URL or mention a button.`; sessionServerTools.ts
738 > }
739
740 // --- get_session_context -----------------------------------------------------