promptsServiceImpl.ts ×6

Frontier kind: Code frontier

unlabeled · c_d89a43eea018

18 tests · 37527 LOC · 180 files · introduces 0 tests · 31 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
8 ranges31 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
3354 ranges37527 lines · 180 files · Browse complete extent
All tests (intent)
18 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.

2 files ranked by introduced lines: 31 introduced LOC across 8 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.ts 26 introduced LOC · 6 ranges

Open complete file

1550 export namespace CustomAgent {
1551 export function fromParsedPromptFile(ast: ParsedPromptFile, extra: { name?: string; description?: string; source: IAgentSource; hooks?: ChatRequestHooks; sessionTypes: readonly string[] | undefined; enabled: boolean }): ICustomAgent {
1552 > const uri = ast.uri; promptsServiceImpl.ts
1553 > const { hooks, sessionTypes, enabled } = extra;
1554 >
1555 > // eslint-disable-next-line @typescript-eslint/no-explicit-any
1556 > let metadata: any | undefined;
1557 > if (ast.header) {
1558 const advanced = ast.header.getAttribute(PromptHeaderAttributes.advancedOptions);
1559 if (advanced && advanced.value.type === 'map') {
1566 }
1567 }
1568 > const toolReferences: IVariableReference[] = []; promptsServiceImpl.ts
1569 > if (ast.body) {
1570 const bodyOffset = ast.body.offset;
1571 const bodyVarRefs = ast.body.variableReferences;
1576 }
1577 }
1579 > const agentInstructions = { content: ast.body?.getContent() ?? '', toolReferences, metadata } satisfies IAgentInstructions;
1580 >
1581 > const name = ast.header?.name ?? extra.name ?? getCleanPromptName(uri);
1582 > const description = ast.header?.description ?? extra.description;
1583 > const target = getTarget(PromptsType.agent, ast.header ?? uri);
1584 > const id = uri.toString();
1585 >
1586 > const source = extra.source;
1587 > if (!ast.header) {
1588 return { id, uri, name, agentInstructions, source, target, visibility: { userInvocable: true, agentInvocable: true }, sessionTypes, hooks, enabled };
1589 }
1590 const visibility = {
1591 userInvocable: ast.header.userInvocable !== false,
1592 > agentInvocable: ast.header.infer !== undefined ? ast.header.infer === true : ast.header.disableModelInvocation !== true, promptsServiceImpl.ts
1593 > } satisfies ICustomAgentVisibility;
1594 >
1595 > let model = ast.header.model;
1596 > if (target === Target.Claude && model) {
1597 model = mapClaudeModels(model);
1598 }
1599 let { tools, handOffs, argumentHint, agents } = ast.header;
1600 > if (target === Target.Claude && tools) { promptsServiceImpl.ts
1601 tools = mapClaudeTools(tools);
1602 }
1603 return { id, uri, name, description, model, tools, handOffs, argumentHint, target, visibility, agents, agentInstructions, source, sessionTypes, hooks, enabled };
1605 > }
1606 }
src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptFileAttributes.ts 5 introduced LOC · 2 ranges

Open complete file

414
415 export function getTarget(promptType: PromptsType, header: PromptHeader | URI): Target {
416 > const uri = header instanceof URI ? header : header.uri; promptFileAttributes.ts
417 > if (promptType === PromptsType.agent) {
418 > const parentDir = dirname(uri);
419 > if (parentDir.path.endsWith(`/${CLAUDE_AGENTS_SOURCE_FOLDER}`)) {
420 return Target.Claude;
421 }
422 > if (!(header instanceof URI)) { promptFileAttributes.ts
423 const target = header.target;
424 if (target === Target.GitHubCopilot || target === Target.VSCode) {