UNPKG

@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.

114 lines 5.34 kB
/** * Type-safe context examples for ensemble conditional activation * * This file demonstrates how to use the ConditionContext interface * when writing activation conditions for ensemble elements. * * NOTE: Condition evaluation is not yet implemented. These examples * show the correct syntax for when evaluation is added in the future. * * @see {@link ConditionContext} for available context properties * @see docs/guides/ensembles.md#conditional-activation for full guide * * FIX: DMCP-SEC-006 - No security logging required * RATIONALE: This file contains ONLY documentation examples and constant declarations. * All exports are readonly example data (const objects and functions that return test fixtures). * No security-relevant operations are performed. * Security logging occurs in EnsembleManager.ts when ensembles are actually activated. * * VERIFICATION: All exports are const objects or test helper functions * @security-audit-suppress DMCP-SEC-006 */ import type { ConditionContext } from './types.js'; /** * Example context object structure * * This shows what a real ConditionContext looks like at runtime. * All properties are readonly and type-safe. */ declare const exampleContext: ConditionContext; /** * Demonstrates how to safely access context properties * * All properties are readonly and properly typed. * TypeScript will catch typos and invalid property access. */ declare function demonstrateTypeSafety(ctx: ConditionContext): void; /** * Example of building context in tests * * Shows how to construct a valid ConditionContext for testing. */ declare function createTestContext(): ConditionContext; /** * All example conditions organized by category * * Import and reference these in documentation and tests. */ export declare const CONDITIONS: { readonly element: { readonly highPriority: "priority >= 80"; readonly criticalPriority: "priority > 90"; readonly isPrimary: "role == 'primary'"; readonly isSupport: "role == 'support'"; readonly hasDependencies: "dependencies.length > 0"; readonly noDependencies: "dependencies.length == 0"; readonly criticalPrimaryElement: "priority > 90 && role == 'primary'"; readonly supportWithDeps: "role == 'support' && dependencies.length > 0"; }; readonly context: { readonly isProduction: "context.environment == 'production'"; readonly isDevelopment: "context.environment == 'development'"; readonly securityReviewPassed: "context.security_review == true"; readonly overrideEnabled: "context.override_enabled == true"; readonly highRequestCount: "context.request_count > 100"; readonly lowRequestCount: "context.request_count < 10"; readonly strictMode: "context.mode == 'strict'"; readonly adminUser: "context.user_role == 'admin'"; readonly productionWithSecurity: "context.environment == 'production' && context.security_review == true"; readonly adminOverride: "context.user_role == 'admin' || context.override_enabled == true"; }; readonly state: { readonly afterThreeElements: "state.activatedCount > 3"; readonly firstElement: "state.activatedCount == 0"; readonly lastElement: "state.activatedCount == state.totalElements - 1"; readonly noFailures: "state.failedCount == 0"; readonly hasFailures: "state.failedCount > 0"; readonly tooManyFailures: "state.failedCount > 2"; readonly halfwayDone: "state.activatedCount >= state.totalElements / 2"; readonly mostlyDone: "state.activatedCount >= state.totalElements * 0.8"; readonly lateStageNoCriticalFailures: "state.activatedCount > 5 && state.failedCount < 2"; }; readonly resources: { readonly fastExecution: "resources.executionTimeMs < 5000"; readonly slowExecution: "resources.executionTimeMs > 10000"; readonly smallContext: "resources.contextSize < 100"; readonly largeContext: "resources.contextSize > 500"; readonly fewInstances: "resources.cachedInstances < 10"; readonly manyInstances: "resources.cachedInstances > 50"; readonly resourcesAvailable: "resources.executionTimeMs < 20000 && resources.contextSize < 800"; readonly approachingLimits: "resources.executionTimeMs > 25000 || resources.contextSize > 900"; }; readonly ownership: { readonly securityCheckerApproved: "contextOwners.security_review == 'security-checker'"; readonly configLoaderSet: "contextOwners.environment == 'config-loader'"; readonly trustedSecurityReview: "context.security_review == true && contextOwners.security_review == 'security-checker'"; readonly authenticatedAdmin: "context.user_role == 'admin' && contextOwners.user_role == 'auth-handler'"; }; readonly complex: { readonly securityRequirementsMet: string; readonly progressiveActivation: string; readonly allowedOverride: string; readonly performanceGated: string; readonly roleBased: string; }; }; /** * Example context for documentation and testing */ export { exampleContext, createTestContext }; /** * Type-safe context demonstration */ export { demonstrateTypeSafety }; //# sourceMappingURL=context-examples.d.ts.map