@kya-os/mcp-i
Version:
The TypeScript MCP framework with identity features built-in
64 lines (63 loc) • 1.61 kB
TypeScript
/**
* Runtime integration for test infrastructure
*
* This module provides integration points between the test infrastructure
* and the XMCP-I runtime to ensure test mode works seamlessly.
*/
/**
* Test mode runtime configuration
*/
export interface TestRuntimeConfig {
skipKTACalls: boolean;
useMockIdentities: boolean;
deterministicKeys: boolean;
mockKTAResponses: boolean;
}
/**
* Get test runtime configuration
*/
export declare function getTestRuntimeConfig(): TestRuntimeConfig | null;
/**
* Intercept KTA calls in test mode
*/
export declare function interceptKTACall<T>(operation: string, originalCall: () => Promise<T>, mockResponse?: () => Promise<T>): Promise<T>;
/**
* Get test identity for runtime use
*/
export declare function getTestIdentityForRuntime(identityKey?: string): {
did: string;
kid: string;
privateKey: string;
publicKey: string;
createdAt: string;
lastRotated?: string | undefined;
};
/**
* Create test session context
*/
export declare function createTestSessionContext(options?: {
sessionId?: string;
audience?: string;
nonce?: string;
timestamp?: number;
}): {
sessionId: string;
audience: string;
nonce: string;
timestamp: number;
createdAt: number;
lastActivity: number;
ttlMinutes: number;
};
/**
* Validate test environment setup
*/
export declare function validateTestEnvironment(): {
valid: boolean;
errors: string[];
warnings: string[];
};
/**
* Test mode guard decorator
*/
export declare function testModeOnly<T extends (...args: any[]) => any>(fn: T): T;