import { BaseModel } from './BaseModel.js'; import { type Tool } from './Tool.js'; import { type Prompt } from './Prompt.js'; import { type Resource } from './Resource.js'; /** * Represents a hierarchical group (tree node) in the MCP domain model. * * Groups can contain child groups, tools, prompts, and resources. * Supports fully qualified names via recursive parent traversal. * * @example * ```typescript * // Build a hierarchy * const api = new Group('api'); * const v2 = new Group('v2'); * api.addChildGroup(v2); * * const readFile = new Tool('read_file'); * v2.addChildTool(readFile); * * v2.getFullyQualifiedName(); // "api.v2" * api.isRoot(); // true * v2.getRoot(); // api * ``` * * @see {@link GroupItem} for leaf nodes (Tool, Prompt, Resource) * @see {@link BaseModel} for shared properties */ export declare class Group extends BaseModel { /** Parent group (null if this is a root node) */ parent: Group | null; /** Direct child groups in this container */ readonly childGroups: Group[]; /** Tools contained in this group */ readonly childTools: Tool[]; /** Prompts contained in this group */ readonly childPrompts: Prompt[]; /** Resources contained in this group */ readonly childResources: Resource[]; constructor(name: string, nameSeparator?: string); private addChild; private removeChild; /** * Traverse to the root of the tree. * * @returns The topmost ancestor group * * @example * ```typescript * const root = new Group('api'); * const child = new Group('users'); * root.addChildGroup(child); * child.getRoot(); // root * ``` */ getRoot(): Group; /** Returns `true` if this group has no parent (is a root node). */ isRoot(): boolean; /** * Add a child group to this container. * * @param childGroup - The group to nest under this one * @returns `false` if already a child, `true` if added */ addChildGroup(childGroup: Group): boolean; /** * Remove a child group from this container. * * @param childGroup - The group to remove * @returns `false` if not found, `true` if removed */ removeChildGroup(childGroup: Group): boolean; /** Add a tool to this group. Returns `false` if already present. */ addChildTool(childTool: Tool): boolean; /** Remove a tool from this group. Returns `false` if not found. */ removeChildTool(childTool: Tool): boolean; /** Add a prompt to this group. Returns `false` if already present. */ addChildPrompt(childPrompt: Prompt): boolean; /** Remove a prompt from this group. Returns `false` if not found. */ removeChildPrompt(childPrompt: Prompt): boolean; /** Add a resource to this group. Returns `false` if already present. */ addChildResource(childResource: Resource): boolean; /** Remove a resource from this group. Returns `false` if not found. */ removeChildResource(childResource: Resource): boolean; protected getFullyQualifiedNameRecursive(tg: Group): string; /** * Returns the dot-separated fully qualified name. * * @example * ```typescript * const root = new Group('api'); * const v2 = new Group('v2'); * root.addChildGroup(v2); * v2.getFullyQualifiedName(); // "api.v2" * ``` */ getFullyQualifiedName(): string; } //# sourceMappingURL=Group.d.ts.map