Class: GroupItem
Defined in: packages/core/src/domain/GroupItem.ts:26
Base class for leaf entities that can belong to one or more Groups.
Tool, Prompt, and Resource all extend this class to inherit group membership management. Supports many-to-many relationships with parent groups.
Example
const tool = new Tool('read_file');
const group = new Group('filesystem');
group.addChildTool(tool);
tool.parentGroups; // [group]See
- Group for parent containers
- Tool for tool leaf nodes
- Prompt for prompt leaf nodes
- Resource for resource leaf nodes
Extends
Extended by
Properties
description
description: string | undefined;Defined in: packages/core/src/domain/BaseModel.ts:33
Detailed description of this entity's purpose
Inherited from
icons
icons: Icon[] | undefined;Defined in: packages/core/src/domain/BaseModel.ts:37
Visual icons associated with this entity
Inherited from
meta
meta: Map<string, unknown> | undefined;Defined in: packages/core/src/domain/BaseModel.ts:35
Arbitrary key-value metadata for extensibility
Inherited from
name
readonly name: string;Defined in: packages/core/src/domain/BaseModel.ts:29
Unique identifier within the parent scope
Inherited from
nameSeparator
readonly nameSeparator: string;Defined in: packages/core/src/domain/BaseModel.ts:27
Separator character for constructing fully qualified names
Inherited from
parentGroups
readonly parentGroups: Group[];Defined in: packages/core/src/domain/GroupItem.ts:28
Groups that contain this item (many-to-many relationship)
title
title: string | undefined;Defined in: packages/core/src/domain/BaseModel.ts:31
Human-readable display title
Inherited from
DEFAULT_SEPARATOR
readonly static DEFAULT_SEPARATOR: string = ".";Defined in: packages/core/src/domain/BaseModel.ts:24
Default separator used in fully qualified names
Inherited from
Methods
addParentGroup()
addParentGroup(parentGroup): boolean;Defined in: packages/core/src/domain/GroupItem.ts:41
Add this item to a parent group.
Parameters
| Parameter | Type | Description |
|---|---|---|
parentGroup | Group | The group to join |
Returns
boolean
false if already a member, true if added
getFullyQualifiedName()
getFullyQualifiedName(): string;Defined in: packages/core/src/domain/GroupItem.ts:58
Returns the simple name (leaf items have no hierarchy prefix)
Returns
string
Overrides
BaseModel.getFullyQualifiedName
removeParentGroup()
removeParentGroup(parentGroup): boolean;Defined in: packages/core/src/domain/GroupItem.ts:53
Remove this item from a parent group.
Parameters
| Parameter | Type | Description |
|---|---|---|
parentGroup | Group | The group to leave |
Returns
boolean
false if not found, true if removed