@hiveforge/hivemind-mcp 2.1.1 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Template system type definitions.
|
|
3
|
+
*
|
|
4
|
+
* This module defines the core interfaces for the pluggable template system,
|
|
5
|
+
* which allows users to define custom entity types in config.json without
|
|
6
|
+
* writing code.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Supported field data types for template fields.
|
|
10
|
+
*
|
|
11
|
+
* - string: Text values
|
|
12
|
+
* - number: Numeric values (integers or decimals)
|
|
13
|
+
* - boolean: True/false values
|
|
14
|
+
* - enum: One of a predefined set of string values
|
|
15
|
+
* - array: List of values (specify item type with arrayItemType)
|
|
16
|
+
* - date: ISO 8601 date strings
|
|
17
|
+
* - record: Key-value pairs (object)
|
|
18
|
+
*/
|
|
19
|
+
export type FieldType = 'string' | 'number' | 'boolean' | 'enum' | 'array' | 'date' | 'record';
|
|
20
|
+
/**
|
|
21
|
+
* Configuration for a single field in an entity type.
|
|
22
|
+
*
|
|
23
|
+
* Defines the name, type, validation rules, and default value for a custom
|
|
24
|
+
* field beyond the base entity fields (name, content, tags, relations).
|
|
25
|
+
*/
|
|
26
|
+
export interface FieldConfig {
|
|
27
|
+
/** Field name (e.g., "age", "status") */
|
|
28
|
+
name: string;
|
|
29
|
+
/** Data type of the field */
|
|
30
|
+
type: FieldType;
|
|
31
|
+
/** Whether this field is required (default: false) */
|
|
32
|
+
required?: boolean;
|
|
33
|
+
/** Default value if not provided */
|
|
34
|
+
default?: unknown;
|
|
35
|
+
/** Valid values when type is 'enum' (required for enum fields) */
|
|
36
|
+
enumValues?: string[];
|
|
37
|
+
/** Type of items when type is 'array' (default: 'string') */
|
|
38
|
+
arrayItemType?: FieldType;
|
|
39
|
+
/** Human-readable description for documentation and MCP tool descriptions */
|
|
40
|
+
description?: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Configuration for a custom entity type.
|
|
44
|
+
*
|
|
45
|
+
* Defines a new entity type (e.g., "character", "location") with its
|
|
46
|
+
* custom fields and metadata.
|
|
47
|
+
*/
|
|
48
|
+
export interface EntityTypeConfig {
|
|
49
|
+
/** Entity type name (lowercase, alphanumeric, e.g., "character") */
|
|
50
|
+
name: string;
|
|
51
|
+
/** Human-readable display name (e.g., "Character") */
|
|
52
|
+
displayName: string;
|
|
53
|
+
/** Plural form for UI (e.g., "Characters") */
|
|
54
|
+
pluralName: string;
|
|
55
|
+
/** Description of this entity type for documentation */
|
|
56
|
+
description?: string;
|
|
57
|
+
/** Custom fields beyond base entity fields */
|
|
58
|
+
fields: FieldConfig[];
|
|
59
|
+
/** Optional icon identifier for UI rendering */
|
|
60
|
+
icon?: string;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Complete template definition.
|
|
64
|
+
*
|
|
65
|
+
* A template is a collection of entity types that work together
|
|
66
|
+
* (e.g., "worldbuilding" template with characters, locations, events).
|
|
67
|
+
*/
|
|
68
|
+
export interface TemplateDefinition {
|
|
69
|
+
/** Unique template identifier (e.g., "worldbuilding") */
|
|
70
|
+
id: string;
|
|
71
|
+
/** Human-readable template name (e.g., "Worldbuilding") */
|
|
72
|
+
name: string;
|
|
73
|
+
/** Semantic version for migrations (e.g., "1.0.0") */
|
|
74
|
+
version: string;
|
|
75
|
+
/** Description of what this template is for */
|
|
76
|
+
description?: string;
|
|
77
|
+
/** Entity types included in this template */
|
|
78
|
+
entityTypes: EntityTypeConfig[];
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Structure of the template configuration in config.json.
|
|
82
|
+
*
|
|
83
|
+
* Users can define custom templates inline or reference built-in templates.
|
|
84
|
+
*/
|
|
85
|
+
export interface TemplateConfig {
|
|
86
|
+
/** Custom template definitions (optional, for inline templates) */
|
|
87
|
+
templates?: TemplateDefinition[];
|
|
88
|
+
/** ID of the template to use (can be builtin or custom) */
|
|
89
|
+
activeTemplate: string;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Runtime registry entry for a template.
|
|
93
|
+
*
|
|
94
|
+
* Extends TemplateDefinition with runtime metadata and optimized lookups.
|
|
95
|
+
*/
|
|
96
|
+
export interface TemplateRegistryEntry extends TemplateDefinition {
|
|
97
|
+
/** Source of this template (builtin or user-defined) */
|
|
98
|
+
source: 'builtin' | 'config';
|
|
99
|
+
/** Fast lookup map from entity type name to config */
|
|
100
|
+
entityTypeMap: Map<string, EntityTypeConfig>;
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/templates/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;;;GAUG;AACH,MAAM,MAAM,SAAS,GACjB,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,MAAM,GACN,OAAO,GACP,MAAM,GACN,QAAQ,CAAC;AAEb;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IAEb,6BAA6B;IAC7B,IAAI,EAAE,SAAS,CAAC;IAEhB,sDAAsD;IACtD,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,oCAAoC;IACpC,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,kEAAkE;IAClE,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IAEtB,6DAA6D;IAC7D,aAAa,CAAC,EAAE,SAAS,CAAC;IAE1B,6EAA6E;IAC7E,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,oEAAoE;IACpE,IAAI,EAAE,MAAM,CAAC;IAEb,sDAAsD;IACtD,WAAW,EAAE,MAAM,CAAC;IAEpB,8CAA8C;IAC9C,UAAU,EAAE,MAAM,CAAC;IAEnB,wDAAwD;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,8CAA8C;IAC9C,MAAM,EAAE,WAAW,EAAE,CAAC;IAEtB,gDAAgD;IAChD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC,yDAAyD;IACzD,EAAE,EAAE,MAAM,CAAC;IAEX,2DAA2D;IAC3D,IAAI,EAAE,MAAM,CAAC;IAEb,sDAAsD;IACtD,OAAO,EAAE,MAAM,CAAC;IAEhB,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,6CAA6C;IAC7C,WAAW,EAAE,gBAAgB,EAAE,CAAC;CACjC;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,mEAAmE;IACnE,SAAS,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAEjC,2DAA2D;IAC3D,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;;;GAIG;AACH,MAAM,WAAW,qBAAsB,SAAQ,kBAAkB;IAC/D,wDAAwD;IACxD,MAAM,EAAE,SAAS,GAAG,QAAQ,CAAC;IAE7B,sDAAsD;IACtD,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;CAC9C"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Template system type definitions.
|
|
3
|
+
*
|
|
4
|
+
* This module defines the core interfaces for the pluggable template system,
|
|
5
|
+
* which allows users to define custom entity types in config.json without
|
|
6
|
+
* writing code.
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/templates/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
package/package.json
CHANGED