Skip to content

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

typescript
const tool = new Tool('read_file');
const group = new Group('filesystem');

group.addChildTool(tool);
tool.parentGroups; // [group]

See

Extends

Extended by

Properties

description

ts
description: string | undefined;

Defined in: packages/core/src/domain/BaseModel.ts:33

Detailed description of this entity's purpose

Inherited from

BaseModel.description


icons

ts
icons: Icon[] | undefined;

Defined in: packages/core/src/domain/BaseModel.ts:37

Visual icons associated with this entity

Inherited from

BaseModel.icons


meta

ts
meta: Map<string, unknown> | undefined;

Defined in: packages/core/src/domain/BaseModel.ts:35

Arbitrary key-value metadata for extensibility

Inherited from

BaseModel.meta


name

ts
readonly name: string;

Defined in: packages/core/src/domain/BaseModel.ts:29

Unique identifier within the parent scope

Inherited from

BaseModel.name


nameSeparator

ts
readonly nameSeparator: string;

Defined in: packages/core/src/domain/BaseModel.ts:27

Separator character for constructing fully qualified names

Inherited from

BaseModel.nameSeparator


parentGroups

ts
readonly parentGroups: Group[];

Defined in: packages/core/src/domain/GroupItem.ts:28

Groups that contain this item (many-to-many relationship)


title

ts
title: string | undefined;

Defined in: packages/core/src/domain/BaseModel.ts:31

Human-readable display title

Inherited from

BaseModel.title


DEFAULT_SEPARATOR

ts
readonly static DEFAULT_SEPARATOR: string = ".";

Defined in: packages/core/src/domain/BaseModel.ts:24

Default separator used in fully qualified names

Inherited from

BaseModel.DEFAULT_SEPARATOR

Methods

addParentGroup()

ts
addParentGroup(parentGroup): boolean;

Defined in: packages/core/src/domain/GroupItem.ts:41

Add this item to a parent group.

Parameters

ParameterTypeDescription
parentGroupGroupThe group to join

Returns

boolean

false if already a member, true if added


getFullyQualifiedName()

ts
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()

ts
removeParentGroup(parentGroup): boolean;

Defined in: packages/core/src/domain/GroupItem.ts:53

Remove this item from a parent group.

Parameters

ParameterTypeDescription
parentGroupGroupThe group to leave

Returns

boolean

false if not found, true if removed