/**
 * Crewly MCP Server Service
 *
 * Exposes Crewly capabilities as MCP (Model Context Protocol) tools so that
 * external AI tools — Claude Code, Cursor, Windsurf, etc. — can manage
 * Crewly teams via the standard MCP protocol.
 *
 * This is Crewly's unique differentiator: no competitor offers a
 * "team management backend" controllable via MCP.
 *
 * Supported tools:
 * - crewly_get_teams — List all teams and their members/status
 * - crewly_create_team — Create a new team with members
 * - crewly_assign_task — Assign a task to a specific agent
 * - crewly_get_status — Get agent/team status
 * - crewly_recall_memory — Search team memory/knowledge
 * - crewly_send_message — Send a message to an agent
 *
 * @module services/mcp-server
 */
/**
 * MCP Server configuration constants.
 */
export declare const MCP_SERVER_CONSTANTS: {
    /** Server identification sent during MCP handshake */
    readonly SERVER_INFO: {
        readonly NAME: "crewly-mcp-server";
        readonly VERSION: "1.0.0";
    };
    /** Tool name prefix for namespacing */
    readonly TOOL_PREFIX: "crewly";
};
/**
 * Configuration for the Crewly MCP Server.
 */
export interface CrewlyMcpServerConfig {
    /** Path to the crewly home directory (default: ~/.crewly) */
    crewlyHome?: string;
}
/**
 * CrewlyMcpServer exposes Crewly team management capabilities as MCP tools.
 *
 * External AI tools can connect to this server via stdio transport and use
 * the provided tools to create teams, assign tasks, check status, search
 * memory, and send messages — all through the standard MCP protocol.
 *
 * @example
 * ```typescript
 * const mcpServer = new CrewlyMcpServer();
 * await mcpServer.start(); // Starts on stdio
 * ```
 *
 * @example Claude Code configuration (~/.claude/claude_desktop_config.json):
 * ```json
 * {
 *   "mcpServers": {
 *     "crewly": {
 *       "command": "npx",
 *       "args": ["crewly", "mcp-server"]
 *     }
 *   }
 * }
 * ```
 */
export declare class CrewlyMcpServer {
    private server;
    private readonly storage;
    private readonly memory;
    private transport;
    private stdioTransportCtor;
    private geminiCliHelper;
    private getGeminiCliHelper;
    /**
     * Creates a new CrewlyMcpServer instance.
     *
     * @param config - Optional server configuration
     */
    constructor(config?: CrewlyMcpServerConfig);
    /**
     * Register MCP request handlers for tool listing and tool calling.
     */
    private registerHandlers;
    /**
     * Build the Server + transport + handlers from already-loaded SDK modules.
     * Returns false if any expected SDK symbol is missing (so the caller can
     * decide whether to throw or silently fall back). Both `ensureInitialized`
     * (dynamic import) and `tryInitializeWithRequire` (CommonJS require) feed
     * their loaded modules through here.
     */
    private installSdkModules;
    private ensureInitialized;
    private tryInitializeWithRequire;
    /**
     * Route a tool call to the appropriate handler.
     *
     * @param name - Tool name
     * @param args - Tool arguments
     * @returns Tool result with content blocks
     */
    private handleToolCall;
    /**
     * Format a TeamMember for an MCP response. Three variants share the
     * same base (id/name/role/agentStatus/workingStatus); `includeRuntime`
     * adds `runtimeType` + `sessionName`, and `includeTickets` adds
     * `currentTickets`. Keeping all three paths in one place so that a
     * field added to the member shape only needs to be surfaced once.
     */
    private formatMember;
    /**
     * Handle crewly_get_teams: list all teams and their members.
     *
     * @param args - Optional { teamId } to filter
     * @returns Formatted team list
     */
    private handleGetTeams;
    /**
     * Handle crewly_create_team: create a new team with members.
     *
     * @param args - { name, description?, members: [{name, role, runtimeType?}] }
     * @returns Created team info
     */
    private handleCreateTeam;
    /**
     * Handle crewly_assign_task: assign a task to a specific agent.
     *
     * This stores the task description on the member's currentTickets field
     * so the orchestrator or dashboard can pick it up. For direct delivery,
     * use crewly_send_message to the orchestrator with task instructions.
     *
     * @param args - { teamId, memberId, task }
     * @returns Assignment confirmation
     */
    private handleAssignTask;
    /**
     * Handle crewly_get_status: get status for teams/agents.
     *
     * @param args - Optional { teamId, memberId } filters
     * @returns Status information
     */
    private handleGetStatus;
    /**
     * Handle crewly_recall_memory: search team memory/knowledge.
     *
     * @param args - { query, agentId?, projectPath?, scope? }
     * @returns Search results
     */
    private handleRecallMemory;
    /**
     * Handle crewly_send_message: send a message to the orchestrator.
     *
     * @param args - { message, conversationId? }
     * @returns Confirmation with message ID
     */
    private handleSendMessage;
    /**
     * Handle crewly_credential_list: return credential metadata (no values).
     */
    private handleCredentialList;
    /**
     * Handle crewly_credential_add_api_key: store an API key.
     */
    private handleCredentialAddApiKey;
    /**
     * Handle crewly_credential_oauth_import_gemini_cli: capture the current
     * gemini-cli-workspace extension login into an encrypted Crewly credential.
     */
    private handleCredentialImportGeminiCli;
    /**
     * Handle crewly_credential_clear_gemini_cli_file: delete the extension's
     * cached token file so the next extension login captures a fresh account.
     */
    private handleCredentialClearGeminiCliFile;
    /**
     * Handle crewly_credential_delete: remove a credential.
     */
    private handleCredentialDelete;
    /**
     * Handle crewly_execute_skill: run a skill with optional credential bindings.
     */
    private handleExecuteSkill;
    /**
     * Create a success result with JSON-serialized content.
     *
     * @param data - Data to serialize as the result
     * @returns ToolResult with text content
     */
    private successResult;
    /**
     * Create an error result.
     *
     * @param message - Error message
     * @returns ToolResult with isError flag
     */
    private errorResult;
    /**
     * Start the MCP server on stdio transport.
     *
     * This connects stdin/stdout for MCP protocol communication.
     * The process will stay alive until the client disconnects.
     */
    start(): Promise<void>;
    /**
     * Stop the MCP server and clean up resources.
     */
    stop(): Promise<void>;
    /**
     * Get the underlying MCP Server instance (for testing).
     *
     * @returns The Server instance
     */
    getServer(): any;
}
//# sourceMappingURL=mcp-server.d.ts.map