@dollhousemcp/mcp-server
Version:
DollhouseMCP - A Model Context Protocol (MCP) server that enables dynamic AI persona management from markdown files, allowing Claude and other compatible AI assistants to activate and switch between different behavioral personas.
126 lines • 3.74 kB
TypeScript
/**
* Verb Trigger Manager - Maps action verbs to elements
*
* This manager handles verb-based action triggers that map user intent
* to specific elements. Uses action verbs (debug, fix, create) instead
* of nouns for better intent matching.
*
* Key principles:
* - Verbs have higher attention probability than nouns
* - Multiple verbs can map to the same element
* - Verbs are extracted from queries and element metadata
* - Supports synonyms and related verb forms
*/
import { EnhancedIndex, ElementDefinition } from './types/IndexTypes.js';
/**
* Verb taxonomy - Common verbs grouped by intent
*/
export declare const VERB_TAXONOMY: {
debugging: string[];
creation: string[];
explanation: string[];
analysis: string[];
recall: string[];
execution: string[];
testing: string[];
configuration: string[];
security: string[];
optimization: string[];
documentation: string[];
collaboration: string[];
};
/**
* Verb trigger configuration
*/
export interface VerbTriggerConfig {
confidenceThreshold?: number;
includeSynonyms?: boolean;
maxElementsPerVerb?: number;
customVerbs?: Record<string, string[]>;
}
/**
* Verb match result
*/
export interface VerbMatch {
verb: string;
elements: ElementMatch[];
category?: string;
}
export interface ElementMatch {
name: string;
type: string;
confidence: number;
source: 'explicit' | 'inferred' | 'name-based' | 'description-based';
}
export declare class VerbTriggerManager {
private verbCache;
private config;
constructor(config?: VerbTriggerConfig);
/**
* Extract verbs from a user query
*/
extractVerbs(query: string): string[];
/**
* Check if a word is a known verb
*/
private isKnownVerb;
/**
* Get base form of a verb (remove -ing, -ed, etc.)
*
* Transforms verb variations back to their base form to enable flexible matching.
* For example, "debugging", "debugged", "debugs" all map to "debug".
*/
private getBaseVerb;
/**
* Map verb phrases to base verbs
*/
private mapPhraseToVerb;
/**
* Get elements that match a specific verb
* @param verb The verb to search for
* @param index The index to search in (passed to avoid circular dependency)
*/
getElementsForVerb(verb: string, index: EnhancedIndex): ElementMatch[];
/**
* Internal version with visited tracking to prevent infinite recursion
*/
private getElementsForVerbInternal;
/**
* Find element type by name
* FIX: Handle case where index.elements might be undefined
*/
private findElementType;
/**
* Get synonyms for a verb
*/
private getSynonyms;
/**
* Get verb category
*/
getVerbCategory(verb: string): string | null;
/**
* Process a query and get all verb matches
* @param query The query to process
* @param index The index to search in
*/
processQuery(query: string, index: EnhancedIndex): VerbMatch[];
/**
* Add custom verb mapping
*/
addCustomVerb(verb: string, elements: string[]): void;
/**
* Clear verb cache (useful after index updates)
*/
clearCache(): void;
/**
* Get all verbs that map to a specific element
* @param elementName The element to get verbs for
* @param index The index to search in (passed to avoid circular dependency)
*/
getVerbsForElement(elementName: string, index: EnhancedIndex): string[];
/**
* Generate suggested verbs for an element based on its type and name
*/
suggestVerbsForElement(element: ElementDefinition): string[];
}
//# sourceMappingURL=VerbTriggerManager.d.ts.map