UNPKG

@vfarcic/dot-ai

Version:

AI-powered development productivity platform that enhances software development workflows through intelligent automation and AI-driven assistance

58 lines (57 loc) 1.5 kB
"use strict"; /** * No-Op AI Provider * * Placeholder provider used when no AI API keys are configured. * Allows the MCP server to start successfully even without AI capabilities, * enabling tools that don't require AI (e.g., prompts, project-setup) to function. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.NoOpAIProvider = void 0; const constants_1 = require("../constants"); class NoOpAIProvider { static ERROR_MESSAGE = constants_1.AI_SERVICE_ERROR_TEMPLATES.PROVIDER_NOT_AVAILABLE; /** * Creates a NoOp provider that doesn't require API keys */ constructor() { // No initialization needed } /** * Always returns false since no actual AI provider is configured */ isInitialized() { return false; } /** * Returns a placeholder model name */ getDefaultModel() { return 'none'; } /** * Returns the provider type */ getProviderType() { return 'noop'; } /** * Returns the model name */ getModelName() { return 'none'; } /** * Throws error explaining AI is not available */ async sendMessage(_message, _operation, _evaluationContext) { throw new Error(NoOpAIProvider.ERROR_MESSAGE); } /** * Throws error explaining AI is not available */ async toolLoop(_config) { throw new Error(NoOpAIProvider.ERROR_MESSAGE); } } exports.NoOpAIProvider = NoOpAIProvider;