public async getCustomAgents(token: CancellationToken): Promise<readonly ICustomAgent[]> {
const result = this.agentsFromDiscoveryInfo(discoveryInfo);
return result;
}
/**
Frontier kind: Code frontier
unlabeled · c_d5a8d668b871
17 tests · 69178 LOC · 326 files · introduces 0 tests · 73 LOC · 4 files
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.
Every exact file and test below is linked only from the concept that introduces it.
mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/stream.test|title=Stream WriteableStream - end with empty string works|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/stream.test|title=Stream WriteableStream - end with error works|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/charCode.test|title=CharCode has good values|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/path.test|title=Paths (Node Implementation) path|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/uri.test|title=URI File paths containing apostrophes break URI parsing and cannot be opened #276075|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/uri.test|title=URI URI#file, win-speciale|occurrence=1Every collected test enters the hierarchy at exactly one concept.
No tests are introduced at this concept. Its intent tests are introduced by other concepts.
Every collected source range enters the hierarchy at exactly one concept.
4 files ranked by introduced lines: 73 introduced LOC across 19 ranges. Expand a file to inspect source; the > gutter marks introduced lines.
public async getCustomAgents(token: CancellationToken): Promise<readonly ICustomAgent[]> {
const result = this.agentsFromDiscoveryInfo(discoveryInfo);
return result;
}
/**
*/
private agentsFromDiscoveryInfo(discoveryInfo: IAgentDiscoveryInfo): readonly ICustomAgent[] {
for (const file of discoveryInfo.files) {
if (file.agent) {
result.push(file.agent);
}
}
return result;
}
private async computeAgentDiscoveryInfo(token: CancellationToken): Promise<IAgentDiscoveryInfo> {
const allAgentFiles = await this.listPromptFiles(PromptsType.agent, token);
const disabledAgents = this.getDisabledPromptFiles(PromptsType.agent);
const useChatHooks = this.configurationService.getValue(PromptsConfig.USE_CHAT_HOOKS);
const isWorkspaceTrusted = this.workspaceTrustService.isWorkspaceTrusted();
// Get user home for tilde expansion in hook cwd paths
const userHomeUri = await this.pathService.userHome();
const userHome = userHomeUri.scheme === Schemas.file ? userHomeUri.fsPath : userHomeUri.path;
const defaultFolder = this.workspaceService.getWorkspace().folders[0];
const files = await Promise.all(allAgentFiles.map(async (promptPath): Promise<IAgentDiscoveryResult> => {
const uri = promptPath.uri;
const isEnabled = !disabledAgents.has(uri);
try {
const ast = await this.parseNew(uri, token);
// Parse hooks from the frontmatter if present
let hooks: ChatRequestHooks | undefined;
const hooksRaw = ast.header?.hooksRaw;
if (useChatHooks && isWorkspaceTrusted && hooksRaw) {
const hookWorkspaceFolder = this.workspaceService.getWorkspaceFolder(uri) ?? defaultFolder;
const workspaceRootUri = hookWorkspaceFolder?.uri;
hooks = parseSubagentHooksFromYaml(hooksRaw, workspaceRootUri, userHome, target);
}
sessionTypes: promptPath.sessionTypes,
hooks,
name: promptPath.name,
description: promptPath.description,
source: IAgentSource.fromPromptPath(promptPath),
enabled: isEnabled,
};
const agent = CustomAgent.fromParsedPromptFile(ast, extra);
const status = isEnabled ? 'loaded' : 'skipped';
const skipReason = isEnabled ? undefined : 'disabled';
return { status, skipReason, promptPath: this.withPromptPathMetadata(promptPath, agent.name, agent.description), agent };
} catch (e) {
const error = e instanceof Error ? e : new Error(String(e));
if (error instanceof FileOperationError && error.fileOperationResult === FileOperationResult.FILE_NOT_FOUND) {
};
}
const sourceFolders = await this._collectSourceFolderDiagnostics(PromptsType.agent);
return { type: PromptsType.agent, files, sourceFolders, durationInMillis: stopWatch.elapsed() };
}
let metadata: any | undefined;
if (ast.header) {
const advanced = ast.header.getAttribute(PromptHeaderAttributes.advancedOptions);
promptsServiceImpl.ts
if (advanced && advanced.value.type === 'map') {
metadata = {};
for (const [key, value] of Object.entries(advanced.value)) {
}
}
const toolReferences: IVariableReference[] = [];
if (ast.body) {
return { id, uri, name, agentInstructions, source, target, visibility: { userInvocable: true, agentInvocable: true }, sessionTypes, hooks, enabled };
}
userInvocable: ast.header.userInvocable !== false,
agentInvocable: ast.header.infer !== undefined ? ast.header.infer === true : ast.header.disableModelInvocation !== true,
} satisfies ICustomAgentVisibility;
model = mapClaudeModels(model);
}
if (target === Target.Claude && tools) {
tools = mapClaudeTools(tools);
}
return { id, uri, name, description, model, tools, handOffs, argumentHint, target, visibility, agents, agentInstructions, source, sessionTypes, hooks, enabled };
promptsServiceImpl.ts
}
public getAttribute(key: string): IHeaderAttribute | undefined {
}
public get errors(): ParseError[] {
public get infer(): boolean | undefined {
}
public get tools(): string[] | undefined {
*/
public get hooksRaw(): IMapValue | undefined {
const attr = this._parsedHeader.attributes.find(a => a.key === PromptHeaderAttributes.hooks);
promptFileParser.ts
if (attr?.value.type === 'map') {
return attr.value;
}
}
private getBooleanAttribute(key: string): boolean | undefined {
}
if (!(header instanceof URI)) {
if (target === Target.GitHubCopilot || target === Target.VSCode) {
return target;
}
return Target.Undefined;
} else if (promptType === PromptsType.instructions) {
export namespace IAgentSource {
export function fromPromptPath(promptPath: IPromptPath): IAgentSource {
return { storage: PromptsStorage.extension, extensionId: promptPath.extension.identifier };
return { storage: PromptsStorage.plugin, pluginUri: promptPath.pluginUri! };
} else {
return { storage: promptPath.storage };
}
export function isEquals(a: IAgentSource | undefined, b: IAgentSource | undefined): boolean {