UNPKG

random-tables-mcp

Version:

An MCP (Model Context Protocol) server for managing and rolling on random-table assets used in tabletop RPGs. Create, update, and roll on random tables with support for nested tables, weighted entries, and range-based results.

45 lines (44 loc) 1.63 kB
import { RollTemplateEntity } from '../../../domain/entities/roll-template-entity.js'; import { RollTemplateRepository } from '../../../ports/secondary/roll-template-repository.js'; /** * In-memory implementation of the RollTemplateRepository interface. * Stores templates in memory, useful for testing and development. */ export declare class InMemoryRollTemplateRepository implements RollTemplateRepository { private templates; /** * Saves a template to the repository. * @param template The template to save. * @returns The ID of the saved template. */ save(template: RollTemplateEntity): Promise<string>; /** * Gets a template by its ID. * @param id The ID of the template to get. * @returns The template, or null if not found. */ getById(id: string): Promise<RollTemplateEntity | null>; /** * Updates an existing template. * @param template The updated template. * @throws Error if the template does not exist. */ update(template: RollTemplateEntity): Promise<void>; /** * Lists templates based on optional filter criteria. * @param filter Optional filter criteria. * @returns An array of templates matching the filter. */ list(filter?: Record<string, unknown>): Promise<RollTemplateEntity[]>; /** * Deletes a template by its ID. * @param id The ID of the template to delete. * @throws Error if the template does not exist. */ delete(id: string): Promise<void>; /** * Clears all templates from the repository. * Useful for testing. */ clear(): void; }