@creedspace/mcp-server
Version:
Universal MCP server for Creed Space - AI safety guardrails in 10 seconds
46 lines • 1.39 kB
JavaScript
/**
* API and MCP server type definitions
* Replaces unsafe 'as any' assertions with proper types
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.isApiResponse = isApiResponse;
exports.isApiError = isApiError;
exports.isPersonaResponse = isPersonaResponse;
exports.isConstitutionResponse = isConstitutionResponse;
// Type guards
function isApiResponse(obj) {
return (typeof obj === 'object' &&
obj !== null &&
'success' in obj &&
typeof obj.success === 'boolean');
}
function isApiError(obj) {
return (typeof obj === 'object' &&
obj !== null &&
'code' in obj &&
'message' in obj &&
typeof obj.code === 'string' &&
typeof obj.message === 'string');
}
function isPersonaResponse(obj) {
return (typeof obj === 'object' &&
obj !== null &&
'id' in obj &&
'name' in obj &&
'icon' in obj &&
typeof obj.id === 'string' &&
typeof obj.name === 'string' &&
typeof obj.icon === 'string');
}
function isConstitutionResponse(obj) {
return (typeof obj === 'object' &&
obj !== null &&
'id' in obj &&
'name' in obj &&
'content' in obj &&
typeof obj.id === 'string' &&
typeof obj.name === 'string' &&
typeof obj.content === 'string');
}
//# sourceMappingURL=api.js.map
;